Ethtool speed Howto:change speed and Duplex of Ethernet card in Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.