How to Use Iptarf to Monitor Network Traffic and Bandwidth
iptraf - Interactive Colorful IP LAN Monitor, also is an ncurses-based IP LAN monitor that generates various network statistics including TCP info, UDP counts, ICMP and OSPF information, Ethernet load info, node stats, IP checksum errors, and others.
Introduction
Monitoring network traffic and bandwidth usage is crucial for network administrators to ensure the smooth running of networks. One of the most popular and effective tools for network monitoring is Iptarf. Iptarf is a command-line tool that provides real-time monitoring of network traffic and bandwidth usage. In this blog post, we will discuss how to use Iptarf to monitor network traffic and bandwidth.
How to Install and Setup Iptarf
Before we start using Iptarf, we need to install and set it up. Iptarf is available in most Linux distributions, so you can install it using your distribution’s package manager. For example, in Ubuntu, you can install Iptarf using the following command:
sudo apt-get install iptraf
yum install iptraf iptraf-ng
Once Iptarf is installed, you can launch it by typing the following command in the terminal:
sudo iptraf
This will launch the Iptarf interface, from where you can start monitoring your network.
How to Use Iptarf to Monitor Network Traffic and Bandwidth
Viewing all network card traffic
iptraf -g
## or
iptraf-ng -g
View traffic traffic on each port of a certain network card
iptraf -s eth0
iptraf-ng 1.1.4
l Proto/Port q Pkts q Bytes q PktsTo qqqqqq BytesTo qqqqq PktsFrom qqqq BytesFrom qk
x UDP/68 4 1336 0 0258 4 85334 16 6064 242 79270
x UDP/67 4 258 85334 4 242 79270 0 160 6064
x UDP/546 1 57 7406 0 0 1 157 7406
x UDP/547 1 57 7406 1 57 7406 0 0
x UDP/53 4 140 16032 2 70 4604 2 70 398 11428
x TCP/80 1 512 80181599 1 274 80 41926 0 238 139673
x TCP/443 1 561 80311332 1 297 80 38195 0 264 273137
x UDP/137 2 308 24024 1 154 78 12012 78 154 12012
x UDP/123 1 4 76 304 1 2 76 152 0 2 152
x TCP/23 2 80 1 40 1 40
x TCP/445 2 6 92 272 1 3 52 152 40 3 12
Classify traffic traffic by protocol
iptraf -d eth0
Filter by remote host port
iptraf -i eth0
Conclusion
Iptarf is a powerful tool for monitoring network traffic and bandwidth usage. With its real-time monitoring capabilities and detailed statistics, it is an essential tool for network administrators. By following the steps outlined in this blog post, you can easily install and set up Iptarf and start monitoring your network traffic and bandwidth usage.
Small world. Big idea!
- Welcome to visit the knowledge base of SRE and DevOps!
- License under CC BY-NC 4.0
- No personal information is collected
- Made with Material for MkDocs and generative AI tools
- Copyright issue feedback me#imzye.com, replace # with @
- Get latest SRE news and discuss on Discord Channel