ssh
や telnet
など) や小さなブロックのデータだけを取り扱うサービスに関連するパケットに高い優先度を付けることも可能です。
tc
コマンド (iproute パッケージに含まれます) を使って設定します。tc
コマンドはインターフェースがかなり複雑なので、高レベルツールを使うことを推奨します。
wondershaper
(同名のパッケージに含まれます) の主目的はネットワーク負荷とは無関係に待ち時間を最小化することです。全トラフィックをある値に制限することにより、これは実現されます。この値には帯域を飽和させるよりほんの少しだけ小さな値を設定します。
wondershaper interface download_rate upload_rate
. The interface can be enp1s0
, eth0
or ppp0
for example, and both rates are expressed in kilobits per second. The wondershaper remove interface
command disables traffic control on the specified interface.
up
and down
directives to the /etc/network/interfaces
file allowing declared commands to be run, respectively, after the interface is configured and before it is deconfigured. Or in the PPP case, creating a script that calls wondershaper
in /etc/ppp/ip-up.d/
will enable traffic control as soon as the connection is up. Below is an example using this first method:
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 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