From: "Stephan M. Ott" Date: Tue, 28 Sep 2004 06:57:04 +0000 Subject: [LARTC] Shaping not working Message-Id: <008801c4a528$6f39f280$3700a8c0@nathanxp> MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0089_01C4A539.32C2C280" List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. ------=_NextPart_000_0089_01C4A539.32C2C280 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Hi folks, I'm trying to shape two clients in my LAN when accessing the internet. Actual situation is that EVERY traffic goes into 1:40, so the client which should fall into 1:30 does not get the lower uplink it should have, but the uplink defined for the client defined as 1:30 When I disable the definition of 1:40, every traffic falls into 1:30 (except for the traffic defined to be in 1:10 and 1:20, this works) As I'm somewhat new to this, I'm stuck and don't know what I have to change in order to make it work. Here's part of the script: tc qdisc del dev $DEV root 2> /dev/null > /dev/null tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null iptables -t mangle -A FORWARD -s 192.168.0.51/29 -j MARK --set-mark 8 iptables -t mangle -A FORWARD -s 192.168.0.55/29 -j MARK --set-mark 128 ###### uplink tc qdisc add dev $DEV root handle 1: htb default 20 tc class add dev $DEV parent 1: classid 1:1 htb rate ${UPLINK}kbit burst 6k tc class add dev $DEV parent 1:1 classid 1:10 htb rate ${UPLINK}kbit \ burst 6k prio 1 tc class add dev $DEV parent 1:1 classid 1:20 htb rate $[9*$UPLINK/10]kbit \ burst 6k prio 2 tc class add dev $DEV parent 1:1 classid 1:30 htb rate 64kbit burst 6k prio 3 tc class add dev $DEV parent 1:1 classid 1:40 htb rate 128kbit burst 6k prio 4 tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10 tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10 tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10 tc qdisc add dev $DEV parent 1:40 handle 40: sfq perturb 10 tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \ match ip tos 0x10 0xff flowid 1:10 tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \ match ip protocol 1 0xff flowid 1:10 tc filter add dev $DEV parent 1: protocol ip prio 10 u32 \ match ip protocol 6 0xff \ match u8 0x05 0x0f at 0 \ match u16 0x0000 0xffc0 at 2 \ match u8 0x10 0xff at 33 \ flowid 1:10 tc filter add dev $DEV parent 1:0 protocol ip prio 30 handle 8 fw flowid 1:30 tc filter add dev $DEV parent 1:0 protocol ip prio 40 handle 128 fw flowid 1:40 Can someone help me out ? What goes wrong here ? Thanks in advance. Stephan. ------=_NextPart_000_0089_01C4A539.32C2C280 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Hi = folks,

 

I’m trying to = shape two clients in my LAN when accessing the = internet.

Actual situation is = that EVERY traffic goes into 1:40, so the client which should fall into = 1:30 does not get the lower uplink it should have, = but the uplink defined for the client defined as 1:30<= font size=3D2 face=3DArial>

When I disable the = definition of 1:40= , every traffic = falls into 1:30 (except for the traffic defined to be in = 1:10 and 1:20, this works)

As I’m somewhat = new to this, I’m stuck and don’t know what I have to change in = order to make it work.

 

Here’s part of = the script:

 

tc qdisc = del dev $DEV root    2> /dev/null = > /dev/null

tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null

 

iptables -t mangle -A FORWARD -s 192.168.0.51/29 -j MARK --set-mark = 8

iptables -t mangle -A FORWARD -s 192.168.0.55/29 -j MARK --set-mark 128

 

###### uplink

 

tc qdisc add dev $DEV root handle 1: = htb default 20

 

tc class add dev $DEV parent 1: classid = 1:1 htb rate ${UPLINK}kbit = burst 6k

 

tc class add dev $DEV parent 1:1 classid 1:10 htb = rate ${UPLINK}kbit \

   burst 6k prio 1

 

tc class add dev $DEV parent 1:1 classid 1:20 htb = rate $[9*$UPLINK/10]kbit = \

   burst 6k prio 2

 

tc class add dev $DEV parent 1:1 classid 1:30 htb = rate 64kbit burst 6k prio = 3

tc class add dev $DEV parent 1:1 classid 1:40 htb = rate 128kbit burst 6k prio = 4

 

tc qdisc add dev $DEV parent = 1:10 handle 10: sfq perturb 10

tc qdisc add dev $DEV parent = 1:20 handle 20: sfq perturb 10

 

tc qdisc add dev $DEV parent = 1:30 handle 30: sfq perturb 10

tc qdisc add dev $DEV parent = 1:40 handle 40: sfq perturb 10

 

tc filter add dev $DEV parent 1:0 = protocol ip prio 10 u32 \

      = match ip = tos 0x10 0xff  flowid 1:10

 

tc filter add dev $DEV parent 1:0 = protocol ip prio 10 u32 \

        = match ip = protocol 1 0xff flowid = 1:10

 

tc filter add dev $DEV parent 1: = protocol ip prio 10 u32 \

   match ip protocol 6 0xff = \

   match u8 0x05 0x0f at 0 \

   match u16 0x0000 0xffc0 at 2 \

   match u8 0x10 0xff at 33 \

   flowid 1:10

 

tc filter add dev $DEV parent 1:0 protocol ip prio 30 handle 8 fw = flowid 1:30

tc filter add dev $DEV parent 1:0 protocol ip prio 40 handle 128 fw = flowid 1:40

 

 

Can someone help me = out ? What goes wrong here = ?

Thanks in = advance.

 

Stephan.

 

------=_NextPart_000_0089_01C4A539.32C2C280-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/