From mboxrd@z Thu Jan 1 00:00:00 1970 From: "MCraciun" Date: Tue, 04 Nov 2003 19:54:25 +0000 Subject: [LARTC] Port limiting on forward Message-Id: <3FA803F1.00000C.00972@VARZOSU> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------Boundary-00=_PAFU7TH0000000000000" List-Id: To: lartc@vger.kernel.org --------------Boundary-00=_PAFU7TH0000000000000 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I heard that matching ports with mangle and shape with CBQ or HTB will co= st me some resources so i want to limit that way :=0D =0D 1. On forward I want to limit a port range like 0 to 79 at 8kbps .And aft= er that i want to be able to add lines with other port range , also at 8k= bps, but only on forward .Today i had just started to use BBQ and HTB --------------Boundary-00=_PAFU7TH0000000000000 Content-Type: Text/HTML; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I heard that matching ports with mangle and shape with CBQ or HTB&nb= sp;will cost me some resources so i want to limit that way :
 
1. On forward I want to limit a port range like 0 to 79 at 8kbps&nbs= p;.And after that i want to be able to add lines with other port range , = also at 8kbps, but only on forward .Today i had just started to use BBQ a= nd HTB
--------------Boundary-00=_PAFU7TH0000000000000-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: "MCraciun" Date: Tue, 04 Nov 2003 21:01:38 +0000 Subject: Re: [LARTC] Port limiting on forward Message-Id: <3FA813B2.000007.00348@VARZOSU> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------Boundary-00=_QEIUWCW0000000000000" List-Id: References: <3FA803F1.00000C.00972@VARZOSU> In-Reply-To: <3FA803F1.00000C.00972@VARZOSU> To: lartc@vger.kernel.org --------------Boundary-00=_QEIUWCW0000000000000 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have 40 Users on P2 200 MMX 32 RAM .=0D So i know how to match packets .=0D iptables -t mangle -N MYSHAPER-OUT=0D iptables -t mangle -I POSTROUTING -o $DEV -j MYSHAPER-OUT=0D =0D =0D =0D iptables -t mangle -A MYSHAPER-OUT -s! 192.168.0.5 -p tcp --dport 0:1024 = -j MARK --set-mark 23=0D =0D iptables -t mangle -A MYSHAPER-OUT -p tcp --dport 6660:65000 -j MARK --set-mark 24=0D =0D How do i shape mark 23 at 1 KB/s and mark 24 at 1 MB/s ?=0D =0D =20 --------------Boundary-00=_QEIUWCW0000000000000 Content-Type: Text/HTML; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I have 40 Users on P2 200 MMX 32 RAM .
So i know how to match packets .
iptables -t mangle -N MYSHAPER-OUT
iptables -t mangle -I POSTROUTING -o $DEV -j MYSHAPER-OUT
 
 
 
iptables -t mangle -A MYSHAPER-OUT -s! 192.168.0.5 -p tcp = --dport 0:1024 -j MARK --set-mark 23
 
iptables -t mangle -A MYSHAPER-OUT -p tcp --dport 6660:65000 -j MARK= --set-mark 24
 
How do i shape mark 23 at 1 KB/s and mark 24 at 1 MB/s ?
 
           &n= bsp;           &nb= sp;           &nbs= p;    
 
 
--------------Boundary-00=_QEIUWCW0000000000000-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Roy" Date: Sun, 04 Jan 2004 20:44:37 +0000 Subject: Re: [LARTC] Port limiting on forward Message-Id: <007601c3d303$91762eb0$030aa8c0@t> List-Id: References: <3FA803F1.00000C.00972@VARZOSU> In-Reply-To: <3FA803F1.00000C.00972@VARZOSU> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org I heard that matching ports with mangle and shape with CBQ or HTB will cost me some resources so i want to limit that way : 1. On forward I want to limit a port range like 0 to 79 at 8kbps .And after that i want to be able to add lines with other port range , also at 8kbps, but only on forward .Today i had just started to use BBQ and HTB are you so low on resources? or yo want to manage 10000 users? the simple way to do everything that is to mark packets with iptables there is no other way to match port range. also you can know if pcket is forwarded of not by marking it with iptables or by source ip. And how do you use cbq and htb at once? _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Roy" Date: Sun, 04 Jan 2004 22:06:24 +0000 Subject: Re: [LARTC] Port limiting on forward Message-Id: <009e01c3d30e$fea70f30$030aa8c0@t> List-Id: References: <3FA803F1.00000C.00972@VARZOSU> In-Reply-To: <3FA803F1.00000C.00972@VARZOSU> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org So what is the problem? create root class /qos/bin/tc qdisc del dev eth0 root /qos/bin/tc qdisc add dev eth0 root handle 2 and add these # mark 23 /qos/bin/tc class add dev eth0 parent 2: classid 2:41 htb rate 8Kbit ceil 8Kbit /qos/bin/tc qdisc add dev eth0 parent 2:41 sfq /qos/bin/tc filter add dev eth0 parent 2: protocol ip pref 4 handle 23 fw classid 2:41 # mark 24 /qos/bin/tc class add dev eth0 parent 2: classid 2:42 htb rate 1000Kbit ceil 1000Kbit /qos/bin/tc qdisc add dev eth0 parent 2:42 sfq /qos/bin/tc filter add dev eth0 parent 2: protocol ip pref 4 handle 24 fw classid 2:42 ----------------------------------------------------- I have 40 Users on P2 200 MMX 32 RAM . So i know how to match packets . iptables -t mangle -N MYSHAPER-OUT iptables -t mangle -I POSTROUTING -o $DEV -j MYSHAPER-OUT iptables -t mangle -A MYSHAPER-OUT -s! 192.168.0.5 -p tcp --dport 0:1024 -j MARK --set-mark 23 iptables -t mangle -A MYSHAPER-OUT -p tcp --dport 6660:65000 -j MARK --set-mark 24 How do i shape mark 23 at 1 KB/s and mark 24 at 1 MB/s ? _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/