download/upload restriction.

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux