On Fri, 14 Apr 2000, Daniel Ryde wrote:

> Hi there,
> 
> I need some help from a CBQ mentor to figure out a shaping problem where I
> want to limit an ethernet to have a default speed of 256Kbit, but for a
> few destination network allow full bandwith.
> 
> Simple setup like this:
> 
>                1.1.1.0/24                                1.1.2.0/24
> -[out router]---------------[eth0  linux router  eth1]-----------[clients]
> 
> 
> I have solved the default speed (only the input for simplicity) of 256Kbit
> like below, but how do I do the shaping exception for some destination
> network 1.1.3.0/24 and 1.1.4.0/24 where I want to allow full speed? Can
> the u32 filter do this, or another class? I don't get all the pieces 
> together yet.

As far as I know it is enough to just define classes and join traffic to them
using u32 filter like that:

# Adding qdisc
tc qdisc add dev eth1 root handle 1: cbq bandwidth 10Mbit cell 8 avpkt 1000 mpu 64

# Define parent class at rate 10Mbit
tc class add dev eth1 parent 1:0 classid 1:1 cbq bandwidth 10Mbit \
rate 10Mbit allot 1514 cell 8 weight 1Mbit prio 8 maxburst 20 avpkt 1000

# Define "slow" class 1:10 at 256Kbit
tc class add dev eth1 parent 1:1 classid 1:10 cbq bandwidth 10Mbit \
rate 256Kbit allot 1514 cell 8 weight 26Kbit prio 5 maxburst 20 avpkt 1000 \
bounded
# Attaching leaf qdisc of type `tbf' to `slow' class 1:10
tc qdisc add dev eth1 parent 1:10 tbf rate 256Kbit buffer 10Kb/8 limit 15Kb

# Define a `fullspeed' class 1:20
tc class add dev eth1 parent 1:1 classid 1:20 cbq bandwidth 10Mbit \
rate 10Mbit allot 1514 cell 8 weight 1Mbit prio 5 maxburst 20 avpkt 1000 \
bounded

# Join traffic destined to 1.1.2.0/24 into `slow' class 1:10
tc filter add dev eth1 parent 1:0 protocol ip prio 100 u32 \
        match ip dst 1.1.2.0/24 \
        flowid 1:10

# Join traffic destined to 1.1.3.0/23 into `fullspeed' class 1:20 
tc filter add dev eth1 parent 1:0 protocol ip prio 100 u32 \
        match ip dst 1.1.3.0/23 \
        flowid 1:20

So, I'm not a `CBQ mentor' and may be this is not the right way but it works
for me ;-) Correct if I'm wrong.

egards

        =- --rw------- =--=--=--=--=--=--=--=--=--=--=--=--=--=
          Theodor Milkov           Administrator IP Networks
          Davidov Electric Ltd.    Phone: +359 (2) 730158
          PGP: http://www.zimage.delbg.com/zimage.pkr
        =--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to