2019-04-21 11:50:48 +08:00

54 lines
3.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="iftop">iftop</h1>
<p>一款实时流量监控工具</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>iftop命令</strong> 是一款实时流量监控工具监控TCP/IP连接等缺点就是无报表功能。必须以root身份才能运行。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">iftop(选项)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">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&#39;t do hostname lookups
-N don&#39;t convert port numbers to services
-p run in promiscuous mode (show traffic between other
hosts on the same network segment)
-b don&#39;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
</code></pre>
<h3 id="界面说明">界面说明</h3>
<blockquote>
<p>第一行为带宽这里为1Mbit,不是字节哦. 连接列表最后三列分别是2秒10秒和40秒的平均流量 <code>=&gt;</code> 代表发送<br />
<code>&lt;=</code> 代表接收 最后三行表示发送,接收和全部的流量, 第二列为你运行iftop到目前流量第三列为高峰值第四列为平均值。</p>
</blockquote>
<h3 id="实例">实例</h3>
<div class="sourceCode" id="cb3"><pre><code class="language-bash"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="ex">iftop</span> # 默认是监控第一块网卡的流量</a>
<a class="sourceLine" id="cb3-2" data-line-number="2"><span class="ex">iftop</span> -i eth1 # 监控eth1</a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="ex">iftop</span> -n # 直接显示IP, 不进行DNS反解析</a>
<a class="sourceLine" id="cb3-4" data-line-number="4"><span class="ex">iftop</span> -N # 直接显示连接埠编号, 不显示服务名称</a>
<a class="sourceLine" id="cb3-5" data-line-number="5"><span class="ex">iftop</span> -F 192.168.1.0/24 or 192.168.1.0/255.255.255.0 # 显示某个网段进出封包流量</a></code></pre></div>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->