<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>Hi all.<BR>
<BR>
I've written a small htb script that uses U32 and FW (marked by IPTABLES) filters, but TC doesn't seem to be using the "cls_fw.o" module !!!<BR>
<BR>
I'm using redhat v9.0, kernel 2.4.8-20, iproute 2.4.7-7.<BR>
<BR>
Here is my script:<BR>
==========================================================<BR><FONT size=2>
#####################<BR>
#Interface definition<BR>
#####################<BR>
#interface="ppp0"<BR>
interface="eth0"<BR>
<BR>
#####################<BR>
#Addresses definition<BR>
#####################<BR>
ip_src="192.168.1.240"<BR>
#ip_src2="225.0.7.110"<BR>
<BR>
#########################################<BR>
#Delete any previous stored configuration<BR>
#########################################<BR>
tc qdisc del dev $interface root<BR>
<BR>
########################################<BR>
#Creating the root Qdisc (Queueing Disk)<BR>
########################################<BR>
tc qdisc add dev $interface root handle 1: htb default 14<BR>
<BR>
######################<BR>
#Definition of classes<BR>
######################<BR>
tc class add dev $interface parent 1: classid 1:1 htb rate 28800bps ceil 28800bps<BR>
tc class add dev $interface parent 1:1 classid 1:10 htb rate 1bps ceil 1bps prio 4<BR>
tc class add dev $interface parent 1:1 classid 1:11 htb rate 1bps ceil 28800bps prio 2<BR>
tc class add dev $interface parent 1:1 classid 1:12 htb rate 1bps ceil 28800bps prio 4<BR>
tc class add dev $interface parent 1:1 classid 1:13 htb rate 1bps ceil 28800bps prio 4<BR>
tc class add dev $interface parent 1:1 classid 1:14 htb rate 2000bps ceil 3000bps prio 2<BR>
<BR>
##########################<BR>
#Definition of the filters<BR>
##########################<BR>
tc filter add dev $interface protocol ip parent 1:0 prio 1 u32 match ip src $ip_src match ip dport 20000 0xffff flowid 1:10<BR>
tc filter add dev $interface protocol ip parent 1:0 prio 1 u32 match ip src $ip_src match ip dport 20001 0xffff flowid 1:11<BR>
tc filter add dev $interface protocol ip parent 1:0 prio 1 u32 match ip src $ip_src match ip dport 20002 0xffff flowid 1:12<BR>
tc filter add dev $interface protocol ip parent 1:0 prio 1 u32 match ip src $ip_src match ip dport 20003 0xffff flowid 1:13<BR>
tc filter add dev $interface parent 1:0 protocol ip prio 1 handle 7 fw flowid 1:14<BR>
<BR>
tc qdisc add dev $interface parent 1:10 handle 20: pfifo limit 5 <BR>
tc qdisc add dev $interface parent 1:11 handle 30: pfifo limit 5<BR>
tc qdisc add dev $interface parent 1:12 handle 40: sfq perturb 10<BR>
tc qdisc add dev $interface parent 1:13 handle 50: sfq perturb 10<BR>
tc qdisc add dev $interface parent 1:14 handle 50: sfq perturb 10<BR>
</FONT>===========================================================<BR>
<BR>
After executing this script I get the following modules loaded in memory:<BR>
===========================================================<BR>
<FONT size=2>Module Size Used by Tainted: PF <BR>
sch_sfq 4096 2 (autoclean)<BR>
cls_u32 6300 1 (autoclean)<BR>
sch_htb 22016 1 (autoclean)<BR></FONT>
===========================================================<BR>
<BR>
After that I manually load (insmod) the FW module and executed that script again, but it kept showing that It is still unused/unloaded !!!<BR>
===========================================================<BR>
<FONT size=2>Module Size Used by Tainted: PF <BR>
cls_fw 3512 0 (unused)<BR>
sch_sfq 4096 2 (autoclean)<BR>
cls_u32 6300 1 (autoclean)<BR>
sch_htb 22016 1 (autoclean)<BR></FONT>
===========================================================<BR>
<BR>
Also if I try to see the actual loaded filters by TC I get this:<BR>
===========================================================<BR><FONT size=2>
filter parent 1: protocol ip pref 1 u32 <BR>
filter parent 1: protocol ip pref 1 u32 fh 800: ht divisor 1 <BR>
filter parent 1: protocol ip pref 1 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10 <BR>
match c0a801f0/ffffffff at 12<BR>
match 00004e20/0000ffff at 20<BR>
filter parent 1: protocol ip pref 1 u32 fh 800::801 order 2049 key ht 800 bkt 0 flowid 1:11 <BR>
match c0a801f0/ffffffff at 12<BR>
match 00004e21/0000ffff at 20<BR>
filter parent 1: protocol ip pref 1 u32 fh 800::802 order 2050 key ht 800 bkt 0 flowid 1:12 <BR>
match c0a801f0/ffffffff at 12<BR>
match 00004e22/0000ffff at 20<BR>
filter parent 1: protocol ip pref 1 u32 fh 800::803 order 2051 key ht 800 bkt 0 flowid 1:13 <BR>
match c0a801f0/ffffffff at 12<BR>
match 00004e23/0000ffff at 20<BR></FONT>
===========================================================<BR>
<BR>
<BR>
So I'm to assume that the filter FW (flowid 1:14) isn't being loaded ?<BR>
<BR>
I cannot increase the kernel version number due to be using a binary driver from a mpeg4 capture board.<BR>
<BR>
Can someone please help ?<BR>
<BR>
Thanks in advance.<BR>
<BR>
Best regards,<BR>
Paulo<BR>
<BR>
<BR>
<BR><br /><hr />Com conversas em vídeo tem já hoje um bocadinho de futuro. <a href='http://get.live.com/pt-pt/messenger/overview' target='_new'>Clique aui!</a></body>
</html>