From: "James Ma" Date: Thu, 05 Dec 2002 22:36:03 +0000 Subject: [LARTC] questions with Stef's scripts MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0050_01C29C84.C8D95E60" Message-Id: List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. ------=_NextPart_000_0050_01C29C84.C8D95E60 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, Stef, I have some questions with your following scripts on www.docum.org,=20 BW1=3D$1'kbps' BW2=3D`expr 100 - $1` BW2=3D$BW2'kbps' tc qdisc del dev eth0 root handle 1: tc qdisc add dev eth0 root handle 1: htb default 12 tc class add dev eth0 parent 1: classid 1:1 htb rate 100kbps ceil = 100kbps burst 2k tc class add dev eth0 parent 1:1 classid 1:10 htb rate $BW1 ceil 100kbps = burst 2k tc class add dev eth0 parent 1:1 classid 1:11 htb rate $BW2 ceil 100kbps = burst 2k tc filter add dev eth0 parent 1: protocol ip prio 3 handle 1 fw classid = 10:10 tc filter add dev eth0 parent 1: protocol ip prio 3 handle 2 fw classid = 10:11 iptables -F iptables -X iptables -N acc_0 iptables -N acc_1 iptables -A OUTPUT -t mangle -p tcp --dport 2000 -j MARK --set-mark 1 iptables -A OUTPUT -t mangle -p tcp --dport 2001 -j MARK --set-mark 2 iptables -A OUTPUT -p tcp --dport 2000 -j acc_0 iptables -A OUTPUT -p tcp --dport 2001 -j acc_1 =09 My questions are as follow, 1.Why the classid in tc filter are "10:10 and 10:11" instead of "1:10 = and 1:11"? How can=20 you associate the filters with the classes you defined before? 2.What does "fw" before "classid" in tc filter mean? Does it refer to = forward chain? 3.I guess the "handle 1" in tc filter refer to "mark1" in iptables, am I = right? But is=20 there any sequence problem to define handle 1 first and mark1 later in = the scripts? 4.Where can I find procedure on how to install HTB and compile kernel to = use it? Your answer will be much appreciated, Regards, =20 James =20 ------=_NextPart_000_0050_01C29C84.C8D95E60 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi, Stef,
 
I have some questions with your = following=20 scripts on www.docum.org, 
 
BW1=3D$1'kbps'
BW2=3D`expr 100 - $1`
BW2=3D$BW2'kbps'

tc qdisc del dev eth0 root handle 1:

tc qdisc add dev eth0 root handle 1: htb default 12
tc class add dev eth0 parent 1: classid 1:1 htb rate 100kbps ceil =
100kbps burst 2k
tc class add dev eth0 parent 1:1 classid 1:10 htb rate $BW1 ceil 100kbps =
burst 2k
tc class add dev eth0 parent 1:1 classid 1:11 htb rate $BW2 ceil 100kbps =
burst 2k

tc filter add dev eth0 parent 1: protocol ip prio 3 handle 1 fw classid =
10:10
tc filter add dev eth0 parent 1: protocol ip prio 3 handle 2 fw classid =
10:11

iptables -F
iptables -X
iptables -N acc_0
iptables -N acc_1
iptables -A OUTPUT -t mangle -p tcp --dport 2000 -j MARK --set-mark 1
iptables -A OUTPUT -t mangle -p tcp --dport 2001 -j MARK --set-mark 2
iptables -A OUTPUT -p tcp --dport 2000 -j acc_0
iptables -A OUTPUT -p tcp --dport 2001 -j acc_1
	
My questions are as follow,
1.Why the classid in tc filter are "10:10 and 10:11" =
instead of "1:10 and 1:11"? How can 
you =
associate the filters with the classes you defined before?
2.What does "fw" before "classid" in tc filter mean? Does =
it refer to forward chain?
3.I guess the =
"handle 1" in tc filter refer to "mark1" in iptables, am I right? But is =
there any sequence problem to define handle 1 =
first and mark1 later in the scripts?
4.Where =
can I find procedure on how to install HTB and compile kernel to use =
it?
 
Your answer =
will be much appreciated,
 
 
Regards,
 
James
 
------=_NextPart_000_0050_01C29C84.C8D95E60-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/