|
| 1 | +iftop |
| 2 | +=== |
| 3 | + |
| 4 | +一款实时流量监控工具 |
| 5 | + |
| 6 | +## 补充说明 |
| 7 | + |
| 8 | +**iftop命令** 是一款实时流量监控工具,监控TCP/IP连接等,缺点就是无报表功能。必须以root身份才能运行。 |
| 9 | + |
| 10 | +### 语法 |
| 11 | + |
| 12 | +``` |
| 13 | +iftop(选项) |
| 14 | +``` |
| 15 | + |
| 16 | +### 选项 |
| 17 | + |
| 18 | +``` |
| 19 | +iftop: display bandwidth usage on an interface by host |
| 20 | +
|
| 21 | +Synopsis: iftop -h | [-npblNBP] [-i interface] [-f filter code] |
| 22 | + [-F net/mask] [-G net6/mask6] |
| 23 | +
|
| 24 | + -h display this message |
| 25 | + -n don't do hostname lookups |
| 26 | + -N don't convert port numbers to services |
| 27 | + -p run in promiscuous mode (show traffic between other |
| 28 | + hosts on the same network segment) |
| 29 | + -b don't display a bar graph of traffic |
| 30 | + -B Display bandwidth in bytes |
| 31 | + -i interface listen on named interface |
| 32 | + -f filter code use filter code to select packets to count |
| 33 | + (default: none, but only IP packets are counted) |
| 34 | + -F net/mask show traffic flows in/out of IPv4 network |
| 35 | + -G net6/mask6 show traffic flows in/out of IPv6 network |
| 36 | + -l display and count link-local IPv6 traffic (default: off) |
| 37 | + -P show ports as well as hosts |
| 38 | + -m limit sets the upper limit for the bandwidth scale |
| 39 | + -c config file specifies an alternative configuration file |
| 40 | + -t use text interface without ncurses |
| 41 | + |
| 42 | + Sorting orders: |
| 43 | + -o 2s Sort by first column (2s traffic average) |
| 44 | + -o 10s Sort by second column (10s traffic average) [default] |
| 45 | + -o 40s Sort by third column (40s traffic average) |
| 46 | + -o source Sort by source address |
| 47 | + -o destination Sort by destination address |
| 48 | + |
| 49 | + The following options are only available in combination with -t |
| 50 | + -s num print one single text output afer num seconds, then quit |
| 51 | + -L num number of lines to print |
| 52 | +
|
| 53 | +``` |
| 54 | + |
| 55 | +### 界面说明 |
| 56 | + |
| 57 | +> 第一行为带宽,这里为1Mbit,不是字节哦. |
| 58 | +> 连接列表,最后三列分别是2秒,10秒和40秒的平均流量 |
| 59 | +> `=>` 代表发送 |
| 60 | +> `<=` 代表接收 |
| 61 | +> 最后三行表示发送,接收和全部的流量, |
| 62 | +> 第二列为你运行iftop到目前流量,第三列为高峰值,第四列为平均值。 |
| 63 | +
|
| 64 | +### 实例 |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +```bash |
| 69 | +iftop # 默认是监控第一块网卡的流量 |
| 70 | +iftop -i eth1 # 监控eth1 |
| 71 | +iftop -n # 直接显示IP, 不进行DNS反解析 |
| 72 | +iftop -N # 直接显示连接埠编号, 不显示服务名称 |
| 73 | +iftop -F 192.168.1.0/24 or 192.168.1.0/255.255.255.0 # 显示某个网段进出封包流量 |
| 74 | +``` |
| 75 | + |
| 76 | + |
| 77 | +<!-- Linux命令行搜索引擎:https://jaywcjlove.github.io/linux-command/ --> |
0 commit comments