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
Settings for eth1:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: umbg
Wake-on: d
Link detected: yes
2)[root@linux /]# ethtool -i eth1
driver: e1000
version: 5.0.43-k1
firmware-version: N/A
bus-info: 06:08.1
3)[root@linux /]# ethtool -S eth1
NIC statistics:
rx_packets: 58068300
tx_packets: 87124083
rx_bytes: 1589713008
tx_bytes: 2165825901
rx_errors: 0
tx_errors: 0
rx_dropped: 0
tx_dropped: 0
multicast: 0
collisions: 0
rx_length_errors: 0
rx_over_errors: 0
rx_crc_errors: 0
rx_frame_errors: 0
rx_fifo_errors: 0
rx_missed_errors: 0
tx_aborted_errors: 0
tx_carrier_errors: 0
tx_fifo_errors: 0
tx_heartbeat_errors: 0
tx_window_errors: 0
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之中。
分享到:
相关推荐
LinuxUnix命令之Ethtool.doc
Ethtool是Linux下用于查询及设置网卡参数的命令。 概要: ethtool ethX //查询ethX网口基本设置 ethtool –h //显示ethtool的命令帮助(help) ethtool –i ethX //查询ethX网口的相关信息 ethtool –d ethX //查询...
netxen get dump data Source Code for Embedded Linux.
Linux网络工具-ethtool-5.14(21年最新版本)
ethtool 5.14源码,具体使用方法可参考https://linux.die.net/man/8/ethtool。 ethtool 是Linux 调试网卡eth的必备工具。
#include <linux/ethtool.h> #include <linux/tcp.h> #include <linux/skbuff.h> #include <linux/delay.h> #include <linux/spi/spi.h> #include "enc28j60_hw.h" #define DRV_NAME "enc28j60" #define DRV_...
linux系统用的ethtool源代码,如果在一些嵌入式平台没有此工具,可以下载下来进行编译移植 ethtool-2.6.36.tar ethtool-2.tar ethtool-3.0.tar ethtool-3.18.tar
ethtool工具,包括linux版本arm64-v8a\armeabi-v7a、x86、mips64
个人写的LINUX平台下,命令行访问ethernet phy 的寄存器工具,驱动和硬件调试非常实用。具体使用如下: 打印寄存器:./mdio eth0 dump 修改寄存器:./mdio eth0 0x00 0x1200,修改0x00寄存器的值为0x1200
ethtool软件包旨在提供一个提供对Linux SIOCETHTOOL ioctl操作的简单访问的库。 它可用于从网络设备中检索信息,例如统计信息,与驱动程序有关的信息,甚至是VETH接口的对等体。 构建和测试 去获取命令: go get ...
config/autoconf.h KCONFIG_TRISTATE=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/tristate.config BUILDROOT_CONFIG=/home/wwt/linux_r16/lichee/out/sun8iw5p1/...
config/autoconf.h KCONFIG_TRISTATE=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/tristate.config BUILDROOT_CONFIG=/home/wwt/linux_r16/lichee/out/sun8iw5p1/...
linux系统用的ethtool源代码,如果在一些嵌入式平台没有此工具,可以下载下来进行编译移植
ethtool命令用于查询ethX网口基本设置、及设置网卡的参数。 语法格式:ethtool [参数] 常用参数: -i 显示网卡驱动的信息 -E 修改网卡只读存储器字节 -K 修改网卡 Offload 的状态 ethx 查询ethx网口基本...
网络调试工具,方便分析网络各层的丢包,收发包情况,,
ethtool安装包,查看和设置网卡相关信息
Linux下用于查询及设置网卡参数的软件 ethtool-4.5.tar.gz是2016比较新的版本
Ethtool是Linux下用于查询及设置网卡参数的命令。它可以用于设置、查询网络设备尤其是以太网的速度、端口、自动协商、PCI位置和校验值offload特性等内容。
ethtool相关命令,用于查看和设置网卡相关信息 安卓可用的ethtool 二进制文件,里面包含了各个平台的版本,具体ethtool的使用请参照相关说明使用
ethtool-4.18 ethtool-4.18 ethtool-4.18 ethtool-4.18