[LARTC] download/upload restriction.

Umesh Upreti umesh at websurfer.com.np
Mon Oct 1 16:01:53 CEST 2007


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ds9a.nl/pipermail/lartc/attachments/20071001/e98e5d7c/attachment.htm


More information about the LARTC mailing list