ethtool
功能:
用于显示或修改网卡的配置信息。
常用参数:
-p | 使网卡指示灯闪烁,用于定位物理网卡 |
-i | 显示网卡驱动信息 |
-m | 查看网卡光模块信息 |
-s | 修改网卡配置信息 |
-S | 显示网卡的收发包统计信息 |
-t | 让网卡执行自我检测 |
使用示例:
查看网卡的详细信息
#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
定位eth0网卡物理位置
#ethtool -p eth0 10 //让eth0网卡LED灯持续闪烁10秒。
#ethtool -p eth0 //让eth0网卡LED灯持续闪烁,直到手动终止(Ctrl+c)
查看网卡的驱动信息
#ethtool -i eth0
[root@localhost ~]# ethtool -i eth0 driver: e1000 version: 7.3.21-k8-NAPI firmware-version: expansion-rom-version: bus-info: 0000:02:01.0 supports-statistics: yes supports-test: yes supports-eeprom-access: yes supports-register-dump: yes supports-priv-flags: no
停止网卡的发送模块 TX
#ethtool -A tx off eth0
设置网卡速率等信息
#ethtool -s eth0 autoneg off speed 100 duplex full //自协商关闭,速率设置为100M,全双工。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
2021-12-15 linux云服务器清除挖矿木马