It was a while I did not post anything on this blog, so I will engage into something cool now 🙂
And into something I will need one day or another: a collection of very, very useful networking commands available for Linux.
Let’s start with an easy one: iperf and its variant with more options, netperf.
Very useful to measure TCP/UDP performances between two hosts by pumping traffic either mono or bidirectionally.
In the simplest usage, on one server you run iperf -s and get the following output:
$ iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 128 KByte (default)
————————————————————
On the client, you run iperf -c <destination_host) -f m (this option is to get output in Mbps) and after few seconds you’ll see:
root@facchina:~# iperf -c 172.16.30.1 -f m
------------------------------------------------------------
Client connecting to 172.16.30.1, TCP port 5001
TCP window size: 0.02 MByte (default)
------------------------------------------------------------
[ 3] local 172.16.30.50 port 48643 connected with 172.16.30.1 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 1122 MBytes 941 Mbits/sec
Rather cool, huh? And there are countless options…
The second one I’m sharing with you is tcptrack. Fantastic tool to keep track of the tcp connections happening on your machine and how much they are active. When you type tcptrack -i <interface> here’s what you get:
Let’s continue with bmon, specifically conceived to monitor interface traffic while keeping historical info in the view:
Another great one to detect programs eating bandwidth is nethogs, shown here below in a running sample:
And then, a really cool one I use VERY frequenty: iftop, to chech the bandwidth used by every connection on the machine.
To conclude this list of tools I selected speedometer, a very nice and clean tool to display network traffic information with quite many options…
That’s all folks… enjoy!
RoarinPenguin