Monday, April 19, 2010

change eth0 autoneg to full duplex

You may want to try resetting the ports on any slow servers you have. This can be done by using the commands:
ethtool -s eth0 autoneg on
mii-tool -r

ethtool -s eth0 speed 100 duplex full

-----------------------




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 or add the following line
ETHTOOL_OPTS=”speed 100 duplex full autoneg off”

Save and close the file.

Finally restart the network service
# /etc/init.d/network restart

You can check the current network interface speed using the below command
# /usr/sbin/ethtool eth0 |grep Speed
----------
Linux Force or restart network card auto-negotiation with ethtool

by Vivek Gite · 0 comments

ethtool or mii-tool utility checks or sets the status of a network interface’s Media Independent Interface (MII) unit. Most fast ethernet adapters use an MII to autonegotiate link speed and duplex setting.

Due to software or hardware (network switch or Ethernet card ) error it may be possible that you need to restarts auto-negotiation on the specified ethernet device.
Restart autonegotiation

You don’t have to reboot Linux box, all you have to do is type the following command :
# 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