To the Duplex of an Ethernet card, we can use the ethtool -a Linux utility for Displaying or changing E Thernet card settings.
1. Install Ethtool
You can install Ethtool by typing one of the following commands, depending upon your Linux distribution.
Install Ethtool in Fedora, CentOS, RHEL etc.:
# yum Install Ethtool
Install Ethtool in Ubuntu, Debian etc.:
# sudo apt-get install Ethtool
2. Get the speed, Duplex and other information for the interface eth0
To get speed, duplex and other information for the network interface eth0, type the following command as root.
# Ethtool Eth0
Sample output:
Settings ForEth0:SupportedPorts: [MII]SupportedLink modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Supports Auto-Negotiation: YesAdvertisedLink modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Advertised Auto-Negotiation: Yesspeed: 100Mb/s Duplex: half Port: Twisted PairPhyad: 1Transceiver: internalauto-negotiation: Onsupports< Span class= "PLN" > wake-on: Gwake-on: Dcurrent message Level: 0x000000ff (255link Detected: Yes
3. Change of the speed and Duplex settings
The following changes is temporary and they ' ll stop working after reboot. Read the next section and make settings permanent.
The next command enables Auto-negotiate feature:
# ethtool-s eth0 Autoneg on
The next command disables Auto-negotiation, enables half Duplex and sets up speed to ten MB/s:
# ethtool-s eth0 speed Duplex half Autoneg off
The next command disables Auto-negotiation, enables full Duplex and sets up speed to + MB/s:
# ethtool-s eth0 Speed @ Duplex full Autoneg off
4. Change the speed and Duplex settings permanently on Centos/rhel
To make settings permanent, the need to Edit/etc/sysconfig/network-scripts/ifcfg-eth0 file for eth0 interface. This file was used by RHEL, CentOS, Fedora etc.
# Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Append the line as follows-disable auto-negotiation, enable full-Duplex and set up-speed-to-MB/s:
Ethtool_opts="Speed of duplex full Autoneg off"
Restart the interface to apply changes:
# ifdown eth0 && ifup eth0
Zhuan:http://www.shellhacks.com/en/howto-change-speed-and-duplex-of-ethernet-card-in-linux
Ethtool speed Howto:change speed and Duplex of Ethernet card in Linux