wondershaper脚本限速
Wonder Shaper是一个脚本,允许用户限制一个或多个网络适配器的带宽。它通过使用iproute的tc命令来执行此操作,但是大大简化了其操作。Wonder Shaper由Bert Hubert于2002年首次发布,但原始版本缺少命令行界面,从1.2版开始添加了此功能。从版本1.3开始,使用HTB队列而不是CBQ,从而可以更好地管理高速(十兆位以上)链路上的带宽。在版本1.4中,实现了一种改进的入口整形方法,并且可以限制向下或向上(这两种方法仍然可行)。。
下载方式
- (1)
yum install wondershaper
- (2)源码编译安装 https://github.com/magnific0/wondershaper
USAGE: /usr/sbin/wondershaper [-hcs] [-a <adapter>] [-d <rate>] [-u <rate>]
Limit the bandwidth of an adapter
OPTIONS:
-h Show this message
-a <adapter> Set the adapter
-d <rate> Set maximum download rate (in Kbps) and/or
-u <rate> Set maximum upload rate (in Kbps)
-p Use presets in "/etc/systemd/wondershaper.conf"
-c Clear the limits from adapter
-s Show the current status of adapter
-v Show the current version
Configure HIPRIODST in "/etc/systemd/wondershaper.conf" for hosts
requiring high priority i.e. in case ssh uses dport 443.
MODES:
wondershaper -a <adapter> -d <rate> -u <rate>
wondershaper -c -a <adapter>
wondershaper -s -a <adapter>
EXAMPLES:
wondershaper -a eth0 -d 1024 -u 512
wondershaper -a eth0 -u 512
wondershaper -c -a eth0