ssh
与 telnet
) 或只服务小量数据的封包优先处理。
tc
命令 (由 iproute 软件包提供) 设置 QoS 参数。因为其接口较为复杂,建议使用高端的工具。
wondershaper
(在同名的软件包中) 的主要目的是最小化独立网络负载的延迟。经由限制整体流量的值缩短链接的饱和值。
wondershaper interface download_rate upload_rate
命令,设置流量控制。可以是 eth0
或 ppp0
接口,两者的速度均以每秒千位为单位。wondershaper remove interface
命令可以在特定接口停用流量控制。
up
和down
操作到/etc/network/interfaces
文件来分别在接口配置前,配置完成后运行。比如:
例 10.9. 对文件/etc/network/interfaces
的变更
iface eth0 inet dhcp up /sbin/wondershaper eth0 500 100 down /sbin/wondershaper remove eth0
/etc/ppp/ip-up.d/
生成一个脚本调用wondershaper
命令来使能流量控制。
pfifo_fast
queue scheduler, which provides a few interesting features by itself. The priority of each processed IP packet is based on the DSCP field (Differentiated of Services Code Point) of this packet; modifying this 6-bit field is enough to take advantage of the scheduling features. Refer to https://en.wikipedia.org/wiki/Differentiated_services#Class_Selector for more information.
nft add table ip mangle nft add rule ip mangle PREROUTING tcp sport 22 counter ip dscp set 0x04 nft add rule ip mangle PREROUTING tcp dport 22 counter ip dscp set 0x04