From mboxrd@z Thu Jan 1 00:00:00 1970 From: mdew Date: Thu, 13 Jun 2002 05:06:49 +0000 Subject: Re: [LARTC] limiting to a port MIME-Version: 1 Content-Type: multipart/mixed; boundary="=-1Uru+hEgIczm84iYatiW" Message-Id: List-Id: References: In-Reply-To: To: lartc@vger.kernel.org --=-1Uru+hEgIczm84iYatiW Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2002-06-12 at 21:07, Stef Coene wrote: > On Wednesday 12 June 2002 05:05, mdew wrote: > > one user is utilising to much :80 traffic, how would i limit traffic? > > > > Our current bandwidth is 256Kb, i would like to shape the user down > > 64Kb. > You have to attach a htb or cbq qdisc. Create a class with limited bandi= wdth=20 > and redirect all traffic to port 80 to that class with a filter. >=20 > See the lartc howto and/or www.docum.org for more info. from an example off the website, ive change a couple of values... what do i need to start limiting to *only* port 80 #!/bin/sh RATE_TOT=3D256kbps RATE1=3D128kbps IP=3D210.54.175.12 DEV=3D"dev eth0" OPTION=3D"allot 1514 maxburst 20 avpkt 1000" tc qdisc del $DEV root tc qdisc add $DEV root handle 10: cbq bandwidth 10mbit avpkt 1000 tc class add $DEV parent 10:0 classid 10:1 cbq bandwidth 10mbit rate $RATE_TOT $OPTION prio 3 isolated tc class add $DEV parent 10:1 classid 10:10 cbq bandwidth 10mbit rate $RATE1 $OPTION prio 3 bounded tc filter add $DEV parent 10: protocol ip prio 3 handle 1 fw classid 10:1 tc filter add $DEV parent 10:1 protocol ip prio 3 handle 1 fw classid 10:10 iptables -F iptables -X iptables -N acc_0 iptables -N acc_1 iptables -A OUTPUT -t mangle -p tcp --dport 2000 -d $IP -j MARK --set-mark 1 iptables -A OUTPUT -p tcp --dport 2000 -d $IP -j acc_0 --=20 ph33r! Linux mdew 2.4.18-xfs #2 Fri Apr 26 15:09:11 NZST 2002 i686 unknown GPG Key: http://mdew.orcon.net.nz/gpg --=-1Uru+hEgIczm84iYatiW Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQA9CChpH5J/xul0J+4RAs54AJ9++SJJj8n4iIT344OwtPmXhOH0UQCeOCsd 5xzXGzSTpKeXvegP7m/Sy3w= =cQe9 -----END PGP SIGNATURE----- --=-1Uru+hEgIczm84iYatiW-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/