首页 > 编程知识 正文

linux流量转发到指定网卡,linux网卡流量查询

时间:2023-05-05 06:20:37 阅读:152547 作者:3498

在Linux上检测网络接口卡通信量的两个软件是:

第一个是nload

另一个是国际空间站

这两个软件的安装方法都很简单,从上述网站下载后,

安装nload :

./configure-- prefix=/usr/local/nloadmakemakeinstall

安装iftop :

./configure-- prefix=/usr/local/iftopmakemakeinstall

现在,您可以通过运行以下命令来监控网络接口卡上的通信量:

nload是:

#/usr/local/nload/端庄的钻石/nload

iftop是:

#/usr/local/iftop/s端庄的钻石/iftop

一般的服务器有内部网和外部网两块网卡。 nload默认为eth0网卡。 如果想监视eth1网卡的通信量:

那么…

#/usr/local/nload/端庄的钻石/nload eth1

这样就可以了。

nload默认分为上下两个块。 上半部分是加入IncoMing (即网卡)的业务,下半部分是输出(即来自该网卡的业务)分别是当前业务(Curr )和平均业务(Avg )

另外,也可以自己定义流量数值显示的单位#/usr/local/nload/端庄的钻石/nload --help

可以看到具体的参数。

接下来谈谈iftop

iftop也默认监视eth0网卡的通信量。 如果要监视名为eth1的网卡,则必须通过添加-i eth1来指定网卡。 这意味着:

#/usr/local/iftop/s端庄的钻石/iftop -i eth1

iftop也能直观显示,样子和操作就像top命令一样。

iftop的图表最后显示3列流量的数值

第一列意味着前两秒钟的平均流量

第二列表示前10秒内全部的流量

最后一列表示前40秒钟五分之一的流量值

就是这个意思。 具体仅限本人的英语,以下发表man page的英语。

Display :

When running,iftopusesthewholescreentodisplaynetworkusage.atthetopofthedisplayisalogarithmicscaleforthebargraphwhichgivesavesave

The main part of the display lists,for each pair of hosts,therateatwhichdatahasbeensentandreceivedoverthepreceding 2, 10 and 40 second intervals.thedirectionofdataflowisindicatedbyarrows,=and=. For instance,

foo.example.com=bar.example.com1kb 500 b 100 b

=2Mb 2Mb 2Mb

shows,on the first line,trafficfromfoo.example.comtobar.example.com; in the preceding 2 seconds,this averaged 1Kbit/s,aroundhalfthatamountoverthepreceding 10s, andafifthofthatoverthewholeofthelast 40 s.duringeachofthoseintervals,thedatasentintheotherdirectionwasabout2mbit/s.onthed partofeachlineisinvertedtogiveavisualindicationofthe 10 saverageoftraffic.youmightexpecttoseeesomethinglikethiswherehosthostherehostehoststfois marestfois marestis obar,whichissendingdatabackwhichsaturatesa2mbit/slink。

By default,thepairsofhostsresponsibleforthemosttraffic (10 second average ) are displayed at the top of the list。

At the bottom of the display,various totals are shown,includingpeaktrafficoverthelast 40s,totaltraffictransferred (

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。