From: =?iso-8859-1?Q?Sebasti=E1n_Aresca?= Date: Fri, 09 May 2003 06:50:57 +0000 Subject: [LARTC] tc filter not responding MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0012_01C315DE.32A7B300" Message-Id: List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. ------=_NextPart_000_0012_01C315DE.32A7B300 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Im new in HTB, i use CBQ. But reading i decided to change to HTB. Well this my scrip to test it (i get it from HTB user guide) Here the problems is all my traffic is going trought 1:12 (default) (see = that ceil is 1kbps for this class and my download ratio is 1kbps) -------------------------------------------------------------------------= -------------------------------------------------------------------------= ---------------------------- #! /bin/sh = =20 # = =20 = =20 # r2q =3D 3D smallest_rate_you_have / 1500 = =20 = =20 R2Q=3D1 = =20 = =20 tc qdisc del dev eth0 root = =20 tc qdisc add dev eth0 root handle 1: htb r2q $R2Q default 12 = =20 = =20 tc class add dev eth0 parent 1: classid 1:1 htb rate 5kbps ceil 5kbps = =20 tc class add dev eth0 parent 1:1 classid 1:10 htb rate 3kbps ceil 5kbps = =20 tc class add dev eth0 parent 1:1 classid 1:11 htb rate 2kbps ceil 5kbps = =20 tc class add dev eth0 parent 1:1 classid 1:12 htb rate 1kbps ceil 1kbps = =20 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src = 192.168.0.4 ip dport 80 0xffff flowid 1:10 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src = 192.168.0.4 match ip dport 21 0xffff flowid 1:11 =20 echo 'Cola:' =20 tc qdisc show dev eth0 =20 echo 'Clases:' =20 tc class show dev eth0 =20 echo 'Filtro:' =20 tc filter show dev eth0 =20 -------------------------------------------------------------------------= -------------------------------------------------------------------------= ---------------------------- I probe without the port 80 but still going trought 1:12 tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src = 192.168.0.4 flowid 1:10 Here is other config that a try, like i do with CBQ using mark with = iptables: -------------------------------------------------------------------------= -------------------------------------------------------------------------= ---------------------------- iptables -t mangle -F = =20 iptables -t mangle -A POSTROUTING -p tcp -s 192.168.0.4 -d ! = 192.168.0.0/24 --dport 80 -j MARK --set-mark 80 iptables -t mangle -A POSTROUTING -p tcp -s 192.168.0.4 -d ! = 192.168.0.0/24 --dport 21 -j MARK --set-mark 21 tc filter add dev eth0 parent 1:0 protocol ip handle 80 fw flowid 1:10 tc filter add dev eth0 parent 1:0 protocol ip handle 21 fw flowid 1:11 -------------------------------------------------------------------------= -------------------------------------------------------------------------= ---------------------------- But well, it didn't work too. Well i will searching in FAQ or mailing list. Thanks in advantage. Sebasti=E1n A. Aresca Rosario - Argetina ------=_NextPart_000_0012_01C315DE.32A7B300 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Im new in HTB, i use CBQ. But reading i = decided to=20 change to HTB.
Well this my scrip to test it (i = get it from=20 HTB user guide)
 
Here the problems is all my = traffic is going=20 trought 1:12 (default) (see that ceil is 1kbps for this class and my = download=20 ratio is 1kbps)
----------------------------------------------------------------= -------------------------------------------------------------------------= -------------------------------------
#!=20 /bin/sh           =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;        =20
#           &n= bsp;           &nb= sp;           &nbs= p;            = ;            =             &= nbsp;    =20
           &nb= sp;           &nbs= p;            = ;            =             &= nbsp;           &n= bsp;     =20
# r2q =3D 3D smallest_rate_you_have /=20 1500           &nb= sp;           &nbs= p;            = ;  =20
           &nb= sp;           &nbs= p;            = ;            =             &= nbsp;           &n= bsp;     =20
R2Q=3D1          &n= bsp;           &nb= sp;           &nbs= p;            = ;            =             &= nbsp; =20
           &nb= sp;           &nbs= p;            = ;            =             &= nbsp;           &n= bsp;     =20
tc qdisc del dev eth0=20 root           &nb= sp;           &nbs= p;            = ;            =     =20
tc qdisc add dev eth0 root handle 1: htb r2q $R2Q default=20 12            = ;      =20
           &nb= sp;           &nbs= p;            = ;            =             &= nbsp;           &n= bsp;     =20
tc class add dev eth0 parent 1: classid 1:1 htb rate 5kbps ceil=20 5kbps         
tc class = add dev=20 eth0 parent 1:1 classid 1:10 htb rate 3kbps ceil=20 5kbps       
tc class add dev = eth0 parent=20 1:1 classid 1:11 htb rate 2kbps ceil=20 5kbps       
tc class add dev = eth0 parent=20 1:1 classid 1:12 htb rate 1kbps ceil=20 1kbps        
tc filter add dev eth0 protocol ip = parent 1:0 prio=20 1 u32 match ip src 192.168.0.4 ip dport 80 0xffff flowid 1:10
tc = filter=20 add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src 192.168.0.4 = match ip=20 dport 21 0xffff flowid 1:11
          &nbs= p;            = ;            =             &= nbsp;           &n= bsp;       =20
echo=20 'Cola:'           =             &= nbsp;           &n= bsp;           &nb= sp;       =20
tc qdisc show dev=20 eth0           &nb= sp;           &nbs= p;            = ;         =20
echo=20 'Clases:'          &nbs= p;            = ;            =             &= nbsp;     =20
tc class show dev=20 eth0           &nb= sp;           &nbs= p;            = ;         =20
echo=20 'Filtro:'          &nbs= p;            = ;            =             &= nbsp;     =20
tc filter show dev=20 eth0           &nb= sp;           &nbs= p;            = ;        =20
---------------------------------------------------------------------= -------------------------------------------------------------------------= --------------------------------
 
I probe without the port 80 but still = going trought=20 1:12
 
tc filter add dev eth0 protocol ip = parent 1:0 prio=20 1 u32 match ip src 192.168.0.4 flowid 1:10
 
 
Here is other config that a try, like i = do with CBQ=20 using mark with iptables:
----------------------------------------------------------------= -------------------------------------------------------------------------= -------------------------------------
iptables -t mangle=20 -F            = ;            =             &= nbsp;           &n= bsp;        =20
iptables -t mangle -A POSTROUTING -p tcp -s 192.168.0.4 -d ! = 192.168.0.0/24=20 --dport 80 -j MARK --set-mark 80
iptables -t mangle -A POSTROUTING -p = tcp -s=20 192.168.0.4 -d ! 192.168.0.0/24 --dport 21 -j MARK --set-mark = 21
 
tc filter add dev eth0 parent 1:0 = protocol ip=20 handle 80 fw flowid 1:10
tc filter add dev eth0 parent 1:0 = protocol ip=20 handle 21 fw flowid 1:11
----------------------------------------------------------------= -------------------------------------------------------------------------= -------------------------------------
 
But well, it didn't work = too.
 

Well i will searching in FAQ or mailing list.
 
Thanks in advantage.
 
Sebasti=E1n A. Aresca
 Rosario - Argetina
------=_NextPart_000_0012_01C315DE.32A7B300-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/