当前位置:网站首页>Using the ethtool command by example
Using the ethtool command by example
2022-07-03 05:42:00 【TAOXC( ̿ ▀ ̿ ̿Ĺ̯̿̿ ▀ ̿ ̿】
ethtool The command is used to display / Change Ethernet adapter settings . You can go to Linux Use this tool to change the network card speed 、 Automatic negotiation 、LAN Wake up settings 、 Duplex mode . In this paper , I'll show you some ways to help you solve the problem of Ethernet card ethtool Order sample .
1) Display Ethernet interface details
ethtool The command retrieves the status of the Ethernet interface . The output shows etho The speed of the interface 、 Duplex 、 Properties such as status and wake-up .
Here is an example :
# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: d
Wake-on: d
Current message level: 0x00000007 (7)
Link detected: yes
There are three types of duplex :
full duplex : Use when Ethernet is connected to the switch . Allow bidirectional transmission , That is, send and receive data packets at the same time .
Half duplex : Use when Ethernet is connected to the hub . Only one-way transmission is allowed , That is, send or receive data packets .
Automatic negotiation : According to the network connection , Ethernet interface decides whether to use full duplex or half duplex .
2) ETHTOOL_OPTS Variable
have access to Ethtool_opt Variables are permanently set Ethtool Command settings . Let's take a look at the example given below :
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
ETHTOOL_OPTS="speed 50 duplex full autoneg off"
You can use ifup and ifdown Command to test the above settings .
3) Show statistics
You can use the following commands to check Ethernet driver settings and auto negotiation :
# ethtool -i eth0
driver: bnx2
version: 2.0.1-suse
firmware-version: 1.9.3
bus-info: 0000:04:00.0
[[email protected] ~]# ethtool –a eth0
Pause parameters for eth0:
Autonegotiate: on
RX: on
TX: on
Ethtool Ordered “-p Options ” Helps identify specific devices from multiple devices .
# ethtool –p eth0
Having network card statistics is very useful for solving network problems .
# ethtool –S eth0
NIC statistics:
tx_packets: 148683
rx_packets: 179489
tx_errors: 0
rx_errors: 0
rx_missed: 0
align_errors: 0
tx_single_collisions: 0
tx_multi_collisions: 0
unicast: 116884
broadcast: 25361
multicast: 61674
tx_aborted: 0
tx_underrun: 0
The above output shows the details about transmitting and receiving packets .
4) Enable flow control
In the latest MAC and GMAC Embedded devices , Can pass “PAUSE” Parameter enable full duplex flow control .
This is the solution :
# ethtool -A eth0 [autoneg on|off] [rx on|off] [tx on|off]
The details of the uninstall parameters are as follows :
# ethtool –k eth0
however , Any changes made to the Ethernet parameter settings will disappear at the next startup . To keep them intact the next time they start , You must add commands to /etc/rc.local Make these changes permanent
# cat /etc/rc.local
ethtool -s eth0 speed 100 duplex full autoneg on 1>/dev/null 2>/dev/null
ethtool -s eth1 speed 100 duplex full autoneg on 1>/dev/null 2>/dev/null
5) Set duplex mode
The following example shows how to use ethtool Command to set speed or duplex mode , As shown below :
# ethtool -s eth0 speed 100 duplex full
# ethtool -s eth0 speed 10 duplex half
边栏推荐
- 大二困局(复盘)
- 请求数据库报错:“could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGram
- Hotel public broadcasting background music - Design of hotel IP network broadcasting system based on Internet +
- [together Shangshui Shuo series] day 7 content +day8
- [written examination question analysis] | | get [sizeof and strlen] [pointer and array] graphic explanation + code analysis
- C 语言文件操作函数大全 (超详细)
- 获取并监控远程服务器日志
- Go practice -- use JWT (JSON web token) in golang
- Explanation of several points needing attention in final (tested by the author)
- Apache+PHP+MySQL环境搭建超详细!!!
猜你喜欢

Mapbox tasting value cloud animation

【一起上水硕系列】Day 10

Deploy crawl detection network using tensorrt (I)

Altaro o365 total backup subscription plan

Progressive multi grasp detection using grasp path for rgbd images
![[function explanation (Part 2)] | [function declaration and definition + function recursion] key analysis + code diagram](/img/29/1644588927226a49d4b8815d8bc196.jpg)
[function explanation (Part 2)] | [function declaration and definition + function recursion] key analysis + code diagram
![[set theory] relational closure (reflexive closure | symmetric closure | transitive closure)](/img/c8/2995c503e9dabae4e2cc704449e04f.jpg)
[set theory] relational closure (reflexive closure | symmetric closure | transitive closure)

Qt读写Excel--QXlsx插入图表5
![[explain in depth the creation and destruction of function stack frames] | detailed analysis + graphic analysis](/img/df/884313a69fb1e613aec3497800f7ba.jpg)
[explain in depth the creation and destruction of function stack frames] | detailed analysis + graphic analysis
![[set theory] relational closure (relational closure related theorem)](/img/6a/b6dca7abf592f8d8ab1d6aecc43381.jpg)
[set theory] relational closure (relational closure related theorem)
随机推荐
[set theory] relational closure (reflexive closure | symmetric closure | transitive closure)
[function explanation (Part 2)] | [function declaration and definition + function recursion] key analysis + code diagram
[trivia of two-dimensional array application] | [simple version] [detailed steps + code]
Introduction to redis using Lua script
Skip table: principle introduction, advantages and disadvantages of skiplist
穀歌 | 蛋白序列的深度嵌入和比對
[together Shangshui Shuo series] day 7 content +day8
[untitled]
Pytorch through load_ state_ Dict load weight
2022.7.2day594
一起上水碩系列】Day 9
Troubleshooting of 32GB Jetson Orin SOM failure to brush
6.23星期四库作业
Source insight operation manual installation trial
2022.6.30DAY591
Can altaro back up Microsoft teams?
@Import annotation: four ways to import configuration classes & source code analysis
2022.7.2 simulation match
"C and pointer" - Chapter 13 function pointer 1: callback function 2 (combined with template to simplify code)
Final review (Day7)