From mboxrd@z Thu Jan 1 00:00:00 1970 From: ddaasd Date: Fri, 22 Jul 2005 12:59:09 +0000 Subject: [LARTC] HTB as a child of another HTB - doesn't work Message-Id: <42E0ED9D.2030400@gmail.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============0667845311==" List-Id: To: lartc@vger.kernel.org --===============0667845311== Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi,
I am new to HTB and in the learning process I want to simulate a slower link on my server to see how qdisc works.
I have a 100Mbit connection.
I want to simulate a 100K connection and to divide traffic between FTP and SMB. (like in HTB user guide).
The problem is that it doesn’t work. I can transfer files with FTP of SAMBA at the wire speed. (Just like when there was no HTB and qdisc). What do I do wrong?

Here is my script:

#!/bin/bash

tc qdisc del dev eth0 root
iptables -F
iptables -F -t mangle

# qdisc for delay simulation
tc qdisc add dev eth0 root handle 100: htb
tc class add dev eth0 parent 100: classid 100:1 htb rate 100kbps

tc qdisc add dev eth0 parent 100:1 handle 1: htb

tc class add dev eth0 parent 1: classid 1:1 htb rate 100kbps
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 50kbps ceil 100kbps prio 1
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 50kbps ceil 100kbps prio 2

tc qdisc add dev eth0 parent 1:10 handle 22: sfq perturb 10
tc qdisc add dev eth0 parent 1:20 handle 23: sfq perturb 10



I've tried with u32 and with fw filter


tc filter add dev eth0 parent 1: protocol ip u32 match ip sport 20 0xffff flowid 1:10
tc filter add dev eth0 parent 1: protocol ip u32 match ip sport 139 0xffff flowid 1:20


OR

iptables -A OUTPUT -o eth0 -t mangle -p tcp --sport 20 -j MARK --set-mark 22
tc filter add dev eth0 parent 1: protocol ip handle 22 fw classid 1:10

iptables -A OUTPUT -o eth0 -t mangle -p tcp --sport 445 -j MARK --set-mark 33
tc filter add dev eth0 parent 1: protocol ip handle 33 fw classid 1:20

Best regards,
ddaas
--===============0667845311== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc --===============0667845311==--