ethtool ---网卡配置查看及修改工具
来源:互联网 发布:java 管理系统 编辑:程序博客网 时间:2024/04/29 15:11
命令描述:
ethtool 是用于查询及设置网卡参数的命令。
使用概要:
ethtool ethx //查询ethx网口基本设置,其中 x 是对应网卡的编号,如eth0、eth1等等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] [duplex half|full] [autoneg on|off] //设置网口速率10/100/1000M、设置网口半/全双工、设置网口是否自协商
使用举例:
1)查询eth0网口基本设置(网卡速率是百兆还是千兆等):
# ethtool eth0Settings for eth0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supported pause frame use: No //是否支持热插拔 Supports auto-negotiation: Yes //是否支持自动协商 Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised pause frame use: No Advertised auto-negotiation: Yes Speed: 1000Mb/s //速率 Duplex: Full //全双工 Port: Twisted Pair //电口 PHYAD: 0 Transceiver: internal Auto-negotiation: on MDI-X: Unknown Supports Wake-on: d Wake-on: d Current message level: 0x00000007 (7) drv probe link Link detected: yes
2)查看网卡的驱动信息:
# ethtool -i eth0 //查看网卡的驱动版本driver: e1000version: 7.3.21-k8-NAPIfirmware-version: bus-info: 0000:02:01.0supports-statistics: yessupports-test: yessupports-eeprom-access: yessupports-register-dump: yessupports-priv-flags: no
3)查看网卡的输入流量,输出流量,输入包,输出包,输入的广播,输出的广播,输入的网络错包,输出的网络错包等:
# 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
解决相关问题:
最近碰到的一个问题: 将eth1挂到ovs dpdk网桥上,将网桥删除以后,再使用 ifconfig -a ,发现eth3不见了。
解决过程:
首先使用如下两条命令,可以找出eth1的bus-info: 0000:03:00.1
# lspci|grep Eth // 列出机器中的PCI设备信息,如声卡,显卡,Modem,网卡等信息02:00.1 Ethernet controller: Advanced Micro Devices, Inc. [AMD] 79c970 [PCnet32 LANCE] (rev 10)03:00.1 Ethernet controller: Silicon Integrated Systems [SiS] SiS900 PCI Fast Ethernet (rev 91)# ethtool -i eth0 //查看网卡的驱动版本driver: ixgbeversion: 7.3.21-k8-NAPIfirmware-version: bus-info: 0000:02:00.1 // 对应bus-infosupports-statistics: yessupports-test: yessupports-eeprom-access: yessupports-register-dump: yessupports-priv-flags: no
接下来做两件事:
# 解绑设备驱动echo "0000:03:00.1" > /sys/bus/pci/devices/0000\:03:00.1/driver/unbind# 重新绑定驱动echo "0000:03:00.1" > /sys/bus/pci/driver/ixgbe/bind
OK! ifconfig -a 又可以看见eth1了!
相关知识点:
/sys/bus/pci/devices/目录下列出了系统中所有pci设备的名称(不管有没有安装对应的驱动程序),pci设备的名称就是相应的pci地址(即“域:pci总线号:槽位号:功能号”)。
/sys/bus/pci/drivers目录下则列出了所有pci设备的驱动。
相关目录下会有一些别的文件,像bind用来指定某个pci设备由此驱动接管,unbind则起相反的作用。通常,一个驱动都有自己支持的设备型号的列表。
阅读全文
0 0
- ethtool ---网卡配置查看及修改工具
- ethtool---查看网卡以及修改网卡配置工具
- ethtool网卡工作模式查看及配置工具
- 网卡参数查询及设置工具ethtool
- ethtool - 查看网卡信息
- linux 下 ethtool 修改网卡eeprom
- linux 下 ethtool 修改网卡eeprom
- linux 下 ethtool 修改网卡eeprom
- 无线网卡的查看与配置——iw,iwconfig,ethtool
- ethtool-一个网卡配置的小工具
- linux网卡名修改及MAC查看
- 查看linux系统网卡工作模式、速率等ethtool eth0
- Linux 查看网卡接收报文信息命令ethtool
- 查看和改变网卡的速度和双工(ethtool)
- CentOS 6.3 用ethtool工具进行多网卡识别
- Android使用ethtool工具查询/设置以太网网卡状态
- 1指令 --mii-tool & ethtool (配置网卡的模式)
- 指令 --mii-tool & ethtool (配置网卡的模式)
- scikit-image
- MDTools960新功能介绍
- 309. Best Time to Buy and Sell Stock with Cooldown
- HDOJ 1092 A+B for Input-Output Practice (IV)
- 简单的动态规划题
- ethtool ---网卡配置查看及修改工具
- 08_张孝祥_多线程_java5原子性操作类的应用
- 金矿模型的动态规划入门
- SpringMVC开发技巧--使用@JsonView注解
- Git:Git常用命令速查表
- putty 隔一段时间就掉线怎么解决
- HDOJ 1093 A+B for Input-Output Practice (V)
- 二叉树--uva839 二叉树递归遍历
- Mac 解决ls open touch ll等命令失效问题