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 following two tabs change content below.
Ruwantha Nissanka is a Professional Cyber Security Engineer from Sri lanka with having a demonstrated history of providing cyber security services for multiple organizations in Sri Lanka. He is a positive person who wants to believe the best in others and he likes to help, encourage people and make them feel good.