Linux中查看网卡流量工具有iptraf
、iftop
以及nethogs
等,
iftop可以用来监控网卡的实时流量(可以指定网段)、反向解析IP、显示端口信息等。
1、安装iftop
centos安装iftop的命令如下:
yum install iftop -y
2、查看网卡实时流量命令:
iftop -i eth1
其中eth1
是服务器的公网网卡,网卡名称可以通过ip addr
查看
执行命令查看外网占用带宽情况,能查看到相应IP占用带宽的情况, 从而判断哪个占用带宽最多,是否恶意连接:
将占用带宽最多的IP,用防火墙或者安全组屏蔽访问即可。
当然,最好是观察一段时间,如果是持续占用带宽,加上IP是外地的,那就完全可以屏蔽它。为了更好的监控某个特定IP的带宽访问情况,可以执行命令:
iftop -i eth1 -B -F 182.92.***.20
显示182.92..20这个IP与服务器的网卡eth1交互的数据量,单位是Byte。*
界面说明:
"<="与"=>",表示的是流量的方向
"TX":从网卡发出的流量
"RX":网卡接收流量
"TOTAL":网卡发送接收总流量
"cum":iftop开始运行到当前时间点的总流量
"peak":网卡流量峰值
"rates":分别表示最近2s、10s、40s 的平均流量
可以通过键盘的"q"键退出iftop
版权属于: 三三世界-百宝箱
本文链接: http://33f.net/linux/centos_check_bandwidth_network_iftop.html
本文最后更新于2022年07月18日 ,已超过886天没有更新,若内容或图片失效,请留言反馈。
本文允许转载,但请在转载时请以超链接或其它形式标明文章出处
@Doug Shume it's ok for me , you can post here.
Saved as a favorite, I like your website!
If some one wishes to be updated with hottest technologies after that he must be visit this site and be up to date daily.
Heello would you mind sharing which blog platform you're using? I'm planning to start my own blog in the near future but I'm having a tough time making a decision between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your layout seems different then moost blogs and I'm looking for something completely unique. P.S Apologies forr being off-topic butt I had to ask!
Thanks to my father who shared with me regarding this webpage, this website is genuinely amazing.
Hi, I have an overflow of customers that I'd like to send to you but I want to make sure you can handle more leads, let me know if you'd like me to send you more info.
zh.us.to 有效
kms.03k.org 有效
kms.chinancce.com
kms.shuax.com 有效
kms.dwhd.org 有效
kms.luody.info 有效
kms.digiboy.ir 有效
kms.lotro.cc 有效
www.zgbs.cc 有效
cy2617.jios.org 有效
@ 权限问题,试试sudo 再加命令。
你好提示Permission denied 怎么办啊