当前位置:网站首页>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
边栏推荐
- Azure file synchronization of altaro: the end of traditional file servers?
- Source insight automatic installation and licensing
- 请求数据库报错:“could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGram
- 32GB Jetson Orin SOM 不能刷机问题排查
- The IntelliJ platform completely disables the log4j component
- 配置xml文件的dtd
- Analysis of the example of network subnet division in secondary vocational school
- MySQL startup error: several solutions to the server quit without updating PID file
- Error 1045 (28000) occurs when Linux logs in MySQL: access denied for user 'root' @ 'localhost' (using password: yes)
- Redis cannot connect remotely.
猜你喜欢
配置xml文件的dtd
Altaro set grandfather parent child (GFS) archiving
Redhat7系统root用户密码破解
Deep embedding and alignment of Google | protein sequences
[written examination question analysis] | | get [sizeof and strlen] [pointer and array] graphic explanation + code analysis
Why is go language particularly popular in China
[Shangshui Shuo series together] day 10
今天很多 CTO 都是被干掉的,因为他没有成就业务
Linux登录MySQL出现ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)
Capacity expansion mechanism of map
随机推荐
Redhat7系统root用户密码破解
Source insight License Activation
[explain in depth the creation and destruction of function stack frames] | detailed analysis + graphic analysis
Error 1045 (28000) occurs when Linux logs in MySQL: access denied for user 'root' @ 'localhost' (using password: yes)
The IntelliJ platform completely disables the log4j component
Webrtc protocol introduction -- an article to understand ice, stun, NAT, turn
穀歌 | 蛋白序列的深度嵌入和比對
Pytorch through load_ state_ Dict load weight
【无标题】
Obtenir et surveiller les journaux du serveur distant
chromedriver对应版本下载
Source insight automatic installation and licensing
Final review (Day7)
mysql启动报错:The server quit without updating PID file几种解决办法
NG Textarea-auto-resize
"C and pointer" - Chapter 13 advanced pointer int * (* (* (*f) () [6]) ()
今天很多 CTO 都是被幹掉的,因為他沒有成就業務
Azure file synchronization of altaro: the end of traditional file servers?
Hotel public broadcasting background music - Design of hotel IP network broadcasting system based on Internet +
[untitled]