4
1

More than 5 years have passed since last update.

Cent6 環境でIPベース帯域制御させてみる

Last updated at Posted at 2017-11-17

社内のメールサーバーが会社のネットワークに突如300Mbps超の帯域を5分置きにかけ続けるようになりました。iftopから帯域を使っているIPを割り出して追跡してみると別部署で作ったWebメールのメール同期の仕組みらしい。
社内インフラ稼働にかかわる負荷をかけてくれたので出禁にしたかったですが、そうもいかない事情があり仕方なしにIPベースで帯域しぼることにしました。
tc の設定作成用ツールを使用させていただいてます。

インストール
git clone https://github.com/matsumotory/qos-control.git
yum --enablerepo=epel install perl-Jcode perl-Class-Accessor
cd ./qos-control
sh ./setup.sh
使用法
  • Rule閲覧
./qos-control.pl --method=view --ip=<Server IP>
  • テストrule 作成
./qos-control.pl --method=set --ip=<Server IP> --direction=out --traffic=64 --src=<source ip>

例)172.16.0.100 からサーバー192.168.100.100 へのトラフィックを64Mbps に絞る
./qos-control.pl --method=set --ip=<192.168.100.100> --direction=out --traffic=64 --src=172.16.0.100
*** old [192.168.100.100] settings ***
--------------------------
nothing
--------------------------

Setting ... OK

*** current [192.168.100.100] settings ***
------------------------------
CLSID->interface->eth0       direction->out        bandwidth->64Mbps     server_ip_port>192.168.110.112      src_ip->172.16.0.100
------------------------------
  • 確認

iftop でみるとわかりやすい。ぶったぎるよりもソフトに抑え込む感じ。
なおプロセス単位で絞りたい場合は trickle を使ってみる手も。

4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1