您的位置:首页 > 理论基础 > 计算机网络

利用iftop查看网络带宽使用情况

2015-09-12 00:00 573 查看
摘要: CentOS 安装配置iftop 查看实时带宽

#利用iftop查看服务器实时流量
yum install -y gcc flex byacc libpcap ncurses ncurses-devel libpcap-devel tcpdump

yum -y install iftop
#下面是源码编译安装方式
wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz tar zxvf iftop-0.17.tar.gz
cd iftop-0.17
./configure
make && make install
/usr/local/iftop/sbin/iftop -i eth0 -B -n #就可以看到eth0网卡的流量状况


#参数说明:
#TX发送 RX接收 TOTAL总流量 cum运行iftop后的总量 peak峰值 rates分别表示过去2s 10s 40s 平均流量

iftop -help
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  设置监听网卡接口,默认eth0
-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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: