hopeless-dream

导航

iptraf网络监控工具

安装

[root@iZzm446eh1ux98Z ~]# yum install -y iptraf

帮助信息 

usage: iptraf-ng [options]
   or: iptraf-ng [options] -B [-i <iface> | -d <iface> | -s <iface> | -z <iface> | -l <iface> | -g]

    -h, --help            show this help message

    -i <iface>            start the IP traffic monitor (use '-i all' for all interfaces)         ## 查看远程主机端口
    -d <iface>            start the detailed statistics facility on an interface                 ## 显示指定网卡上的流量统计,总体流量、流入量、流出量、以及按协议分类的流量统计   
    -s <iface>            start the TCP and UDP monitor on an interface                          ## 统计某个网络接口的各个端口流量
    -z <iface>            shows the packet size counts on an interface                           ## 在指定网络接口上显示包计数
    -l <iface>            start the LAN station monitor (use '-l all' for all LAN interfaces)    ## 在指定网络接口上立即开始监视局域网工作站信息
    -g                    start the general interface statistics                                ## 在指定网络接口上显示包计数

    -B                    run in background (use only with one of the above parameters             ## 将标注输出重新定向到“/dev/null”,关闭标注输入,将程序作为后台进程运行
    -f                    clear all locks and counters                                             ## 清空所有计数器
    -t <n>                run only for the specified <n> number of minutes                         ## 指定监控运行时间
    -L <logfile>          specifies an alternate log file

基本配置

1. Configure

    这个非常重要,进行适当的配置可以让统计的结果更直观,信息更丰富。
    1)Reverse DNS lookups:查看连接的ip所对应的域名,在IP traffic monitor的pkt captured对话框中就可以看到域名结果,这个不是很直观,开启后会有点点影响抓包性能。
    2)TCP/UDP service names:在有端口的地方都会把端口号换成相应的服务名,非常有用,很直观。
    3)Activity mode:显示流量是按Kbits/s还是Kbytes/s,建议改成后面的更符合习惯。
    4)Additional ports:按端口号监控所额外需要监控的端口,默认只监控小于1024的。

2. Filters:这个默认就行了,除非你有特殊需要。

3. IP traffic monitor:根据连接查看网络流量,这个最好让他跑一段时间看统计总量的结构,如果单个连接占用大量带宽,就很容易看出来。同时根据IP还可以很容易分辨是和内网还是外网服务器进行交互。pkt captured可以看到mac地址。

4. General interface statistics:查看每个网卡上的流量,注意一下,这个是网卡流量,包括内网和外网,单机是无法分辨内外网。

5. Detailed interface statistics:根据协议进行统计,就只有IP, TCP, UDP等几个,感觉用处不大。

6. Statistical breakdowns中的By TCP/UDP port:根据应用协议进行统计,比上面那个更实用。

7. LAN station monitor:根据mac地址统计,但是感觉貌似不对劲,找不到我自己主机的mac,这个确实没搞懂。

configure

运行iptraf-ng后,需要配置configure

 

posted on 2020-09-02 11:08  hopeless-dream  阅读(469)  评论(0编辑  收藏  举报