iftop is a free and open-source command-line system monitoring utility that displays a frequently-updated list of network bandwidth usage broken down by individual host connections. Unlike other bandwidth monitoring tools that show bandwidth usage by process or interface, iftop focuses on showing the bandwidth consumed by individual TCP/IP connections.
The name "iftop" is derived from "interface top," similar to how the popular "top" command displays process activity. Just as "top" provides real-time information about processes, iftop provides real-time information about network connections.
iftop is particularly useful for network administrators and system engineers who need to:
Identify which connections are consuming the most bandwidth
iftop allows you to filter the displayed traffic using Berkeley Packet Filter (BPF) syntax, similar to tcpdump:
# Show only HTTP trafficsudo iftop -f 'port 80 or port 443'# Show traffic to/from a specific hostsudo iftop -f 'host 192.168.1.100'# Show traffic between two specific subnetssudo iftop -f 'net 192.168.1.0/24 and net 10.0.0.0/8'
iftop offers several options to customize the display:
# Don't show bar graphssudo iftop -b# Show traffic in bytes rather than bitssudo iftop -B# Don't perform hostname lookupssudo iftop -n# Don't perform port lookupssudo iftop -N# Show port numberssudo iftop -P# Sort by source addresssudo iftop -S# Sort by destination addresssudo iftop -D
iftop is a powerful and flexible tool for real-time network bandwidth monitoring at the connection level. Its ability to break down bandwidth usage by individual connections makes it invaluable for network troubleshooting, performance optimization, and security monitoring.
By mastering iftop's various options and filters, system administrators and network engineers can gain valuable insights into network traffic patterns and quickly identify bandwidth-intensive connections or potential network issues.
Whether you're diagnosing network congestion, monitoring server traffic, or investigating unusual network activity, iftop provides the visibility needed to understand what's happening on your network at the connection level.
Test Your Knowledge
Take a quiz to reinforce what you've learned
Exam Preparation
Access short and long answer questions for written exams