Re: IP based bandwith limit

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

unfortunately there is only one interface for the customers. My problem is to limit the up AND down speed in dependence to each other.

So customer A get a bandwith of 2Mbit this is up AND down so if he downloads with 1Mbit he gets a max upload speed of 1Mbit.

I've tried it with htb like this:

#!/bin/sh
TC=/sbin/tc
DEV=eth0

$TC qdisc add dev $DEV root handle 1 htb default 90
$TC qdisc add dev $DEV handle ffff: ingress
$TC class add dev $DEV parent 1: classid 1:2 htb rate 100Mbit burst 6k

$TC class add dev $DEV parent 1:2 classid 1:10 htb rate 10kbps ceil 10kbps
$TC filter add dev $DEV parent 1:0 protocol ip prio 100 u32 \
   match ip dst 192.168.1.19 \
   classid 1:10

$TC filter add dev $DEV parent ffff: protocol ip prio 50 u32 \
   match ip src 192.168.1.19 \
   police rate 10kbps burst 10k drop flowid 1:10

this is my internal test. But it wouldn't work with dependence to each other...

Greets
Christoph

Peter Huetmannsberger wrote:

Hi!

Again, beware, that I am new to this myself, but if there is no borrowing necessary, does that mean you have more than 12 Mbit to hand out. If so, I assume you have one interface per customer, in which case you could use tbf on each interface. If both customers are behind the same interface you could use htb and lower the ceiling per customer, which has the same effect, with a filter rule for each customer --> class, based on ip address.

Hope this helps, correct me if I am wrong.

.peter


On Mon, 18 Oct 2004, Christoph Petersen wrote:



Hi,

i've following problem. One of our gateway router, which connects some of our customers should have bandwith limit.

So customer A with IP XX should have 2 Mbit, customer B with IP YY should have 10 Mbit. There is no need of borrowing bandwith so no fairness needed.

My simple question: with which technique should I manage this shaping? Or is there any existing project which provides this allready?

Greets
Christoph
_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/









_______________________________________________ LARTC mailing list / LARTC@xxxxxxxxxxxxxxx http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux