Before being asked to test the network card bandwidth capability, found iperf this tool, recorded to prevent forgetting.
Iperf is an open source cross-platform test bandwidth tool, Windows, Linux, MacOS ... All support, installation is also very convenient.
1. Installation
Address: https://iperf.fr/
2. Testing
See: https://www.52os.net/articles/iperf-check-bandwidth.html
Whether it is a TCP or UDP test, one end runs the server mode, the other end runs the client mode, and if you open the iptables, you can also specify a port if you want to turn on TCP 5001.
1). TCP mode
Server-side:
Iperf–s
Client:
Single Thread
Iperf-c serverip-t 60-i 1
Multithreading
Iperf-c serverip-t 60-i 1-p 5
2). UDP mode
Server-side:
Iperf-u–s
Client:
Iperf-c serverip-t 60-i 1-b 100M
3. Problems encountered
1). Firewall to shut down
I used Win8 and CentOS test, began to ping Win8, and later found that Win8 's firewall is not shut, close it ...
Later found that WIN8 can only do server, if as a client, CentOS will not receive data, only to find that CentOS also has a default firewall ...
Shutting down the Firewall service
Systemctl Stop Firewalld
After the shutdown, CentOS can be used as a server.
2). Bandwidth measurement Dissatisfaction
I test on both sides of the Gigabit network card, the first test is about 900Mbps, but then it becomes 95Mbps, what is the matter?
Start thinking is Iperf version problem, changed also still not, later found that the network has auto-negotiation function, and I see the local connection auto-negotiation result is 100Mbps, so the bandwidth of course will not exceed 100Mbps, then I modified auto-negotiated for fixed 1000Mbps duplex
WIN8 Settings: Network connection, adapter, properties, NIC configuration, advanced, speed and duplex->1.0gbps
Cenos settings:
View more information
Ethtool Eno1
Set disable auto-negotiation set fixed speed and mode of operation
Ethtool-s ethx Autoneg off speed + duplex full
But sadly, the above setup is complete, the network is not connected to the link layer on the detection, do not know is not win8 and Cenos incompatible?
[Tool]iperf Test bandwidth