1) 安装
$ git clone https://github.com/magnific0/wondershaper.git
$ cd wondershaper
$ sudo make install
2) 自启
$ sudo systemctl enable wondershaper.service
$ sudo systemctl start wondershaper.service
3) 查询到网卡的详细信息
$ ip addr
$ route
$ ifconfig
4) 限制网络带宽
$ sudo wondershaper -a <adapter> -d <rate> -u <rate>
$ sudo wondershaper -a enp0s8 -d 1024 -u 512
-a:网卡名称
-d:下行带宽(Kbps)
-u:上行带宽(Kbps)
5) 网卡解除网络带宽的限制
$ sudo wondershaper -c -a enp0s8
或
$ sudo wondershaper -c enp0s8
6) 配置文件
$ sudo gedit /etc/conf.d/wondershaper.conf
[wondershaper]
# Adapter
#
IFACE="eth0"
# Download rate in Kbps
#
DSPEED="2048"
# Upload rate in Kbps
#
USPEED="512"
没有评论:
发表评论