Skip to content

using iptraf to monitor network traffic and bandwidth

iptraf is a console-based network monitoring application for Linux. It provides a display of current TCP/IP network traffic, including IP and MAC addresses, packet statistics, and other information.

yum install iptraf iptraf-ng

查看所有网卡流量

iptraf -g
或者
iptraf-ng -g

查看某网卡上各个端口流量

iptraf -s eth0
 iptraf-ng 1.1.4
l Proto/Port q Pkts q Bytes q PktsTo qqqqqq BytesTo qqqqq PktsFrom qqqq BytesFrom qk
x UDP/68   4      1336       0  0258    4      85334             16            6064            242           79270
x UDP/67                    4    258           85334       4    242           79270       0     160           6064
x UDP/546                   1     57            7406       0               0      1            157            7406
x UDP/547                   1     57            7406       1     57            7406       0       0
x UDP/53                    4    140           16032       2     70            4604       2     70     398   11428
x TCP/80                    1    512        80181599       1    274        80 41926       0    238          139673
x TCP/443                   1    561        80311332       1    297        80 38195       0    264          273137
x UDP/137                   2    308           24024       1    154        78 12012       78   154           12012
x UDP/123                   1      4        76   304       1      2        76   152       0      2             152
x TCP/23                    2               80             1               40     1       40
x TCP/445                   2      6        92   272       1      3        52   152       40     3             12

按协议分类统计流量

iptraf -d eth0

查看远程主机端口

iptraf -i eth0

Disclaimer
  1. License under CC BY-NC 4.0
  2. Copyright issue feedback me#imzye.me, replace # with @
  3. Not all the commands and scripts are tested in production environment, use at your own risk
  4. No privacy information is collected here
Try iOS App