买了vmshell家的HK CMI,经常会测速黑洞。可以自己给服务器限一下速,避免黑洞。
刚好GitHub上有一个项目:
https://github.com/magnific0/wondershaper
下面就在服务器上配置一下,限速200Mbps:
下载:
git clone https://github.com/magnific0/wondershaper.git
安装:
cd wondershaper
make install
运行,比如限速200Mbps,注意修改网卡名,可以用 ip a
或者 ifconfig
命令查看网卡名:
wondershaper -a eth1 -d 200000 -u 200000
清空限速:
wondershaper -c -a eth1
后台开机自运行,可以修改配置文件:
vi /etc/systemd/wondershaper.conf
[wondershaper]
# Adapter
IFACE="eth1"
# Download rate in Kbps
DSPEED="200000"
# Upload rate in Kbps
USPEED="200000"
然后启动一下systemd服务就好了:
systemctl enable wondershaper
systemctl start wondershaper
查看状态:
systemctl status wondershaper