Linux ethtool 命令

 

 

ethtool 是用于查询及设置网卡参数的命令,常见用法如下:

注意:该命令只是临时设置,如果网卡重启就失效了,如果想要永久保存应该配置 /etc/sysconfig/network-scripts/ifcfg-eth0 文件

 

 

 查看指定网卡的基本设置,内容包括网卡速率、网卡的工作模式等

ethtool eth0

[root@mysql ~]# ethtool eth0
Settings for eth0:
    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
    Supported FEC modes: Not reported
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    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

 

查看指定网卡的驱动信息,内容包括驱动的型号、驱动的版本等
ethtool -i eth0
[root@mysql ~]# ethtool -i eth0
driver: e1000
version: 7.3.21-k8-NAPI
firmware-version: 
expansion-rom-version: 
bus-info: 0000:02:01.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no

 

 
 
[root@mysql ~]# ethtool -s eth0 speed [10|100|1000]    # 设置网卡的速率,单位是:Mb/s
[root@mysql ~]# ethtool -s eth0 duplex [half|full]     # 设置网卡的工作模式,可设置为半双工或全双工
[root@mysql ~]# ethtool -s eth0 autoneg [on|off]       # 设置网卡是否自动协商,自动协商的内容主要包括工作模式、网卡速率以及流控等参数
[root@mysql ~]# ethtool -s eth0 autoneg off speed 100 duplex full    # 也可以同时写在一起

 

 
 

 

 

 

转载于:https://www.cnblogs.com/mingerlcm/p/10604999.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值