Score:0

Linux Link Speed Advertise

ca flag

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?

Score:1
za flag

Add the numbers up. Observe that:

  • 0x001 is 0b000000000001,
  • 0x002 is 0b000000000010,
  • 0x004 is 0b000000000100,

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 and 100baseT Half would be 0x020 + 0x008 + 0x004 = 0x02c:

ethtool -s eth0 advertise 0x02c
aschkant avatar
ca flag
It absolutely works. Thank you so much for your help.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.