| by Scott Kilroy | No comments

10 Examples of using Iptraf to monitor network traffic in linux

IPTraf is a network monitoring utility in linux that we can use to monitor IP traffic passing over the network. By using this tool, we can we can monitor various connections like TCP, UDP, ICMP, non-IP counts and also Ethernet load information etc.

you can install IPtraf using the following command:

#apt install iptraf

Once it is installed, you can run the following command to launch a menu driven interface that allows to view and modify network monitoring options

#iptraf

It will come up in interactive mode, with the various facilities that can be accessed through the main menu as shown below:

To monitor the ip traffic, you can select the “ip traffic monitor” option or run the following commands in the terminal

To view the ip traffic for a single interface:

#iptraf-ng -I <interface_name>

To view the ip traffic for all interfaces:

#iptraf-ng -I all

To see general statistics for interfaces:

#iptraf-ng -g

You can run the following command to see the detailed statistics for a single interface:

#iptraf-ng -d <interface_name>

You can also monitor TCP/UDP traffic on a specific interface, using the following command.

#iptraf -s <interface_name>

IPtraf gives you an option to display the size of the packets and the count on an interface.

#iptraf-ng -z <interface_name>

Run the following command to start the Lan station monitor:

#iptraf -I <interface_name>

You can specify an alternate log file for any direct invocation of a facility from the terminal. The log will be placed in /var/log/iptraf if the path is not specified.

#iptraf -L <path>

If you only need to run Iptraf for a specific number of minutes, you can set the timeout using the following command:

#iptraf -t <Number_of_minutes>

You can run this tool in the background to  continuously monitor the network traffic by executing the following command:

#iptraf -I <interface_to Monitor> -B

 

 

 

 

The post 10 Examples of using Iptraf to monitor network traffic in linux appeared first on The Linux Juggernaut.

Share Button

Source: The Linux Juggernaut