[email protected]Office hours: Mon – Fri 9:00AM – 5:00PMLinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedAugust 4, 2023

How to use iptraf (Monitor NIC Traffic In Real Time) command

How To Use Iptraf (Monitor NIC Traffic In Real Time) Command.

IPTRAF is a command-line utility that allows users to monitor real-time network traffic on a Linux server. It can be used to monitor various network statistics such as TCP/UDP traffic, network bandwidth utilization, and network packet counts. The tool can be used to troubleshoot network-related issues and provides a quick overview of network traffic.

 

How to install iptraf.

To install iptraf on a Linux system, you can use the package manager specific to your distribution. Below are examples for some popular package managers used in different Linux distributions:

  1. Debian/Ubuntu (apt package manager):

sudo apt update
sudo apt install iptraf
  1. Red Hat, CentOS, Fedora (yum package manager):

sudo yum install iptraf
  1. Arch Linux (pacman package manager):

sudo pacman -S iptraf-ng

Once the installation is complete, you can run iptraf from the terminal. Note that some distributions might have slightly different package names, but the above examples should work for most cases.

 

Options

The following table lists the available options for the IPTRAF command:

Option

Description

-s

Start IPTRAF in silent mode

-d

Start IPTRAF in debug mode

-h

Display help information

-v

Display version information

 

How do I use iptraf command?

The syntax is:

iptraf 
iptraf [options]
iptraf -i interface_name_here
iptraf-ng -i interface_name_here

To start the IP traffic monitor for eno1 interface type the following command. Pass the -i all option for all interfaces:

# iptraf-ng -i eno1
# iptraf-ng -i eno1
# iptraf -i all

 

To start the general interface statistics, enter:

# iptraf -g
# iptraf-ng -g

 

To see the detailed statistics facility on an interface called eno1

# iptraf -d interface_name_here
# iptraf -d eno1
# iptraf-ng -d wlp4s0

 

To see the TCP and UDP monitor on an interface called eno1

# iptraf -z interface_name_here
# iptraf -s eno1
# iptraf-ng -s wlp4s0

 

To displays the packet size counts on an interface called eno1

# iptraf -z interface_name_here
# iptraf -z eno1
# iptraf-ng -z wlp4s0

 

Other options for iptraf-ng command

Here are other options for the program:

-l iface    - start the LAN station monitor ("-l all" for all LAN interfaces)
-B          - run in background (use only with one of the above parameters)
-t timeout  - when used with one of the above parameters, tells
              the facility to run only for the specified number of
              minutes (timeout)
-L logfile  - specifies an alternate log file for any direct invocation
              of a facility from the command line.  The log is placed in
              /var/log/iptraf if path is not specified.
-I interval - specifies the log interval for all facilities except the IP
              traffic monitor.  Value is in minutes.
-f          - clear all locks and counters.  Use with great caution.
              Normally used to recover from an abnormal termination.

 

Conclusion:

IPtraf is a versatile network monitoring tool that offers valuable insights into network traffic and statistics. Its real-time capabilities make it a powerful ally for network administrators and enthusiasts seeking to understand, optimize, and troubleshoot their networks. By exploring the different sections of IPtraf and utilizing practical examples, you can harness the full potential of this useful tool and gain a deeper understanding of your network’s behavior.

Keep reading
How to Implement Network Segmentation and Resource Isolation in Linux.
February 6, 2024

How to Implement Network Segmentation and Resource Isolation in Linux.

How to Implement Network Segmentation and Resource Isolation in Linux. Securing and managing networks in a Linux environment involves advanced practices like network segmentation and resource isolation. This guide explores these concepts, providing detailed instructions and examples for…

Read article
How to open or close ports in Linux.
February 6, 2024

How to open or close ports in Linux.

How to open or close ports in Linux. Effectively managing ports on your Linux system is crucial for both security and service accessibility. This comprehensive guide will provide a detailed walkthrough on opening and closing ports using the robust tools iptables and ufw. Understanding these…

Read article
How to use ypdomainname command.
January 23, 2024

How to use ypdomainname command.

How to use ypdomainname command. In the realm of Linux networking, the ypdomainname command plays a crucial role in the context of the Network Information Service (NIS). NIS, formerly known as Yellow Pages, is a distributed database service that facilitates the sharing of network configuration and…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, colocation, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Office hours: Mon – Fri 9:00AM – 5:00PM