{"id":11701,"date":"2019-03-15T22:46:32","date_gmt":"2019-03-15T22:46:32","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=11701"},"modified":"2019-03-15T22:46:32","modified_gmt":"2019-03-15T22:46:32","slug":"iftop-a-real-time-linux-network-bandwidth-monitoring-tool","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/15\/iftop-a-real-time-linux-network-bandwidth-monitoring-tool\/","title":{"rendered":"iftop \u2013 A Real Time Linux Network Bandwidth Monitoring Tool"},"content":{"rendered":"<p>In our earlier article, we have reviewed the usage of\u00a0<a href=\"https:\/\/www.tecmint.com\/12-top-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">TOP Command<\/a>\u00a0and it\u2019s parameters. In this article we have came up with another excellent program called\u00a0<strong>Interface TOP<\/strong>\u00a0<strong>(IFTOP)<\/strong>\u00a0is a real time console-based network bandwidth monitoring tool.<\/p>\n<p>It will show a quick overview of network activities on an interface. Iftop shows a real time updated list of network usage bandwidth every\u00a0<strong>2<\/strong>,\u00a0<strong>10<\/strong>\u00a0and\u00a0<strong>40<\/strong>\u00a0seconds on average. In this post we are going to see the installation and how to use\u00a0<strong>IFTOP<\/strong>\u00a0with examples in Linux.<\/p>\n<h4>Requirements:<\/h4>\n<ol>\n<li><strong>libpcap<\/strong>\u00a0: library for capturing live network data.<\/li>\n<li><strong>libncurses<\/strong>\u00a0: a programming library that provides an API for building text-based interfaces in a terminal-independent way.<\/li>\n<\/ol>\n<h3>Install libpcap and libncurses<\/h3>\n<p>First start by installing\u00a0<strong>libpcap<\/strong>\u00a0and\u00a0<strong>libncurses<\/strong>\u00a0libraries using your Linux distribution package manager as shown.<\/p>\n<pre>$ sudo apt install libpcap0.8 libpcap0.8-dev libncurses5 libncurses5-dev  [<strong>On Debian\/Ubuntu<\/strong>]\r\n# yum  -y install libpcap libpcap-devel ncurses ncurses-devel             [<strong>On CentOS\/RHEL<\/strong>]\r\n# dnf  -y install libpcap libpcap-devel ncurses ncurses-devel             [<strong>On Fedora 22+<\/strong>]\r\n<\/pre>\n<h3>Download and Install iftop<\/h3>\n<p><strong>Iftop<\/strong>\u00a0is available in the official software repositories of\u00a0<strong>Debian\/Ubuntu<\/strong>\u00a0Linux, you can install it using\u00a0<a href=\"https:\/\/www.tecmint.com\/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management\/\" target=\"_blank\" rel=\"noopener\">apt command<\/a>\u00a0as shown.<\/p>\n<pre>$ sudo apt install iftop\r\n<\/pre>\n<p><center>On\u00a0<strong>RHEL\/CentOS<\/strong>, you need to enable the\u00a0<a href=\"https:\/\/www.tecmint.com\/how-to-enable-epel-repository-for-rhel-centos-6-5\/\" target=\"_blank\" rel=\"noopener\">EPEL repository<\/a>, and then install it as follows.<\/center><\/p>\n<pre># yum install epel-release\r\n# yum install  iftop\r\n<\/pre>\n<p>On\u00a0<strong>Fedora<\/strong>\u00a0distribution,\u00a0<strong>iftop<\/strong>\u00a0is also available from the default system repositories to install using the following command.<\/p>\n<pre># dnf install iftop\r\n<\/pre>\n<p>Other Linux distributions, can download\u00a0<strong>iftop<\/strong>\u00a0source package using\u00a0<a href=\"https:\/\/www.tecmint.com\/10-wget-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">wget command<\/a>\u00a0and compile it from source as shown.<\/p>\n<pre># wget http:\/\/www.ex-parrot.com\/pdw\/iftop\/download\/iftop-0.17.tar.gz\r\n# tar -zxvf iftop-0.17.tar.gz\r\n# cd iftop-0.17\r\n# .\/configure\r\n# make\r\n# make install\r\n<\/pre>\n<h3>Basic usage of Iftop<\/h3>\n<p>Once installation done, go to your console and run the\u00a0<strong>iftop<\/strong>\u00a0command without any arguments to view bandwidth usage of default interface, as shown in the screen shot below.<\/p>\n<pre>$ sudo iftop\r\n<\/pre>\n<p>Sample output of\u00a0<strong>iftop<\/strong>\u00a0command which shows bandwidth of default interface as shown below.<\/p>\n<div id=\"attachment_28712\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2012\/10\/Monitor-Linux-Network-Bandwidth-Real-Time.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28712\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2012\/10\/Monitor-Linux-Network-Bandwidth-Real-Time.png\" sizes=\"auto, (max-width: 1104px) 100vw, 1104px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2012\/10\/Monitor-Linux-Network-Bandwidth-Real-Time.png 1104w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2012\/10\/Monitor-Linux-Network-Bandwidth-Real-Time-768x433.png 768w\" alt=\"Monitor Linux Network Bandwidth Real Time\" width=\"1104\" height=\"623\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Monitor Linux Network Bandwidth Real Time<\/p>\n<\/div>\n<h3>Monitor Linux Network Interface<\/h3>\n<p>First run the following\u00a0<a href=\"https:\/\/www.tecmint.com\/ifconfig-command-examples\/\" target=\"_blank\" rel=\"noopener\">ifconfig command<\/a>\u00a0or\u00a0<a href=\"https:\/\/www.tecmint.com\/ip-command-examples\/\" target=\"_blank\" rel=\"noopener\">ip command<\/a>\u00a0to find all attached network interfaces on your Linux system.<\/p>\n<pre>$ sudo ifconfig\r\nOR\r\n$ sudo ip addr show\r\n<\/pre>\n<p>Then use the\u00a0<code>-i<\/code>\u00a0flag to specify the interface you want to monitor. For example the command below used to monitor bandwidth on the wireless interface on the test computer.<\/p>\n<pre>$ sudo iftop -i wlp2s0\r\n<\/pre>\n<div id=\"attachment_28713\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2012\/10\/Monitor-Linux-Wifi-Network-Bandwidth.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28713\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2012\/10\/Monitor-Linux-Wifi-Network-Bandwidth.png\" sizes=\"auto, (max-width: 1104px) 100vw, 1104px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2012\/10\/Monitor-Linux-Wifi-Network-Bandwidth.png 1104w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2012\/10\/Monitor-Linux-Wifi-Network-Bandwidth-768x433.png 768w\" alt=\"Monitor Linux Wifi Network Bandwidth\" width=\"1104\" height=\"623\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Monitor Linux Wifi Network Bandwidth<\/p>\n<\/div>\n<p>To disable hostname lookups, use the\u00a0<code>-n<\/code>\u00a0flag.<\/p>\n<pre>$ sudo iftop -n  eth0\r\n<\/pre>\n<p>To turn on port display, use the\u00a0<code>-P<\/code>\u00a0switch.<\/p>\n<pre>$ sudo iftop -P eth0\r\n<\/pre>\n<h3>Iftop Options and Usage<\/h3>\n<p>While running\u00a0<strong>iftop<\/strong>\u00a0you can use the keys like\u00a0<code>S<\/code>,\u00a0<code>D<\/code>\u00a0to see more information like\u00a0<strong>source<\/strong>,\u00a0<strong>destination<\/strong>\u00a0etc. Please do run\u00a0<strong>man iftop<\/strong>\u00a0if you want to explore more options and tricks. Press \u2018<code>q<\/code>\u2018 to quit from running windows.<\/p>\n<p>In this article, we\u2019ve showed how to install and use iftop, a network interface monitoring tool in Linux. If you want to know more about\u00a0<strong>iftop<\/strong>\u00a0please visit\u00a0<a href=\"http:\/\/www.ex-parrot.com\/pdw\/iftop\/download\/\" target=\"_blank\" rel=\"noopener\">iftop website<\/a>. Kindly share it and send your comment through our comment box below.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/iftop-linux-network-bandwidth-monitoring-tool\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In our earlier article, we have reviewed the usage of\u00a0TOP Command\u00a0and it\u2019s parameters. In this article we have came up with another excellent program called\u00a0Interface TOP\u00a0(IFTOP)\u00a0is a real time console-based network bandwidth monitoring tool. It will show a quick overview of network activities on an interface. Iftop shows a real time updated list of network &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/15\/iftop-a-real-time-linux-network-bandwidth-monitoring-tool\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;iftop \u2013 A Real Time Linux Network Bandwidth Monitoring Tool&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-11701","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=11701"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11701\/revisions"}],"predecessor-version":[{"id":11702,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11701\/revisions\/11702"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=11701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=11701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=11701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}