From: "Umesh Upreti" Date: Mon, 01 Oct 2007 14:19:53 +0000 Subject: [LARTC] download/upload restriction. Message-Id: <20071001140241.B4866402C@outpost.ds9a.nl> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============0939374908==" List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. --===============0939374908== Content-Type: multipart/alternative; boundary="----=_NextPart_000_0020_01C80463.E03B3870" This is a multi-part message in MIME format. ------=_NextPart_000_0020_01C80463.E03B3870 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Hi all I have following script in my server. Now I want to restrict ip 192.168.3.2 to 128kbps (downlink). But in this case client can download upto 500kbps and upload cannot exceed more than 20kbps. Now what should I do to restrict client 192.168.3.2 within 128kbps downlink and 64kbps uplink. tc qdisc del dev eth0 root tc qdisc add dev eth0 root handle 1:0 htb tc class add dev eth0 parent 1:0 classid 1:1 htb rate 300kbit tc class add dev eth0 parent 1:0 classid 1:11 htb rate 128kbit ceil 300kbit tc class add dev eth0 parent 1:0 classid 1:12 htb rate 128kbit ceil 300kbit tc class add dev eth0 parent 1:0 classid 1:13 htb rate 50kbit ceil 300kbit tc qdisc add dev eth0 parent 1:11 handle 210: pfifo limit 10 tc qdisc add dev eth0 parent 1:12 handle 220: pfifo limit 10 tc qdisc add dev eth0 parent 1:13 handle 230: pfifo limit 10 tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.3.1 match ip sport 20 0xfff flowid 1:11 tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.3.1 match ip sport 21 0xfff flowid 1:11 tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.3.2 flowid 1:12 tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.3.3 flowid 1:13 Regards, Umesh ------=_NextPart_000_0020_01C80463.E03B3870 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Hi all I have following script in my server. Now I want to = restrict ip 192.168.3.2 to 128kbps (downlink). But in this case client can download = upto 500kbps and upload cannot exceed more than 20kbps. Now what should I do = to restrict client 192.168.3.2 within 128kbps downlink and 64kbps = uplink.

 

 

tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1:0 htb
tc class add dev eth0 parent 1:0 classid 1:1  htb rate 300kbit
tc class add dev eth0 parent 1:0 classid 1:11 htb rate 128kbit ceil = 300kbit
tc class add dev eth0 parent 1:0 classid 1:12 htb rate 128kbit ceil = 300kbit
tc class add dev eth0 parent 1:0 classid 1:13 htb rate 50kbit ceil = 300kbit
tc qdisc add dev eth0 parent 1:11 handle 210: pfifo limit 10
tc qdisc add dev eth0 parent 1:12 handle 220: pfifo limit 10
tc qdisc add dev eth0 parent 1:13 handle 230: pfifo limit 10
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.3.1 match ip sport 20 0xfff flowid 1:11
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.3.1 match ip sport 21 0xfff flowid 1:11
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.3.2  flowid 1:12
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.3.3 flowid 1:13

 

Regards,

Umesh

------=_NextPart_000_0020_01C80463.E03B3870-- --===============0939374908== 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 --===============0939374908==--