利用wondershaper对vps进行限速
最近在NS上收了一个vmshell家的HK CMI,因为有黑洞所以非常便宜。但是我自己用,影响不大,用这个wondershaper给做一下限速。 wondershaper项目: https://github.com/magnific0/wondershaper apt update apt install git apt install make #如果已经安装了环境这里可以跳过 git clone https://github.com/magnific0/wondershaper.git 安装: cd wondershaper make install 运行,比如限速100Mbps,注意修改网卡名,可以用 ip a 或者 ifconfig 命令查看网卡名: wondershaper - a eth0 -d 100000 -u 100000 清空限速: wondershaper -c - a eth0 后台开机自运行,可以修改配置文件: vi /etc/systemd/wondershaper.conf [wondershaper] # Adapter IFACE = "eth0" # Download rate in Kbps DSPEED = "100000" # Upload rate in Kbps USPEED = "100000" 然后启动一下systemd服务就好了: systemctl enable wondershaper systemctl start wondershaper 查看状态: systemctl status wondershaper 上面 wondershaper 项目,systemd 后台运行代码有点问题,需要自己修改一下才能正常使用: vi / usr / local / lib / systemd / system / wondershaper.service https://github.com/magnific0/wondershaper/pull/97/commits/0687d844fcfc75f597033ebc78a04c2a31c7179e