Koozali.org: home of the SME Server

Limit each client bandwidth from LAN to 80kbps with CBQ

Offline sebahot

  • *
  • 19
  • +0/-0
    • Drake Systems
Limit each client bandwidth from LAN to 80kbps with CBQ
« on: April 16, 2005, 05:50:53 PM »
I'd like to limit the upload/download bandwidth for each ip in my LAN to 80kbps with CBQ. I have 2 files called cbq-80.eth1_up and cbq-80.eth0_down, as follows:

--------------------
cbq-80.eth1_up
--------------------
DEVICE=eth1,100Mbit,10Mbit
RATE=80Kbit
WEIGHT=8Kbit
PRIO=6
MARK=10
MARK=11
MARK=12
MARK=13
MARK=14
MARK=15
MARK=16
MARK=17
MARK=18
MARK=19
MARK=20


--------------------
cbq-80.eth0_down
--------------------
DEVICE=eth0,100Mbit,10Mbit
RATE=80Kbit
WEIGHT=8Kbit
PRIO=6
RULE=10.38.1.10
RULE=10.38.1.11
RULE=10.38.1.12
RULE=10.38.1.13
RULE=10.38.1.14
RULE=10.38.1.15
RULE=10.38.1.16
RULE=10.38.1.17
RULE=10.38.1.18
RULE=10.38.1.19
RULE=10.38.1.20

For limiting upload I mark packets (becouse I use NAT) with
iptables --table mangle -A POSTROUTING --out-interface eth1 --source 10.38.1.10 -j MARK --set-mark 10
iptables --table mangle -A POSTROUTING --out-interface eth1 --source 10.38.1.11 -j MARK --set-mark 11
(and so on for every ip)

The problem I have is that the ip's get 80kbps bandwidth divided to them not each ip taking a 80kbps bandwidth for upload and 80kbps for download.
I'd like each client to take a 80kbps bandwidth for upload and 80kbps bandwidth for download and the bandwidth to be NOT shared between clients.

Please help me with this.

Sebastian
...

Offline Appesteijn

  • ***
  • 62
  • +0/-0
Limit each client bandwidth from LAN to 80kbps with CBQ
« Reply #1 on: April 18, 2005, 07:01:37 AM »
So now you put those ip's all in the same class. I think you should put them all in a seperate class, so they don't divide the total bandwidth. In my last situation it worked when I made seperate files for all my internal ip's. In that way the server could see that the class shouldn't be divided over all the ip's but that an ip should get it's own class.
............