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

最新文章

  1. Python来做应用题及思路
  2. rabiitmq集群完整安装
  3. html和css的编码规范
  4. c语言.大数的输出
  5. 以Python角度学习Javascript(一)
  6. Qt之图形(Source和Dest相互覆盖的取舍,真的很方便)
  7. 一招解决OpenERP8.0安装旧版模块报错
  8. bash的多行注释
  9. <div>相关
  10. tomcat中有关配置文件的说明
  11. apache也可以做负载均衡,跟nignx的区别是什么?
  12. QT 信号与槽 QT简单加法器的实现
  13. PyRedisAdmin v1.0 Beta 发布,Redis 在线管理工具 - 开源中国社区
  14. hdu2050(递推)
  15. UIGestureRecognizer 手势浅析
  16. android 软键盘的使用
  17. 【Bootstrap】bootstrap-datetimepicker日期时间插件
  18. Vfox数据库导出EXCEL,含有备注型子段
  19. Angular cli 发布自定义组件
  20. Linux - CentOS7上的时间同步

热门文章

  1. QT学习之文件系统读写类
  2. 【[HAOI2008]木棍分割】
  3. Jquery 1.8全选反选删除选中项实现
  4. JavaEE权限管理系统的搭建(四)--------使用拦截器实现登录认证和apache shiro密码加密
  5. Oracle,Mysql,SQlserver生成实体映射之SqlSugarT4
  6. Vue教程:简介(一)
  7. 数据恢复顾问(DRA)
  8. iOS 直播类APP开发流程解析
  9. java各种业务解决方案总结
  10. LeetCode 中级 - 翻转矩阵后的得分(861)