流量监控工具iftop简单安装、使用

系统:Centos7

安装

  • 安装依赖

    yum install -y flex byacc libpcap ncurses-devel libpcap-devel gcc
    
  • 下载安装包

     wget http://www.ex-parrot.com/pdw/iftop/download/iftop-1.0pre4.tar.gz
    
  • 编译安装

    tar zxvf iftop-1.0pre4.tar.gz
    cd iftop-1.0pre4
    ./configure 
    make && make install
    

使用

  • 测试

    iftop -B  ()
    

    在这里插入图片描述

  • 控制台打印说明

    <="与"=>",表示的是流量的方向
    "TX":出站的流量
    "RX":进站流量
    "TOTAL":发送接收总流量
    "rates":流量平均速率
    
  • 命令行参数

    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
       -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
    
  • 查询固定某一IP流量的命令示例

    iftop -B -F 10.58.22.71/32
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值