介绍
- WonderShaper可以对服务器网卡的宽带进行限制,同时支持对多网卡进行分别限制,安装使用都很方便;
- GitHub项目:https://github.com/magnific0/wondershaper
安装
一:安装依赖
#Debian/Ubuntu系统
apt install -y make git
#CentOS系统
yum install make git -y
二:安装WonderShaper
git clone https://github.com/magnific0/wondershaper.git
cd wondershaper
make install
三:命令详细
USAGE: wondershaper [-hcs] [-a <adapter>] [-d <rate>] [-u <rate>]
OPTIONS:
-h 显示此消息
-a <adapter> 设置适配器
-d <rate> 设置最大下载速率(单位:Kbps)
-u <rate> 设置最大上传速率(单位:Kbps)
-p 使用 /etc/conf.d/essenshaper.conf 中的预设
-c 从适配器中清除限制
-s 显示适配器的当前状态
-v 显示当前版本
四:使用示例
首先使用ifconfig
命令来查看网卡名称;
博主的网卡名称为enp1s0
,下面使用以下命令来限制enp1s0
网卡的宽带速率;