From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stef Coene Date: Fri, 11 Oct 2002 10:42:47 +0000 Subject: Re: [LARTC] 'sport' is good but 'dport'? Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org On Sunday 13 October 2002 03:20, =B9=DA=C1=A4=C0=BA wrote: > hi all >=20 > I just tried to test whether the HTB works well or not .. (policy is very > simple ^^;;) =20 > I tried HTB simulator 'Ethloop' with lo (loopback ) and I found HTB works > well....(very well) =20 > So I changed lo to eth0 and tested .. >=20 > ./tc qdisc add dev eth0 root handle 1: htb default 10 > ./tc class add dev eth0 parent 1: classid 1:1 htb rate 500kbps ceil > 500kbps ./tc class add dev eth0 parent 1:1 classid 1:2 htb rate 180kbps > ceil 500kbps ./tc class add dev eth0 parent 1:2 classid 1:10 htb rate > 150kbps ceil 500kbps prio 2 ./tc class add dev eth0 parent 1:2 classid 1:= 11 > htb rate 5kbps ceil 10kbps prio 2 ./tc class add dev eth0 parent 1:1 > classid 1:12 htb rate 10kbps ceil 20kbps prio 1 ./tc qdisc add dev eth0 > parent 1:10 handle 20: pfifo limit 5 > ./tc qdisc add dev eth0 parent 1:11 handle 30: pfifo limit 5 > ./tc qdisc add dev eth0 parent 1:12 handle 40: sfq perturb 10 >=20 > ./tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport > 23 0xffff flowid 1:11 ./tc filter add dev eth0 protocol ip parent 1:0 prio > 1 u32 match ip sport 80 0xffff flowid 1:12=20 > It works well with outgoing packets .. =20 >=20 > BUT!! =20 >=20 > I changed last two lines to control Incoming packets .. like below.. > ./tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport > 23 0xfffe flowid 1:11 ./tc filter add dev eth0 protocol ip parent 1:0 prio > 1 u32 match ip dport 80 0xfffe flowid 1:12=20 > It never works .. !! If I send to 23 port 50kbps It receive 50kbps.. I > have no idea .. =20 =20 > Did I thought wrong? =20 Yes :) You can only shape outgoing packets. If you want to shape incoming packets= ,=20 you can use policers or the imq device. =20 Stef --=20 stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/