Using ethtool at full network card speed under Linux

888u

Last update at :2024-05-28,Edit by888u

For some independent servers and VPS, due to various reasons, the network card speed in the system cannot reach the nominal speed, or the network speed is limited due to personal needs, then ethtool is a suitable tool.

1. Below the full speed network card rate, the full speed 100Mbps is used as an example. 1. Install ethtool under Centos:

yum -y install ethtool net-tools

Under Debian:

apt-get install ethtool net-tools

2. Set the network card speed a. View the network card information

ifconfig

View network port information

ethtool eth0

b. Rate setting

ethtool -s eth0 speed 100 duplex full autoneg off

The 100 represents 100Mbps

c. Add the startup settings directly to the network card information in /etc/sysconfig/network-scripts/ifcfg-eth0

ETHTOOL_OPTS="speed 100 duplex full autoneg off"

/etc/sysconfig/network-scripts/ifcfg-eth0 is slightly different in different systems

d. Debian setting method (ignoring steps b and c) add it to the /etc/network/interfaces file

link-speed 100 link-duplex full ethernet-autoneg off

2. Commonly used commands of ethtool ethtool eth0 //Query the basic settings of the ethx network port, where x is the number of the corresponding network card, such as eth0, eth1, etc. ethtool -h //Display the ethtool command help (help) ethtool -i eth0 //Query the relevant information of the eth0 network port ethtool -d eth0 //Query the registration information of the eth0 network port ethtool -r eth0 //Reset the eth0 network port to adaptive mode ethtool -S eth0 //Query the statistics of packets sent and received by the eth0 network port ethtool -s eth0 [speed 10|100|1000] [duplex half|full] [autoneg on|off] //Set the network port speed 10/100/1000M, set the network port half/full duplex, and set whether the network port is automatic Negotiate

Recommended site searches: http proxy ip, US virtual space, cm domain name registration, how much does website registration cost, ip address, foreign domain name, cloud host rental, icp quick registration, Wanwang domain name space, vps host,

Using ethtool at full network card speed under Linux

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码