Linux ethtool 命令

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

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

[root@localhost ~]$ ethtool eth1                           # 查看指定网卡的基本设置,内容包括网卡速率、网卡的工作模式等
[root@localhost ~]$ ethtool -i eth1                        # 查看指定网卡的驱动信息,内容包括驱动的型号、驱动的版本等
[root@localhost ~]$ ethtool -s eth1 speed [10|100|1000]    # 设置网卡的速率,单位是:Mb/s
[root@localhost ~]$ ethtool -s eth1 duplex [half|full]     # 设置网卡的工作模式,可设置为半双工或全双工
[root@localhost ~]$ ethtool -s eth1 autoneg [on|off]       # 设置网卡是否自动协商,自动协商的内容主要包括工作模式、网卡速率以及流控等参数
[root@localhost ~]$ ethtool -s eth1 autoneg off speed 100 duplex full    # 也可以同时写在一起

      

原文地址:https://www.cnblogs.com/pzk7788/p/10372863.html