linux服务器限制网卡带宽 置顶!
注意:
最近有此需求。在网上查找到此篇贴子,并尝试,真的不错。
需要注意,限制时的单位是 kbps 1mbps=1024kbps≈1024/8=128kb/s
简单介绍
这个服务的名称叫做:wondershaper
https://github.com/magnific0/wondershaper
可以使用 git 拉去最新版本,当然也可以使用 yum 仓库里面的,推荐使用 git 的方法:
git clone https://github.com/magnific0/wondershaper.git
安装:
git clone https://github.com/magnific0/wondershaper.git
cd wondershaper
make install
启动服务并设置开机启动:
systemctl start wondershaper.service
systemctl enable wondershaper.service
使用
可以看到 -d 是下载限速,-u 是上传限速,-a 是指定网卡,-c 清除限速。这就是我们最常用的三个参数。
wondershaper -a eth0 -d 1024 -u 512
wondershaper -a eth0 -u 512
wondershaper -c -a eth0
帮助
转载自:https://www.cnblogs.com/Dy1an/p/12170515.html
转载请注明出处,如有错误,请帮忙指正,谢谢!
标题:linux服务器限制网卡带宽
作者:走在人生的路上z
地址:http://17mark.com/articles/2020/09/02/1599015887412.html
此处应有打赏

