Skip to contentSkip to conversation

Question on FW and htb

LARTC Cheng Kwok Wing, William 2 participants 2 messages Aug 5, 2002

lore
Share & tools
lore
#0 lore raw

Hi,

I've try to use htb to limit outgoing traffic but it seems that it doesn't work. I guess the probem is the filter. Here is my script.

#!/bin/sh
echo "Add root qdisc, default traffic go to 1:30" tc qdisc add dev eth1 root handle 1: htb default 30 tc class add dev eth1 parent 1: classid 1:1 htb rate 100mbit burst 15k

tc class add dev eth1 parent 1:1 classid 1:10 htb rate 2mbit ceil 2.5mbit burst 1m
tc class add dev eth1 parent 1:1 classid 1:20 htb rate 1mbit ceil 1.5mbit burst 1m

echo "SFQ for leaf"
tc qdisc add dev eth1 parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev eth1 parent 1:20 handle 20: sfq perturb 10

echo "Add the filters which direct traffic to the right classes:"
tc filter add dev eth1 parent 1:0 protocol ip prio 3 handle 1 fw classid 1:10
tc filter add dev eth1 parent 1:0 protocol ip prio 3 handle 2 fw classid 1:20

tc filter add dev eth1 parent 1:1 protocol ip prio 3 handle 1 fw classid 1:10
tc filter add dev eth1 parent 1:1 protocol ip prio 3 handle 2 fw classid 1:20

When I use the command "tc -s -d qdisc" to show all qdisc, it seems that nothing pass through SFQ.

[root@localhost tc]# tc -s -d qdisc
qdisc sfq 20: dev eth1 quantum 1514b limit 128p flows 128/1024 perturb 10sec
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)

qdisc sfq 10: dev eth1 quantum 1514b limit 128p flows 128/1024 perturb 10sec
Sent 0 bytes 0 pkts (dropped 0, overlimits 0)

qdisc htb 1: dev eth1 r2q 10 default 30 dcache 0 deq_util 1/1000000 deq_rate 77 trials_per_deq 0 dcache_hits 0 direct_packets 12786
Sent 18636370 bytes 12786 pkts (dropped 0, overlimits
0)

What's the problem?? I'm pretty sure I've mark the packet correctly as shown below:

[root@localhost tc]# iptables -L -n -v -t mangle Chain PREROUTING (policy ACCEPT 489K packets, 285M bytes)
pkts bytes target prot opt in out source
destination
3799 454K MARK all -- * *
0.0.0.0/0 10.0.0.0/8 MARK set 0x1
190K 12M MARK all -- * *
10.0.0.0/8 0.0.0.0/0 MARK set 0x1
0 0 MARK all -- * *
0.0.0.0/0 192.168.1.224/29 MARK set 0x2
0 0 MARK all -- * *
192.168.1.224/29 0.0.0.0/0 MARK set 0x2

Please help.
Thanks,
William

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#1 lore raw

On Monday 05 August 2002 05:28, Cheng Kwok Wing, William wrote:
What shows
tc -s -d class show dev eth

Quoted 11 lines

echo "Add the filters which direct traffic to the right classes:"
tc filter add dev eth1 parent 1:0 protocol ip prio 3 handle 1 fw classid 1:10
tc filter add dev eth1 parent 1:0 protocol ip prio 3 handle 2 fw classid 1:20

tc filter add dev eth1 parent 1:1 protocol ip prio 3 handle 1 fw classid 1:10
tc filter add dev eth1 parent 1:1 protocol ip prio 3 handle 2 fw classid 1:20

Why do you attach these filters to 1:1 ??

Stef

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/