Network traffic can reveal a lot about the performance and security of your network. But monitoring it can be daunting, especially if you don’t know how to do it. By using the right commands, you can easily track network traffic and gain insights into the data transmitted through your network.
This post will uncover some of the most used tools to display network traffic information:
- Using the ifconfig Command
- Using the link show Command
- Using the netstat Command
- Using the bmon Command
- Using the nload Command
Method 1: Using the ifconfig Command
The “ifconfig” command can be used to troubleshoot network connectivity issues and to configure networking settings in Linux.
How to Install ifconfig (net-tools) on Linux?
The “ifconfig” command’s support is available through the “net-tools”, which is not installed by default. To install “net-tools” on Linux, use the appropriate command:
$ sudo apt install net-tools
$ sudo dnf install net-tools
$ sudo yum install net-tools
Example:
You can mention the name of your network interface along with this command that can be used to display the relevant information as below:
$ ifconfig ens33
- ens33: The name of our network traffic for which we want to display the network traffic.
- RX packets: Shows several packets being received in the form of traffic from the network.
- TX packets: Denotes how many packets are being transferred.
Method 2: Using the link show Command
This is another command that can also be used to show your network configuration along with the information regarding the network traffic as well:
$ ip -s link show ens33
The basic description of the above command is mentioned below:
- ip: This is the command used to show the network interfaces on Linux systems.
- -s: used to display detailed information, including statistics regarding the network.
- link: It is used to display information about network interfaces.
- show ens33: To show all the information for the network interface “ens33”.
The output shows the number of bytes and packets that are being sent and received.
Method 3: Using the netstat Command
This command displays detailed statistics about the network configuration, including the information related to TCP, UDP, ICMP, IP, and others. You should be able to see the number of packets received and sent, the number of errors encountered, and the number of timeouts by typing:
$ netstat -s
The information displayed under the “Ip” field will show you the total number of packets transmitted and received. You can also see the number of incoming delivered or deleted packets.
Method 4: Using the bmon Command
This tool can also monitor and analyze the network traffic in a separate section, displaying the information regarding sending and receiving packets and bandwidth usage.
How to Install bmon on Linux?
To install this tool on Linux, the users can run the following command in the terminal:
$ sudo apt install bmon #For Ubuntu
$ sudo dnf install bmon #For Fedora
$ sudo yum install bmon #For CentOS
Example:
This tool will give you the detail about your network bandwidth usage in real-time and can also track the amount of network traffic flowing in and out of a system by typing:
$ bmon
It shows you detailed information about network traffic in each row which you can monitor and analyze.
Method 5: Using the nload Command
This command displays the network-related information in real time so that a user can visualize and understand the network pattern and troubleshoot.
This command will display the information in two different sections, “incoming” and “outgoing”, making it quite effective for every user to understand.
How to Install nload on Linux?
To install this tool on Linux, the following command is used:
$ sudo apt install nload #For Ubuntu
$ sudo yum install nload #For CentOS
$ sudo dnf install nload #For Fedora
Example:
After installing it, you can view your network traffic-related information by typing:
$ nload
You can see two different sections in the output with data receiving and transferring information.
Conclusion
If you are facing connectivity issues or low internet speed, then it is advisable to check your network-related information. This will not only help you for troubleshooting purposes, but you can also resolve them as well to improve the network speed. In this article, we have discussed multiple tools and commands that you can use to display and monitor your network traffic to resolve errors.