当前位置:网站首页>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
边栏推荐
- 今天很多 CTO 都是被幹掉的,因為他沒有成就業務
- Transferring images using flask
- 今天很多 CTO 都是被干掉的,因为他没有成就业务
- 一起上水碩系列】Day 9
- kubernetes资源对象介绍及常用命令(五)-(ConfigMap)
- Go practice - gorilla / handlers used by gorilla web Toolkit
- Altaro virtual machine replication failed: "unsupported file type vmgs"
- Go practice -- gorilla/rpc (gorilla/rpc/json) used by gorilla web Toolkit
- Technical analysis of qianyuantong multi card aggregation router
- Configure and use Anaconda environment in pycharm
猜你喜欢

Today, many CTOs were killed because they didn't achieve business

Webrtc M96 release notes (SDP abolishes Plan B and supports opus red redundant coding)

【一起上水硕系列】Day 10

PHP notes are super detailed!!!

Map的扩容机制
![[Shangshui Shuo series together] day 10](/img/a3/e8b9df588bef67ead925813a75c8c0.png)
[Shangshui Shuo series together] day 10

How to set up altaro offsite server for replication

Go practice - gorilla / handlers used by gorilla web Toolkit

@Solutions to null pointer error caused by Autowired

3dslam with 16 line lidar and octomap
随机推荐
Making coco datasets
[together Shangshui Shuo series] day 7 content +day8
Apache+PHP+MySQL环境搭建超详细!!!
期末复习(day3)
Personal outlook | looking forward to the future from Xiaobai's self analysis and future planning
[written examination question analysis] | | get [sizeof and strlen] [pointer and array] graphic explanation + code analysis
Disassembly and installation of Lenovo r7000 graphics card
About debugging the assignment of pagenum and PageSize of the formal parameter pageweb < T > (i.e. page encapsulation generic) in the controller
College campus IP network broadcasting - manufacturer's design guide for college campus IP broadcasting scheme based on campus LAN
[set theory] relational closure (relational closure related theorem)
Redhat7系统root用户密码破解
2022.7.2 simulation match
Introduction to redis using Lua script
Go practice -- design patterns in golang's singleton
32GB Jetson Orin SOM 不能刷机问题排查
[advanced pointer (2)] | [function pointer, function pointer array, callback function] key analysis + code explanation
【一起上水硕系列】Day 7 内容+Day8
2022.DAY592
Jetson AgX Orin platform porting ar0233 gw5200 max9295 camera driver
2022.7.2day594