Restarting a Remote Network
-
- Posts: 16
- Joined: 2012/03/25 09:36:51
Restarting a Remote Network
After issuing a ethtool -s eth0 speed 10 I still see the port speed is 1000Mb/s. Do I need to restart the network after making the change? My data center is 2 hrs. away and, well, as a rookie it scares me. If it hangs... It sucks being green. I've Googled it and cannot find the answer.
I appreciate you guys.
I appreciate you guys.
Re: Restarting a Remote Network
So what's the question? Do you mean if you set the interface to a specific speed (assuming ethernet here) will it disconnect? Well the answer lies somewhere between in what way your particular interface will react and what the switch port (i.e.: the physical port (or even the virtual port)) you are connect to will react.
For example some switches allow a port to only connect at (say) 10/full, 100/full and all else would be rejected. If that's the case and you configure the interface at (say) 10/Half, link would not be correctly established and the host would experience a lot of "network errors".
For example some switches allow a port to only connect at (say) 10/full, 100/full and all else would be rejected. If that's the case and you configure the interface at (say) 10/Half, link would not be correctly established and the host would experience a lot of "network errors".
-
- Posts: 16
- Joined: 2012/03/25 09:36:51
Re: Restarting a Remote Network
Thank you for your reply. The question does seem unclear. I am asking if I need to restart the network after changing the port speed.
My servers are SuperMicros with Asus server boards. The command seems so straight forward and therefore my questioning.
My servers are SuperMicros with Asus server boards. The command seems so straight forward and therefore my questioning.
Re: Restarting a Remote Network
No, I'm pretty sure that if you restart the network service then it will revert any changes you made using ethtool.
What is your actual goal here? If you need to restrict your connection to 10Mbps like that then you probably have a hardware error - faulty cable or network switch port, that sort of thing. If you want to limit the bandwidth available then that's probably not the way to do it, perhaps you need to look at the tc command instead.
What is your actual goal here? If you need to restrict your connection to 10Mbps like that then you probably have a hardware error - faulty cable or network switch port, that sort of thing. If you want to limit the bandwidth available then that's probably not the way to do it, perhaps you need to look at the tc command instead.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
-
- Posts: 16
- Joined: 2012/03/25 09:36:51
Re: Restarting a Remote Network
Thanks very much for your reply. I sure appreciate it. I have a small hosting operation for marketing customers. We are getting pounded by bots that spike our 100Mb/s connection across a bunch of servers. Even with our KVM/IP I cannot gain remote access because there isn't anymore bandwidth. I naively thought that if I rate restricted the interface it couldn't spike beyond 10Mb/s. But the port speed never changes. If there is a better solution I'd be happy to learn something new.
Thank you for your helpful advice.
Code: Select all
{jim@hw003 ~}# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: g
Current message level: 0x000000ff (255)
Link detected: yes
-
- Posts: 16
- Joined: 2012/03/25 09:36:51
Re: Restarting a Remote Network
AWESOME! Thanks for the hint, Trevor!!! I did not know of the TC command. I just need to learn the syntax to limit eth0 to 5Mb/s. We do use Virtuozzo but I assume that if I rate limit the nic it would be global? Now to learn the command.
-
- Posts: 16
- Joined: 2012/03/25 09:36:51
Re: Restarting a Remote Network
Oh my gosh. I hate to asak, I know that you're busy and like folks to learn on their own. But coiuld you help me undestand this? This is how to rate limit the NIC and the virtual port.
I really like to learn this. I want to rate limit at 5Mb/s. Would this be a start-up script in rc.local?
Code: Select all
Limiting outgoing bandwidth
We can limit container outgoing bandwidth by setting the tc filter on eth0.
DEV=eth0
tc qdisc del dev $DEV root
tc qdisc add dev $DEV root handle 1: cbq avpkt 1000 bandwidth 100mbit
tc class add dev $DEV parent 1: classid 1:1 cbq rate 256kbit allot 1500 prio 5 bounded isolated
tc filter add dev $DEV parent 1: protocol ip prio 16 u32 match ip src X.X.X.X flowid 1:1
tc qdisc add dev $DEV parent 1:1 sfq perturb 10
X.X.X.X is an IP address of container.
Limiting incoming bandwidth
This can be done by setting the tc filter on venet0:
DEV=venet0
tc qdisc del dev $DEV root
tc qdisc add dev $DEV root handle 1: cbq avpkt 1000 bandwidth 100mbit
tc class add dev $DEV parent 1: classid 1:1 cbq rate 256kbit allot 1500 prio 5 bounded isolated
tc filter add dev $DEV parent 1: protocol ip prio 16 u32 match ip dst X.X.X.X flowid 1:1
tc qdisc add dev $DEV parent 1:1 sfq perturb 10
Note that X.X.X.X is an IP address of container.