本文主要来自于ethtool -h的信息,编写本文的目的在于记录日常ethtool工具的使用;
- 显示网卡相关的信息
ethtool DEVNAME
- 修改网卡通用选项
ethtool -s|--change DEVNAME
速率 [ speed %d ]
通信模式 [ duplex half|full ]
网口类型 [ port tp|aui|bnc|mii|fibre ]
[ mdix auto|on|off ]
自动协商 [ autoneg on|off ]
[ advertise %x ]
[ phyad %d ]
[ xcvr internal|external ]
[ wol p|u|m|b|a|g|s|d... ]
[ sopass %x:%x:%x:%x:%x:%x ]
[ msglvl %d | msglvl type on|off ... ]
- 显示网卡暂停选项
ethtool -a|--show-pause DEVNAME Show pause options
- 设置网卡暂停选项
ethtool -A|--pause DEVNAME
自动协商 [ autoneg on|off ]
接收 [ rx on|off ]
发送 [ tx on|off ]
- 显示网卡聚合选项
ethtool -c|--show-coalesce DEVNAME
- 设置网卡聚合选项
ethtool -C|--coalesce DEVNAME
[adaptive-rx on|off]
[adaptive-tx on|off]
[rx-usecs N]
[rx-frames N]
[rx-usecs-irq N]
[rx-frames-irq N]
[tx-usecs N]
[tx-frames N]
[tx-usecs-irq N]
[tx-frames-irq N]
[stats-block-usecs N]
[pkt-rate-low N]
[rx-usecs-low N]
[rx-frames-low N]
[tx-usecs-low N]
[tx-frames-low N]
[pkt-rate-high N]
[rx-usecs-high N]
[rx-frames-high N]
[tx-usecs-high N]
[tx-frames-high N]
[sample-interval N]
- 显示网卡RING参数
ethtool -g|--show-ring DEVNAME
- 设置网卡RING参数
ethtool -G|--set-ring DEVNAME
[ rx N ]
[ rx-mini N ]
[ rx-jumbo N ]
[ tx N ]
- 显示网卡协议offload状态和其他特征
ethtool -k|--show-features|--show-offload DEVNAME
- 设置网卡协议offload状态和其他特征
ethtool -K|--features|--offload DEVNAME
FEATURE on|off ...
- 显示网卡驱动信息
ethtool -i|--driver DEVNAME Show driver information
- 显示网卡寄存器的DUMP信息
ethtool -d|--register-dump DEVNAME
[ raw on|off ]
[ file FILENAME ]
- 显示网卡EEPROM的DUMP信息
ethtool -e|--eeprom-dump DEVNAME
[ raw on|off ]
[ offset N ]
[ length N ]
- 修改网卡EEPROM中的字节
ethtool -E|--change-eeprom DEVNAME
[ magic N ]
[ offset N ]
[ length N ]
[ value N ]
- 重启N-WAY(选路)协商
ethtool -r|--negotiate DEVNAME
- 显示可见的端口标识(如:网口灯闪烁)
ethtool -p|--identify DEVNAME
[ TIME-IN-SECONDS ]
- 启动适配器自测试
ethtool -t|--test DEVNAME
[ online | offline | external_lb ]
- 显示适配器统计信息
ethtool -S|--statistics DEVNAME Show adapter statistics
- 显示PHY统计信息
ethtool --phy-statistics DEVNAME Show phy statistics
- 显示接收网络流量分级选项和规则
ethtool -n|-u|--show-nfc|--show-ntuple DEVNAME
[rx-flow-hash tcp4|udp4|ah4|esp4|sctp4|tcp6|udp6|ah6|esp6|sctp6|rule %d ]
- 设置接收网络分级选项和规则
ethtool -N|-U|--config-nfc|--config-ntuple DEVNAME
rx-flow-hash tcp4|udp4|ah4|esp4|sctp4|tcp6|udp6|ah6|esp6|sctp6 m|v|t|s|d|f|n|r... |
flow-type ether|ip4|tcp4|udp4|sctp4|ah4|esp4|ip6|tcp6|udp6|ah6|esp6|sctp6
[ src %x:%x:%x:%x:%x:%x [m %x:%x:%x:%x:%x:%x] ]
[ dst %x:%x:%x:%x:%x:%x [m %x:%x:%x:%x:%x:%x] ]
[ proto %d [m %x] ]
[ src-ip IP-ADDRESS [m IP-ADDRESS] ]
[ dst-ip IP-ADDRESS [m IP-ADDRESS] ]
[ tos %d [m %x] ]
[ tclass %d [m %x] ]
[ l4proto %d [m %x] ]
[ src-port %d [m %x] ]
[ dst-port %d [m %x] ]
[ spi %d [m %x] ]
[ vlan-etype %x [m %x] ]
[ vlan %x [m %x] ]
[ user-def %x [m %x] ]
[ dst-mac %x:%x:%x:%x:%x:%x [m %x:%x:%x:%x:%x:%x] ]
[ action %d ]
[ loc %d]] |
delete %d
- 显示网卡时间戳
ethtool -T|--show-time-stamping DEVNAME
- 显示RX流的hash indirection 表和/或 RSS hash密钥
ethtool -x|--show-rxfh-indir|--show-rxfh DEVNAME
- 设置RX流的hash indirection 表和/或 RSS hash密钥
ethtool -X|--set-rxfh-indir|--rxfh DEVNAME
[ equal N | weight W0 W1 ... | default ]
[ hkey %x:%x:%x:%x:%x:.... ]
[ hfunc FUNC ]
- 烧写固件文件到设备FLASH的指定区域
ethtool -f|--flash DEVNAME
FILENAME [ REGION-NUMBER-TO-FLASH ]
- 显示永久硬件地址(MAC)
ethtool -P|--show-permaddr DEVNAME
- 获取dump标志和数据
ethtool -w|--get-dump DEVNAME
[ data FILENAME ]
- 设置dump标志
ethtool -W|--set-dump DEVNAME
N
- 查询设备通道
ethtool -l|--show-channels DEVNAME
- 设置设备通道
ethtool -L|--set-channels DEVNAME
[ rx N ]
[ tx N ]
[ other N ]
[ combined N ]
- 查询私有标志
ethtool --show-priv-flags DEVNAME
- 设置私有标志
ethtool --set-priv-flags DEVNAME
FLAG on|off ...
- 若有效,查询或解码EEPROM信息和optical diagnostics
ethtool -m|--dump-module-eeprom|--module-info DEVNAME
[ raw on|off ]
[ hex on|off ]
[ offset N ]
[ length N ]
- 显示EEE配置
ethtool --show-eee DEVNAME
- 设置EEE配置
ethtool --set-eee DEVNAME
[ eee on|off ]
[ advertise %x ]
[ tx-lpi on|off ]
[ tx-timer %d ]
- 设置PHY调谐
ethtool --set-phy-tunable DEVNAME
[ downshift on|off [count N] ]
- 获取PHY调谐
ethtool --get-phy-tunable DEVNAME
[ downshift ]
- 重置组件
ethtool --reset DEVNAME Reset components
[ flags %x ]
[ mgmt ]
[ mgmt-shared ]
[ irq ]
[ irq-shared ]
[ dma ]
[ dma-shared ]
[ filter ]
[ filter-shared ]
[ offload ]
[ offload-shared ]
[ mac ]
[ mac-shared ]
[ phy ]
[ phy-shared ]
[ ram ]
[ ram-shared ]
[ ap ]
[ ap-shared ]
[ dedicated ]
[ all ]
- 显示网卡FEC配置
ethtool --show-fec DEVNAME
- 设置网卡FEC配置
ethtool --set-fec DEVNAME
[ encoding auto|off|rs|baser ]
- 显示班助信息
ethtool -h|--help
- 显示ETHTOOL版本
ethtool --version