it iftop The command guide follows my previous 90 Linux Commands Frequently Used by Linux Sysadmins article. Over time, I will continue to publish articles on about 90 commands geared towards Linux sysadmins and Linux power users. let’s continue this series iftop
Permission.
iftop
is a terminal program that displays network activity and details in text form. It is suitable for users who want to monitor network traffic without the overhead of a graphical interface.
general syntax of iftop
The order is:
dstat [-afv] [options..] [delay [count]]
iftop linux install
Debian/Ubuntu and derivatives, use:
apt install iftop
RHEL/CentOS and derivatives, use:
dnf install iftop
Arch Linux and derivatives, use:
pacman -S iftop
iftop command example
To show bandwidth usage, use:
sudo iftop
To show the bandwidth usage of a given interface, use:
(replace with your interface)
sudo iftop -i eth0
To show bandwidth usage along with port information, use:
sudo iftop -P
To exclude, use a bar graph of traffic:
sudo iftop -b
To exclude hostname look ups, use:
sudo iftop -n
To display I/O traffic from a subnet, use:
sudo iftop -F 192.168.1.0/24
To sort traffic analysis data by source address, use:
sudo iftop -o source
To sort traffic analysis data by destination address, use:
sudo iftop -o destination
To monitor HTTP traffic, use:
sudo iftop -i eth0 -f 'port http'
To monitor HTTP traffic, excluding a specific host, use:
sudo iftop -i eth0 -f 'port http and not host 192.168.1.11'
To monitor DNS traffic, use:
sudo iftop -i eth0 -f 'port domain'
To monitor ICMP traffic, use:
sudo iftop -i eth0 -f 'icmp'
To monitor network traffic but ignore broadcast packets, use:
sudo iftop -i eth0 -f 'not ether host ff:ff:ff:ff:ff:ff'
Shortcut to change display options while running:
- h – Toggles the Help screen.
- s – toggles the source host display, and
- D – Toggles the destination hosts.
- s – Toggles the port number.
- n – Toggles name resolution.
- n – toggles the port resolution; Toggle resolution off to see all port numbers.
- Tea – Toggles the text interface. Default display requires ncurses.
- P – Pauses the display.
- Why – Leaves the program.
Useful links/references:
Related orders:
Leave a Comment