htb.init issues

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!
Here's what I want:

root class 0010
 premium parent class 1000
   premium child classes 1xyz
 best-effort parent class 2000
  best-effort child classes 2xyz
 default class 3000

Here's how I do it:

eth1:
DEFAULT=3000

eth1-0010.root:
RATE=100Mbit
LEAF=sfq

eth1-0010:1000.premium
CEIL=352Kbit
RATE=352Kbit
PRIO=2
LEAF=sfq

eth1-0010:1000:1xyx.child1
CEIL=32Kbit
RATE=8Kbit
PRIO=3
LEAF=sfq
RULE=<public ip>,

eth1-0010:2000.best-effort
CEIL=500Kbit
RATE=500Kbit
PRIO=3
LEAF=sfq

eth1-0010:2000:2xyz.child1
CEIL=16Kbit
RATE=8Kbit
PRIO=2
LEAF=sfq
RULE=<public ip>,

eth1-0010:3000.default
RATE=2Kbit
PRIO=7

An output from tc commands generated by the script:

/sbin/tc qdisc del dev eth0 root
/sbin/tc qdisc add dev eth0 root handle 1 htb default 3000

/sbin/tc class add dev eth0 parent 1:0010 classid 1:1000 htb rate 352Kbit ceil 
352Kbit prio 2
/sbin/tc qdisc add dev eth0 parent 1:1000 handle 1000 sfq perturb 10

/sbin/tc class add dev eth0 parent 1:1000 classid 1:1001 htb rate 32Kbit ceil 
64Kbit prio 2
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip dst 
<public ip1>/32 classid 1:1001
sbin/tc class add dev eth0 parent 1:1000 classid 1:1002 htb rate 32Kbit ceil 
64Kbit prio 2
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip dst 
<public ip2>/32 classid 1:1002


/sbin/tc class add dev eth0 parent 1:0010 classid 1:2000 htb rate 500Kbit ceil 
500Kbit prio 3
/sbin/tc qdisc add dev eth0 parent 1:2000 handle 2000 sfq perturb 10

/sbin/tc class add dev eth0 parent 1:2000 classid 1:2001 htb rate 8Kbit ceil 
32Kbit prio 3
/sbin/tc qdisc add dev eth0 parent 1:2001 handle 2001 sfq perturb 10
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip dst 
<public ip1>/32 classid 1:2001
/sbin/tc class add dev eth0 parent 1:2000 classid 1:2002 htb rate 8Kbit ceil 
32Kbit prio 3
/sbin/tc qdisc add dev eth0 parent 1:2002 handle 2002 sfq perturb 10
/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip dst 
<public ip2>/32 classid 1:2002

/sbin/tc class add dev eth0 parent 1:0010 classid 1:3000 htb rate 2Kbit prio 7
/sbin/tc qdisc add dev eth0 parent 1:3000 handle 3000 sfq perturb 10

The problem is that all traffic goes to default class and I
can't figure out why. It seems like u32 doesn't match the ip addresses I 
configured...
I use Debian Testing,  with required modules sch_* compiled in kernel (2.6.9).

10x

p.s. I'm a tc newbie...
-- 
+ Lorin
+ I tought I taw a putty cat...I did! I did taw a putty cat!
+ http://si-bemol.ro
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux