Openwrt中用iftop查看網絡流量情況


iftop可以查看指定網卡上的流量情況, 命令說明

iftop: display bandwidth usage on an interface by host

Synopsis: iftop -h | [-npblNBP] [-i interface] [-f filter code]
                               [-F net/mask] [-G net6/mask6]

   -h                  display this message
   -n                  don't do hostname lookups
   -N                  don't convert port numbers to services
   -p                  run in promiscuous mode (show traffic between other
                       hosts on the same network segment)
   -b                  don't display a bar graph of traffic
   -B                  display bandwidth in bytes
   -a                  display bandwidth in packets
   -i interface        listen on named interface
   -f filter code      use filter code to select packets to count
                       (default: none, but only IP packets are counted)
   -F net/mask         show traffic flows in/out of IPv4 network
   -G net6/mask6       show traffic flows in/out of IPv6 network
   -l                  display and count link-local IPv6 traffic (default: off)
   -P                  show ports as well as hosts
   -m limit            sets the upper limit for the bandwidth scale
   -c config file      specifies an alternative configuration file
   -t                  use text interface without ncurses

   Sorting orders:
   -o 2s                Sort by first column (2s traffic average)
   -o 10s               Sort by second column (10s traffic average) [default]
   -o 40s               Sort by third column (40s traffic average)
   -o source            Sort by source address
   -o destination       Sort by destination address

   The following options are only available in combination with -t
   -s num              print one single text output afer num seconds, then quit
   -L num              number of lines to print

iftop, version 1.0pre4
copyright (c) 2002 Paul Warren <pdw@ex-parrot.com> and contributors

如果要查看內網連接的各個IP的流量情況, 使用命令

iftop -i br-lan

顯示的界面是類似於這樣的

        10b               1.00Kb            100Kb             10.0Mb      1.00Gb
└───────┴─────────────────┴─────────────────┴─────────────────┴─────────────────
123.215.56.131             => x240.lan                   2.96Mb  2.21Mb  2.25Mb
                           <=                             172Kb   127Kb   130Kb
125.103.109.3              => Honor_V8.lan                671Kb   899Kb   735Kb
                           <=                            14.5Kb  14.7Kb  12.9Kb
125.102.164.48             => 20180331KQT.lan             485Kb   840Kb   329Kb
                           <=                            17.6Kb  40.1Kb  18.4Kb
125.102.164.31             => 20180331KQT.lan               0b    184Kb  75.8Kb
                           <=                               0b   34.9Kb  12.8Kb
200.132.127.188            => 192.168.253.176               0b    116Kb  29.0Kb
                           <=                               0b   5.53Kb  1.38Kb
112.233.48.111             => 192.168.253.176             478Kb  95.6Kb  23.9Kb
                           <=                            23.6Kb  4.73Kb  1.18Kb
125.15.222.48              => EDZ-20180331KQT.lan           0b   77.1Kb  41.9Kb
                           <=                               0b   12.4Kb  6.69Kb

────────────────────────────────────────────────────────────────────────────────
TX:             cum:    175MB   peak:   4.69Mb  rates:   4.66Mb  4.47Mb  4.21Mb
RX:                    8.49MB            498Kb            277Kb   293Kb   305Kb
TOTAL:                  183MB           5.16Mb           4.93Mb  4.75Mb  4.50Mb

界面的說明:

第一行是刻度, 因為下面顯示的每一個連接, 都會根據流量大小高亮顯示, 根據的是第一行的刻度. 刻度默認顯示的是普通坐標, 按L(大寫)可以在普通坐標和對數坐標之間切換
第二行之后是每一個有流量的連接, 箭頭表示流向, 右側的三個數, 分別表示最近的2s, 10s, 40s的平均流量
底部三行, 分別是TX出向, RX入向, TOTAL總計三個維度的統計, 每個維度里面顯示的數值分別為cum合計, peak峰值, rates: 2s, 10s, 40s的流量均值

運行時可以使用的命令, 可以通過按h(小寫)查看

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM