zoukankan      html  css  js  c++  java
  • ethtool speed HowTo : Change Speed and Duplex of Ethernet card in Linux

    To change Speed and Duplex of an ethernet card, we can use ethtool - a Linux utility for Displaying or Changing ethernet 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 for eth0:
    	Supported ports: [ MII ]
    	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: 100Mb/s
    	Duplex: Half
    	Port: Twisted Pair
    	PHYAD: 1
    	Transceiver: internal
    	Auto-negotiation: on
    	Supports Wake-on: g
    	Wake-on: d
    	Current message level: 0x000000ff (255)
    	Link detected: yes

    3. Change the Speed and Duplex settings

    The following changes are temporary and they'll stop working after reboot. Read the next section, to 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 10 Mb/s :
    # ethtool -s eth0 speed 10 duplex half autoneg off
    The next command disables Auto-Negotiation, enables Full Duplex and sets up Speed to 100 Mb/s :
    # ethtool -s eth0 speed 100 duplex full autoneg off

    4. Change the Speed and Duplex settings Permanently on CentOS/RHEL

    To make settings permanent, you need to edit /etc/sysconfig/network-scripts/ifcfg-eth0 file for eth0 interface. This file is used by RHEL, CentOS, Fedora etc.
    # vi /etc/sysconfig/network-scripts/ifcfg-eth0
    Append the line as follows to disable Auto-Negotiation, enable Full Duplex and set up Speed to 100 Mb/s :

    ETHTOOL_OPTS="speed 100 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

  • 相关阅读:
    IDEA 2021.1 推出语音、视频功能,边写代码边聊天
    HTML5实现首页动态视频背景
    前端项目自动化构建工具——Webpack入门教程
    JavaScript多线程及事件循环机制
    SVN迁移至Git,保留commit提交记录
    Windows平台下搭建自己的Git服务器
    SVN服务器搭建、备份及多服务器同步方案(Windows)
    全图文分析:如何利用Google的protobuf,来思考、设计、实现自己的RPC框架
    注册表修改右键菜单的说明
    powershell换行输出,换行输入命令,多行命令的执行
  • 原文地址:https://www.cnblogs.com/iclk/p/4666663.html
Copyright © 2011-2022 走看看