Use ethtool to get the full network card rate in Linux

Use ethtool to get the full network card rate in Linux

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

1. Full-speed network card rate <br />The following examples are all based on the full speed of 100Mbps.
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. Check 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. Set the startup to be added 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 on different systems

d. Debian setup method (ignore steps b and c)
Add in the /etc/network/interfaces file

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

2. Common 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 ethtool command help (help)
ethtool -i eth0 //Query the relevant information of eth0 network port
ethtool -d eth0 //Query the registration information of eth0 network port
ethtool -r eth0 //Reset eth0 network port to adaptive mode
ethtool -S eth0 //Query the statistics of packets sent and received on the eth0 network port
ethtool -s eth0 [speed 10|100|1000] [duplex half|full] [autoneg on|off] //Set the network port rate to 10/100/1000M, set the network port half/full duplex, and set whether the network port is auto-negotiation

<<:  DediPath: $18/month/4GB memory/250GB space/10TB traffic/5 IP/KVM/Los Angeles

>>:  DeinServerHost: €8.95/month/4GB RAM/100GB SSD space/unlimited traffic/DDOS/Windows/Germany

Recommend

BeastVM: $6/month/1 CPU/512M/20G/4T/1 IP/OpenVZ/Anti-DDOS

BeastVM is a Canadian hosting company that provid...

DeepNet Solutions: $2/month/256MB RAM/10GB storage/250GB/KVM/Los Angeles

DEEPNET SOLUTIONS, founded in 2011, previously pr...

Veesp: $1/month/512MB memory/10GB space/100GB traffic/200Mbps/KVM/Russia

Veesp, a Russian hosting company, was founded in ...

SupremeVPS: $29/year/2G memory/20GB SSD space/5TB traffic/KVM/Los Angeles

SupremeVPS is newly established. We have introduc...

VPS.NET Free VPS for three months

VPS.NET is launching an April promotion, where yo...

GalaxyHostPlus: $2.5/month/1GB memory/60GB space/10TB traffic/KVM/DDOS/France

GalaxyHostPlus, an Irish hosting provider, was es...

FirstHeberg: €9.99/month/ATOM/2GB memory/1TB space/unlimited traffic/France

FirstHeberg, a French hosting provider, was found...

Free public DNS in foreign and domestic countries to improve browsing speed

We recommend Alibaba DNS and Tencent Public DNS+....

【Double 11】iara.cloud: Japan KDDI VPS, 12% off, can unblock Netflix

Enjoy a one-time discount of 12% off on all produ...