-1

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 .

2
  • 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
    – austinian
    Jul 22, 2015 at 17:13
  • See: unix.stackexchange.com/questions/28198/… You probably should be looking at TC, or something else.
    – Zoredache
    Jul 22, 2015 at 19:02

1 Answer 1

6

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
1
  • 2
    In addition: you typically can't change the speed and duplex settings at all for a para-virtualised NIC in VM.
    – HBruijn
    Jul 22, 2015 at 19:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .