As far as I know, the following command would set the speed and duplex advertised by auto-negotiation.
ethtool -s eth0 advertise 0x020
where 0x020
indicates 1000baseT Full
according to the following guide:
advertise N
Sets the speed and duplex advertised by autonegotiation. The
argument is a hexadecimal value using one or a combination of
the following values:
0x001 10baseT Half
0x002 10baseT Full
0x004 100baseT Half
0x008 100baseT Full
0x010 1000baseT Half (not supported by IEEE standards)
0x020 1000baseT Full
The command I applied, advertises 1000baseT Full
only. I wonder to know how I set the server to advertise multiple link modes like 1000baseT Full 100baseT Full 100baseT Half
all at once.
I have tried applying the same command for desired link modes one by one, but every time the new link mode replaces the current mode and not added to it.
I have also mentioned the link modes hexacodes consecutively like the following but it returns an error.
ethtool -s eth0 advertise 0x020 0x008 0x004
ethtool: bad command line argument(s)
For more information run ethtool -h
When all are advertised, they are displayed in the ethtool
output like this:
ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Any idea please?
Best Answer
Add the numbers up. Observe that:
0x001
is0b000000000001
,0x002
is0b000000000010
,0x004
is0b000000000100
,and so on, each of them represents one bit (flag) in some register, which stores whichever modes are enabled. You need to just enable all wanted bits.
In your case,
1000baseT Full
,100baseT Full
and100baseT Half
would be0x020 + 0x008 + 0x004 = 0x02c
: