查看网卡适配器配置信息,并且我们可以通过它修改网卡适配器的双工模式。
1、安装Ethtools
[root@localhost ~]# yum -y install ethtools
2、命令语法
语法:ethtools [选项] 网卡名
选项:
-i 显示网卡驱动信息
-s <网卡名> speed <速率> 修改网卡网卡速率,有10、100、1000或更高
-s <网卡名> duplex <双工模式> 修改网卡双工模式,有半双工(half)、全双工(full)
-a 查看网卡上传下载模块协商情况
-A <网卡名> autoneg <on/off> 关闭或开启网卡上传下载模块自动协商功能
-A <网卡名> rx <on/off> 关闭或开启网卡下载模块功能
-A <网卡名> tx <on/off> 关闭或开启网卡上传模块功能
3、查看指定网卡信息
[root@localhost ~]# ethtool ens33
Settings for ens33:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full # 网卡支持的速率和双工模式
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 1000Mb/s # 当前网卡速率
Duplex: Full # 当前网卡双工模式
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on # 当前网卡自动协商功能是否开启
MDI-X: off (auto)
Supports Wake-on: d
Wake-on: d
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes
4、修改ends网卡的网卡速率和双工模式
[root@localhost ~]# ethtool -s ens33 speed 10 duplex full
[root@localhost ~]# ethtool ens33 //查看修改已完成
Settings for ens33:
Speed: 10Mb/s
Duplex: Full
5、查看网卡自动协商功能
[root@localhost ~]# ethtool -a ens33
Pause parameters for ens33:
Autonegotiate: on
RX: off
TX: off
6、关闭网卡自动协商功能
[root@localhost ~]# ethtool -A ens33 autoneg off
7、手动开启网卡下载模块功能,允许下载
[root@localhost ~]# ethtool -A ens33 rx on
[root@localhost ~]# ethtool -a ens33
Pause parameters for ens33:
Autonegotiate: off
RX: on
TX: off