网路命令二

来源:互联网 发布:崔杼弑其君 知乎 编辑:程序博客网 时间:2024/06/10 09:35

ethtool命令

Ethtool是用于查询及设置网卡参数的命令

 

1、关于ethtool命令

ethtool ethX                      //查询ethX网口基本设置
ethtool –h                       //显示ethtool的命令帮助(help)
ethtool –i ethX               //查询ethX网口的相关信息
ethtool –d ethX             //查询ethX网口注册性信息
ethtool –r ethX             //重置ethX网口到自适应模式
ethtool –S ethX            //查询ethX网口收发包统计
ethtool –s ethX [speed 10|100|1000]/         //设置网口速率10/100/1000M
[duplex half|full]/                 //设置网口半/全双工
[autoneg on|off]/                //设置网口是否自协商
[port tp|aui|bnc|mii]/          //设置网口类型
[phyad N]/                
[xcvr internal|exteral]/
[wol p|u|m|b|a|g|s|d...]/
[sopass xx:yy:zz:aa:bb:cc]/
[msglvl N]

 

 

2、命令行和配置文件

如配置网卡的速率为100M全双工可以执行:

方法一:

ethtool -s eth2 speed 100 duplex full

方法二:

在配置文件/etc/sysconfig/network-scripts/ifcfg-eth2 中加入一条:

ETHTOOL_OPTS="speed 100 duplex full “

原创粉丝点击