• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

iftop Command Examples in Linux

by admin

The iftop command displays bandwidth usage information for the system, helping to identify whether a particular NIC or protocol is consuming the most bandwidth. The iftop command may not be installed on all Linux distributions. This command can help you identify why a particular link may be slow by showing the traffic on that connection. You can use it to check to see what is consuming the most bandwidth on an interface. For example:

# iftop -i eth0

Syntax

The syntax of the iftop command is:

# iftop [options] [-i {interface}]

iftop Command Examples

1. Running the basic package needs no arguments. In fact, a typical iftop session can be started with the following command:

# iftop

2. you can use the following argument to display the results for a specific device:

# iftop -i ethX

3. Show the bandwidth usage with port information:

# iftop -P

4. Do not show bar graphs of traffic:

# iftop -b

5. By default, iftop will attempt to resolve all IP addresses into hostname, but you can avoid this with the -n option like this:

# iftop -n -i ethX

6. Get help about interactive commands:

?

7. In certain situations, you should be aware that you can use iftop to investigate the flow of packets across a network range by initializing the appropriate filter like this:

# iftop -F 192.168.1.0/255.255.255.0 -i eth0

8. You can choose to show the results for a specific port with the following syntax:

# iftop -i eth0 -f 'port http'

9. Alternatively, rather than displaying the results in bits per second, using the -B option in the following way the display will now show bandwidth rates in bytes per second:

# iftop -B -F 192.168.1.0/255.255.255.0 -i eth0

You can learn more about iftop by typing:

# man iftop

Conclusion

Network slowness is often a symptom of bandwidth saturation, in which a network link’s capacity is exceeded, i.e., all bandwidth is being used up. This can lead to degraded network performance or even service outages. With the iftop command, you can investigate any NICs on a network link that you suspect may be sending or receiving excessive sums of traffic across that link. For example, one host might be making repeated requests to an internal web server, and both hosts might be flooding the network with their requests and responses. Once you’ve identified the source of the issue, you can then take steps to stop the offending host from making these requests, such as terminating the service responsible for the requests.

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to identify the HBA cards/ports and WWN in Linux
  2. cewl Command Examples in Linux
  3. CentOS / RHEL : How to configure alias (virtual interface) of bond interface (bondx:y)
  4. How To Disable Ksplice Service on OEL
  5. tail: command not found
  6. lrzuntar: command not found
  7. How To Open A Port In CentOS / RHEL 7
  8. host Command Examples in Linux
  9. nmcli connection Command Examples in Linux
  10. How to set “max_report_luns” and “max_luns” on CentOS/RHEL 7 to scan more than 16,383 LUNs

You May Also Like

Primary Sidebar

Recent Posts

  • qsub Command Examples in Linux
  • qsub: command not found
  • qrcp Command Examples in Linux
  • qmrestore Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright