LINUX命令之ETHTOOL用法详解
转载:http://crazyming.blog.51cto.com/1048571/738022
debian 下安装: sudo apt-get install ethtool
或者下载源码编译:http://pan.baidu.com/s/1ntJPfct
这个是官网下载地址:http://ethtool.sourcearchive.com/
Linux/Unix命令之Ethtool
描述:
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]
举例:
1)[root@linux /]# ethtool eth1
2)[root@linux /]# ethtool -i eth1
3)[root@linux /]# ethtool -S eth1
NIC statistics:
4)[root@linux /]# ethtool -s eth1 autoneg off speed 100 duplex full
相关:
1)[root@linux /]# which ethtool
/sbin/ethtool
2)[root@linux /]# rpm -qf /sbin/ethtool
ethtool-1.6-5
3)怎样使ethtool设置永久保存在网络设备中?
解决方法一:
ethtool设置可通过/etc/sysconfig/network-scripts/ifcfg-ethX文件保存,从而在设备下次启动时激活选项。
例如:ethtool -s eth0 speed 100 duplex full autoneg off
此指令将eth0设备设置为全双工自适应,速度为100Mbs。若要eth0启动时设置这些参数, 修改文件/etc/sysconfig/network-scripts/ifcfg-eth0 ,添加如下一行:
ETHTOOL_OPTS="speed 100 duplex full autoneg off"
解决方法二:
将ethtool设置写入/etc/rc.d/rc.local之中。
二
解决方法:
对Intel千兆网卡禁用自适应时必须指定链路速度和全双工模式。当使用ethtool来禁用使用e1000网卡驱动模块的网卡自适应特性时,必须同时指定链路速度和全双工工作模式。例如: ethtool -s eth0 autoneg off
会边比自适应,但是只是临时禁用,如果在命令中没有指定链路速度和全双工工作模式,驱动会自动重新打开自适应。
为了使用ethtool工具来禁用e1000网卡驱动模块的网卡自适应特性,使用以下步骤
1. 进入终端模式。 2. 以root身份执行 ethtool -s ethx autoneg off speed 1000 duplex full
这里ethX是网卡的名字(例如eth0或者eth1等等),这个命令将关闭该网卡的自适应特性,并且强制设置网卡速度为1Gb,全双公模式。
另外ethtool比mii-tool要高级,mii-tool只支持 Port: MII的网卡.
OPTIONS
- -h
- shows a short help message.
- -a
- queries the specified ethernet device for pause parameter information.
- -A
- change the pause parameters of the specified ethernet device.
- autoneg on|off
- Specify if pause autonegotiation is enabled.
- rx on|off
- Specify if RX pause is enabled.
- tx on|off
- Specify if TX pause is enabled.
- -c
- queries the specified ethernet device for coalescing information.
- -C
- change the coalescing settings of the specified ethernet device.
- -g
- queries the specified ethernet device for rx/tx ring parameter information.
- -G
- change the rx/tx ring parameters of the specified ethernet device.
- rx N
- Change number of ring entries for the Rx ring.
- rx-mini N
- Change number of ring entries for the Rx Mini ring.
- rx-jumbo N
- Change number of ring entries for the Rx Jumbo ring.
- tx N
- Change number of ring entries for the Tx ring.
- -i
- queries the specified ethernet device for associated driver information.
- -d
- retrieves and prints a register dump for the specified ethernet device.
- -e
- retrieves and prints an EEPROM dump for the specified ethernet device.
- -k
- queries the specified ethernet device for checksumming information.
- -K
- change the checksumming parameters of the specified ethernet device.
- rx on|off
- Specify if RX checksumming is enabled.
- tx on|off
- Specify if TX checksumming is enabled.
- sg on|off
- Specify if scatter-gather is enabled.
- -p
- initiates
adapter-specific action intended to enable an operator to easily
identify the adapter by sight. typically this involves blinking one or
more LEDs on the specific ethernet port. - N
- Length of time to perform phys-id, in seconds.
- -r
- restarts auto-negotiation on the specified ethernet device, if auto-negotiation is enabled.
- -S
- queries the specified ethernet device for NIC- and driver-specific statistics.
- -t
- executes adapter selftest on the specified ethernet device. Possible test modes are:
- offline|online
- defines test type: offline (default) means to perform full set of tests possibly causing normal operation interruption during the tests, online means to perform limited set of tests do not interrupting normal adapter operation.
- -s
- option allows changing some or all settings of the specified ethernet device. All following options only apply if -s was specified.
- speed 10|100|1000
- Set speed in Mb/s. ethtool with single argument will show you the supported device speeds.
- duplex half|full
- Set full or half duplex mode.
- port tp|aui|bnc|mii
- Select device port.
- autoneg on|off
- Specify
if autonegotiation is enabled. In the usual case it is, but might cause
some problems with some network devices, so you can turn it off. - phyad N
- PHY address.
- xcvr internal|external
- Select transceiver type. Currently only internal and external can be specified, in the future further types might be added.
- wol p|u|m|b|a|g|s|d...
- Set
Wake-on-LAN options. Not all devices support this. The argument to this
option is a string of characters specifying which options to enable.-
- p
- Wake on phy activity
- u
- Wake on unicast messages
- m
- Wake on multicast messages
- b
- Wake on broadcast messages
- a
- Wake on ARP
- g
- Wake on MagicPacket(tm)
- s
- Enable SecureOn(tm) password for MagicPacket(tm)
- d
- Disable (wake on nothing). This option clears all previous options.
-
- sopass xx:yy:zz:aa:bb:cc
- Set the SecureOn(tm) password. The argument to this option must be 6 bytes in ethernet MAC hex format (xx:yy:zz:aa:bb:cc).
- msglvl N
- Set the driver message level. Meanings differ per driver
LINUX命令之ETHTOOL用法详解的更多相关文章
- (转)Linux命令之Ethtool用法详解
Linux命令之Ethtool用法详解 原文:http://www.linuxidc.com/Linux/2012-01/52669.htm Linux/Unix命令之Ethtool描述:Ethtoo ...
- Linux命令之grep用法详解:grep与正则表达式 [转]
正则表达式与通配符不一样,它们表示的含义并不相同. grep命令的选项用于对搜索过程进行补充说明.grep命令的模式十分灵活,可以是字符串.变量,还可以是正则表达式. 无论模式是何种形式,只要模式中包 ...
- linux管道命令grep命令参数及用法详解---附使用案例|grep
功能说明:查找文件里符合条件的字符串. 语 法:grep [-abcEFGhHilLnqrsvVwxy][-A<显示列数>][-B<显示列数>][-C<显示列数>] ...
- linux mount命令参数及用法详解
linux mount命令参数及用法详解 非原创,主要来自 http://www.360doc.com/content/13/0608/14/12600778_291501907.shtml. htt ...
- 【转】linux expr命令参数及用法详解
在抓包过程中,查看某个设定时间内,数据上下行多少,用命令expr 计算! --------------------------------------------------------------- ...
- linux useradd(adduser)命令参数及用法详解(linux创建新用户命令)
linux useradd(adduser)命令参数及用法详解(linux创建新用户命令) useradd可用来建立用户帐号.帐号建好之后,再用passwd设定帐号的密码.而可用userdel删除帐号 ...
- linux dmesg命令参数及用法详解(linux显示开机信息命令)
linux dmesg命令参数及用法详解(linux显示开机信息命令) http://blog.csdn.net/zhongyhc/article/details/8909905 功能说明:显示开机信 ...
- linux sed命令参数及用法详解
linux sed命令参数及用法详解 http://blog.csdn.net/namecyf/article/details/7336308 1. Sed简介 sed 是一种在线编辑器,它一次处理一 ...
- linux dd命令参数及用法详解---用指定大小的块拷贝一个文件(也可整盘备份)
linux dd命令参数及用法详解---用指定大小的块拷贝一个文件 日期:2010-06-14 点击:3830 来源: 未知 分享至: linux dd命令使用详解 dd 的主要 ...
随机推荐
- JSON 省市数据包括港澳
data: [{ name: "北京", cities: ["西城", "东城", "崇文", "宣武&quo ...
- BootStrap入门教程 (一) :手脚架Scaffolding(全局样式(Global Style),格网系统(Grid System),流式格网(Fluid grid System),自定义(Customing),布局(Layouts))
2011年,twitter的“一小撮”工程师为了提高他们内部的分析和管理能力,用业余时间为他们的产品构建了一套易用.优雅.灵活.可扩展的前端工具集--BootStrap.Bootstrap由MARK ...
- 机器学习----分布问题(二元,多元变量分布,Beta,Dir)
这涉及到数学的概率问题. 二元变量分布: 伯努利分布,就是0-1分布(比如一次抛硬币,正面朝上概率) 那么一次抛硬币的概率分布如下: 假设训练数据如下: 那么根据最大似然估计(MLE ...
- 一条scan查询把HBase集群干趴下
最近在给公司搭建CDH集群,在测试集群性能时,写了一条简单的scan查询语句竟然把hbase集群的所有regionserver干趴下了.这让我云里雾里的飘飘然. 背景介绍 CDH集群,2台主节点.3台 ...
- Signs of a poorly written jQuery plugin 翻译 (Jquery插件开发注意事项,Jquey官方推荐)
原文链接:http://remysharp.com/2010/06/03/signs-of-a-poorly-written-jquery-plugin/ 原文作者:remy sharp So far ...
- Java8新特性 1——利用流和Lambda表达式操作集合
Java8中可以用简洁的代码来操作集合,比如List,Map,他们的实现ArrayList.以此来实现Java8的充分利用CPU的目标. 流和Lambda表达式都是Java8中的新特性.流可以实现对集 ...
- 关于 终端 ls 命令 不能区分文件和目录的问题
默认的,使用ls命令来显示目录内容的时候,“终端”对于目录.可执行文件等特殊类型的文件并没有使用颜色来显示,只有使用“ls -G”时,才能显示颜色,这可真是不方便.有没有方法可以默认显示颜色呢?方法当 ...
- homework-05
经过这几天的深思熟虑我和小明同学将这次作业基本的完整了,可能界面略丑陋,但是基本功能均已实现.我们的服务器端采用python编写,因为服务器端是这次作业的难点,而python中有一个叫做web.py的 ...
- 7-wonders-in-java
https://code.google.com/p/7-wonders-in-java/
- JavaScript,通过分析Array.prototype.push重新认识Array
在阅读ECMAScript的文档的时候,有注意到它说,数组的push方法其实不仅限于在数组中使用,专门留作通用方法.难道是说,在一些类数组的地方也可以使用?而哪些是和数组非常相像的呢,大家或许一下子就 ...