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
# # r2q = 3D smallest_rate_you_have / 1500 R2Q=1 tc qdisc del dev eth0 root tc qdisc add dev eth0 root handle 1: htb r2q $R2Q default 12 tc class add dev eth0 parent 1: classid 1:1 htb rate 5kbps ceil 5kbps tc class add dev eth0 parent 1:1 classid 1:10 htb rate 3kbps ceil 5kbps tc class add dev eth0 parent 1:1 classid 1:11 htb rate 2kbps ceil 5kbps tc class add dev eth0 parent 1:1 classid 1:12 htb rate 1kbps ceil 1kbps 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 echo 'Cola:' tc qdisc show dev eth0 echo 'Clases:' tc class show dev eth0 echo 'Filtro:' tc filter show dev eth0 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 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
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án A. Aresca
Rosario - Argetina
|