iftop

一款實時流量監控工具

補充說明

iftop命令 是一款實時流量監控工具,監控TCP/IP連接等,缺點就是無報表功能。必須以root身份才能運行。

語法

1iftop(選項)

選項

 1iftop: display bandwidth usage on an interface by host
 2
 3Synopsis: iftop -h | [-npblNBP] [-i interface] [-f filter code]
 4    [-F net/mask] [-G net6/mask6]
 5
 6   -h                  display this message
 7   -n                  don't do hostname lookups
 8   -N                  don't convert port numbers to services
 9   -p                  run in promiscuous mode (show traffic between other
10                       hosts on the same network segment)
11   -b                  don't display a bar graph of traffic
12   -B                  Display bandwidth in bytes
13   -i interface        listen on named interface
14   -f filter code      use filter code to select packets to count
15                      (default: none, but only IP packets are counted)
16   -F net/mask         show traffic flows in/out of IPv4 network
17   -G net6/mask6       show traffic flows in/out of IPv6 network
18   -l                  display and count link-local IPv6 traffic (default: off)
19   -P                  show ports as well as hosts
20   -m limit            sets the upper limit for the bandwidth scale
21   -c config file      specifies an alternative configuration file
22   -t                  use text interface without ncurses
23   
24   Sorting orders:
25   -o 2s                Sort by first column (2s traffic average)
26   -o 10s               Sort by second column (10s traffic average) [default]
27   -o 40s               Sort by third column (40s traffic average)
28   -o source            Sort by source address
29   -o destination       Sort by destination address
30   
31   The following options are only available in combination with -t
32   -s num              print one single text output afer num seconds, then quit
33   -L num              number of lines to print

界面說明

第一行爲帶寬,這裏爲1Mbit,不是字節哦. 連接列表,最後三列分別是2秒,10秒和40秒的平均流量 => 代表發送
<= 代表接收 最後三行表示發送,接收和全部的流量, 第二列爲你運行iftop到目前流量,第三列爲高峯值,第四列爲平均值。

實例

1iftop           # 默認是監控第一塊網卡的流量
2iftop -i eth1   # 監控eth1
3iftop -n        # 直接顯示IP, 不進行DNS反解析
4iftop -N        # 直接顯示連接埠編號, 不顯示服務名稱
5iftop -F 192.168.1.0/24 or 192.168.1.0/255.255.255.0  # 顯示某個網段進出封包流量

來源:https://github.com/jaywcjlove/linux-command

最後修改於: Wednesday, January 31, 2024

相關文章:

翻譯: