Skip to contentSkip to conversation

double rule

LARTC Petre Bandac 2 participants 2 messages Aug 13, 2002

lore
Share & tools
lore
#0 lore raw

I want to shape the traffic on the http port and further on shape it if the destination ip is on some network I specify

however, only the first rule is applied ... why ?

#http
$filtru prio 1 u32 match ip sport 80 0xffff flowid 1:11 #droop :-)

$filtru prio 1 u32 match ip src x.x.x.x  \
                match ip dst x.x.x.0/24 flowid 1:13

where classes are defined earlier as

$tc class add dev eth0 parent 1:1 classid 1:10 \
htb rate 32kbit ceil 32kbit

$tc class add dev eth0 parent 1:1 classid 1:11 \
htb rate 64kbit ceil 64kbit

$tc class add dev eth0 parent 1:1 classid 1:12 \
htb rate 128kbit ceil 160kbit

$tc class add dev eth0 parent 1:1 classid 1:13 \
htb rate 100kbit ceil 100kbit

and

filtru="$tc filter add dev eth0 protocol ip \

                parent 1:0"

thanks in advance,

petre

Signature · 4 lines
  6:39pm  up  6:21,  1 user,  load average: 0.06, 0.10, 0.06
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#1 lore raw
Quoted 4 lines · Petre Bandac

I want to shape the traffic on the http port and further on shape it if the destination ip is on some network I specify

however, only the first rule is applied ... why ?

Because you add both rules to the same parent. When one rule is matched, the packet is put in the destination class and the other rule is never matched. Atach the second rule to class 1:11 with option "parent 1:11" and it should work.

Stef

Quoted 29 lines

#http
$filtru prio 1 u32 match ip sport 80 0xffff flowid 1:11 #droop :-)

$filtru prio 1 u32 match ip src x.x.x.x  \
                match ip dst x.x.x.0/24 flowid 1:13

where classes are defined earlier as

$tc class add dev eth0 parent 1:1 classid 1:10 \
htb rate 32kbit ceil 32kbit

$tc class add dev eth0 parent 1:1 classid 1:11 \
htb rate 64kbit ceil 64kbit

$tc class add dev eth0 parent 1:1 classid 1:12 \
htb rate 128kbit ceil 160kbit

$tc class add dev eth0 parent 1:1 classid 1:13 \
htb rate 100kbit ceil 100kbit

and

filtru="$tc filter add dev eth0 protocol ip \

                parent 1:0"

thanks in advance,

petre

Signature · 7 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/