[Raspberry Pi] tcconfig でネットワーク帯域制限
Raspberry Pi でネットワーク帯域制限をしたくなった。tcconfig というツールを使えば簡単にできる。今回は tcconfig をインストールした Raspberry Pi そのものの帯域制限をしてみた。
GitHub - thombashi/tcconfig: A tc command wrapper. Make it easy to set up traffic control of network bandwidth/latency/packet-loss/packet-corruption/etc. to a network-interface/Docker-container(veth).
https://github.com/thombashi/tcconfig
以下のコマンドでインストールできる。
$ sudo pip install tcconfig
試しに 1 Mbps に制限してみる。
$ sudo tcset wlan0 --rate 1Mbps
前回インストールした Speedtest CLI を使って計測すると、tcconfig 前後で以下のようになった。
確かに上りが 1 Mpbs 以下になっている。
下りも 1 Mpbs に制限するには以下のコマンドを実行する。
$ sudo tcset wlan0 --rate 1Mbps --direction incoming
すると以下のようになった。
設定をリセットするには以下。
$ sudo tcdel wlan0 --all
参考:
簡単にDockerのネットワーク帯域制限を実現する - Qiita
https://qiita.com/----_/items/dfa542bc2976ebfd5b3c
この記事が気に入ったらサポートをしてみませんか?