Q. How do I change the speed, duplex on for my Ethernet card?
Linux tips: Force or restart network card auto-negotiation with ethtool
Restart autonegotiation
You don’t have to reboot Linux box, all you have to do is type the following command :
Or you can use mii-tool (outdated, use ethtool only)
Output:
# ethtool -r eth0
Or you can use mii-tool (outdated, use ethtool only)
# mii-tool -r eth0
Output:
# tail -f /var/log/messages
Jul 16 09:34:25 smtp1 kernel: e1000: eth0: e1000_watchdog_task: NIC Link is Up 10 Mbps Full Duplex Jul 16 09:34:25 smtp1 kernel: e1000: eth0: e1000_watchdog_task: 10/100 speed: disabling TSO
Linux tips: add ethtool duplex settings to a network card permanently - Cent Os / Redhat / fedora
hanging your Network Interface Speed, Duplex or Auto Negotiate settings on Red Hat Linux
To set the interface speed, duplex or auto negotiation on Linux system boot up (make settings permanent), you need edit /etc/sysconfig/network-scripts/ifcfg-eth0 file for eth0 interface. This file used by Red Hat enterprise Linux, Fedora core, Cent Os etc.
Open the file:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Append following line:
ETHTOOL_OPTS="speed 100 duplex full autoneg off"
Save and close the system. It will set the eth0 device to 100Mbs, full duplex, with the auto negotiation off at boot time. You can simply restart the networking (it will disconnect all ssh or ftp session) or restart the server. Depend upon traffic and load it may take upto 1 minute to setup a new port speed:
# /etc/init.d/network restart
If you want 1000Mbs set line as follows:
ETHTOOL_OPTS="speed 1000 duplex full autoneg off"
Update: if above command failed to work for 1000Mbps use following command (see below in comment sections for discussion) :ETHTOOL_OPTS="speed 1000 duplex full autoneg on"
Thanks for the post. It was helpful.
ReplyDeleteLinux classes in Pune