[email protected]Support 24/7 · Billing 09:00 – 00:00LinkedInXFacebook
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 Run Linux Commands in Background
March 13, 2023

How to Run Linux Commands in Background

How To Run Linux Commands In Background. In this article, we will talk about the background processes is Linux. We will show you how to start a command in the background and how to keep the process running after the shell session is closed. In this article, we will talk about the background…

Read article
How to Copy, Cut and Paste in Vim / Vi
March 13, 2023

How to Copy, Cut and Paste in Vim / Vi

How To Copy, Cut And Paste In Vim / Vi This article shows how to copy, cut, and paste in Vim / Vi editor. When working with text files, copying, cutting, and pasting text is one of the most commonly performed tasks. Vim or its precursor Vi comes preinstalled on macOS and almost all Linux…

Read article
How to Add User to Sudoers in Debian
March 13, 2023

How to Add User to Sudoers in Debian

How To Add User To Sudoers In Debian This tutorial shows two ways to grant sudo privileges to a user. The first one is to add the user to the sudoers file . This file contains a set of rules that determines which users or groups are granted with sudo privileges, as well as the…

Read article
Get in Touch

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

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

Get Started →Contact Us
[email protected]Support 24/7 · Billing 09:00 – 00:00