Shaping not working
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.
Quoted 12 lines · Stephan M. Ott
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.
Quoted 1 line
Can someone help me out ? What goes wrong here ?
The iptables and tc numbers are hex, so try 0x8 and 0x128.
iptables -t mangle -A FORWARD -s 192.168.0.51/29 -j MARK --set-mark 0x8 iptables -t mangle -A FORWARD -s 192.168.0.55/29 -j MARK --set-mark 0x128 tc filter add dev $DEV parent 1:0 protocol ip prio 30 handle 0x8 fw flowid 1:30
tc filter add dev $DEV parent 1:0 protocol ip prio 40 handle 0x128 fw flowid 1:40
Stef
Signature · 6 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Try this link, might help:
http://omg.wp.gg/wshaper-howto/
----- Original Message -----
From: Stephan M. Ott
To: [email protected]
Sent: Tuesday, September 28, 2004 8:57 AM
Subject: [LARTC] Shaping not working
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:10tc 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.