ethtool error for limiting interface speed

6,550

The ethtool does not work as a bandwidth limiter for your NICs, that parameter just sets the NIC speed that will be advertised as capable of, and you cant set an arbitrary value on that parameter and expect it to work. It expects one (or a combination of) of a very specific list of possible values, which are correlated to the duplex mode setting. From the man page of ethtool:

advertise N
              Sets  the  speed  and duplex advertised by autonegotiation. The
              argument is a hexidecimal value using one or a combination of
              the following values:
              0x001    10 Half
              0x002    10 Full
              0x004    100 Half
              0x008    100 Full
              0x010    1000 Half(not supported by IEEE standards)
              0x020    1000 Full
              0x8000   2500 Full(not supported by IEEE standards)
              0x1000   10000 Full
              0x03F    Auto
Share:
6,550

Related videos on Youtube

yasmink
Author by

yasmink

Updated on September 18, 2022

Comments

  • yasmink
    yasmink almost 2 years

    i am limiting my bandwidth using ethtool and i used this command: sudo ethtool -s eth2 speed 500

    But i got error message:

    Cannot advertise speed 500

    i tried adding duplex half duplex full autoneg off autoneg 0n

    i still get this message and i can't find the cause of this problem, any idea?

    note im on ubuntu machine, and my eth2 is originally 1G .

    • austinian
      austinian almost 9 years
      ethtool changes the link speed, which, for your port, probably has valid speeds of 10/100/1000 mbps. ethtool isn't the tool you are looking for
    • Zoredache
      Zoredache almost 9 years
      See: unix.stackexchange.com/questions/28198/… You probably should be looking at TC, or something else.
  • HBruijn
    HBruijn almost 9 years
    In addition: you typically can't change the speed and duplex settings at all for a para-virtualised NIC in VM.