----- Original Message -----
From: Joel
Sent: Tuesday, October 14, 2003 12:12 PM
Subject: ~Restriction Problem~ Dear all,
I have rehat 9.0 server connected to router. The
link is 1 mbps
Now i want to share only 260 kbps bandwidth through
the linux server to the clients.
I have wrote the script. but with it i can restrict
the total bandwidth to 260 kbps.
i dont want to give more than 260 thats
it.
all clients are given individual bandwidht from 260
total.
plz tell me where i m wrong and if u could little
modify the script that would be really great.
Stef ...i wish u will help me
out to solve the problem.
thanks
Joel
this the script.
#!/bin/sh D2VCABLE=260 cmnGp=37 jcom=50 ultra=64 collector=40 lakhanpal=40 ashwin=60 prabhu=35 helpdesk=45 quantam=40 cms=40 siddharth=60 TC=` which
tc` ADDFILTER="$TC filter add dev
eth4" $TC qdisc
del dev eth4 root ### Root
Qdisc $TC qdisc
add dev eth4 root handle 5: htb default 12 $TC class
add dev eth4 parent 5: classid 5:1 htb rate 256kbit ceil $[D2VCABLE]kbit quantum
3000 ###
jcom $TC class
add dev eth4 parent 5:1 classid 5:2001 htb rate $[jcom]kbit ceil $[jcom+10]kbit
quantum 3000 $TC qdisc
add dev eth4 parent 5:2001 handle 2001 sfq perturb
10 $ADDFILTER
protocol ip parent 5: prio 2 u32 match ip dst 202.160.162.208/29 flowid
5:2001 $ADDFILTER
protocol ip parent 5: prio 2 u32 match ip dst 10.255.2.16/30 flowid
5:2001 ###
collector $TC class
add dev eth4 parent 5:1 classid 5:2002 htb rate $[collector]kbit ceil
$[collector+5]kbit quantum 3000 $TC qdisc
add dev eth4 parent 5:2002 handle 2002 sfq perturb
10 $ADDFILTER
protocol ip parent 5: prio 3 u32 match ip dst 10.2.1.40 flowid
5:2002 ###
lakhanpal $TC class
add dev eth4 parent 5:1 classid 5:2003 htb rate $[lakhanpal]kbit ceil
$[lakhanpal+5]kbit quantum 3000 $TC qdisc
add dev eth4 parent 5:2003 handle 2003 sfq perturb
10 $ADDFILTER
protocol ip parent 5: prio 3 u32 match ip dst 10.255.0.17 flowid
5:2003 ###
ashwin $TC class
add dev eth4 parent 5:1 classid 5:2004 htb rate $[ashwin]kbit ceil
$[ashwin+5]kbit quantum 3000 $TC qdisc
add dev eth4 parent 5:2004 handle 2004 sfq perturb
10 $ADDFILTER
protocol ip parent 5: prio 3 u32 match ip dst 10.1.1.8/29 flowid
5:2004 ### prabhu
202 $TC class
add dev eth4 parent 5:1 classid 5:2005 htb rate $[prabhu]kbit ceil
$[prabhu+5]kbit quantum 3000 $TC qdisc
add dev eth4 parent 5:2005 handle 2005 sfq perturb
10 $ADDFILTER
protocol ip parent 5: prio 3 u32 match ip dst 10.0.0.202 flowid
5:2005 ###
203 $TC class
add dev eth4 parent 5:1 classid 5:2006 htb rate 35kbit ceil 40kbit quantum
3000 $TC qdisc
add dev eth4 parent 5:2006 handle 2006 sfq perturb
10 $ADDFILTER
protocol ip parent 5: prio 3 u32 match ip dst 10.0.0.203 flowid
5:2006 ###
204 $TC class
add dev eth4 parent 5:1 classid 5:2007 htb rate 35kbit ceil 40kbit quantum
3000 $TC qdisc
add dev eth4 parent 5:2007 handle 2007 sfq perturb
10 $ADDFILTER
protocol ip parent 5: prio 3 u32 match ip dst 10.0.0.204 flowid
5:2007 ###
205 $TC class
add dev eth4 parent 5:1 classid 5:2008 htb rate 35kbit ceil 40kbit quantum
3000 $TC qdisc
add dev eth4 parent 5:2008 handle 2008 sfq perturb
10 $ADDFILTER
protocol ip parent 5: prio 3 u32 match ip dst 10.0.0.205 flowid
5:2008 ###
206 $TC class
add dev eth4 parent 5:1 classid 5:2009 htb rate 35kbit ceil 40kbit quantum
3000 $TC qdisc
add dev eth4 parent 5:2009 handle 2009 sfq perturb
10 $ADDFILTER
protocol ip parent 5: prio 3 u32 match ip dst 10.0.0.206 flowid
5:2009 ###
quantam $TC class
add dev eth4 parent 5:1 classid 5:2010 htb rate 40kbit ceil 40kbit quantum
3000 $TC qdisc
add dev eth4 parent 5:2010 handle 2010 sfq perturb
10 $ADDFILTER
protocol ip parent 5: prio 3 u32 match ip dst 10.1.5.34 flowid
5:2010 ###
Siddharth $TC class
add dev eth4 parent 5:1 classid 5:2011 htb rate $[siddharth]kbit ceil
$[siddharth]kbit quantum 3000 $TC qdisc
add dev eth4 parent 5:2011 handle 2011 sfq perturb
10 $ADDFILTER
protocol ip parent 5: prio 3 u32 match ip dst 10.2.1.18 flowid
5:2011 $ADDFILTER
protocol ip parent 5: prio 3 u32 match ip dst 10.2.1.19 flowid
5:2011 ###
250 $TC class
add dev eth4 parent 5:1 classid 5:2012 htb rate 35kbit ceil 40kbit quantum
3000 $TC qdisc
add dev eth4 parent 5:2012 handle 2012 sfq perturb
10 $ADDFILTER
protocol ip parent 5: prio 3 u32 match ip dst 10.0.0.250 flowid
5:2012 ###
helpdesk $TC class
add dev eth4 parent 5:1 classid 5:2013 htb rate 40kbit ceil 45kbit quantum
3000 $TC qdisc
add dev eth4 parent 5:2013 handle 2013 sfq perturb
10 $ADDFILTER
protocol ip parent 5: prio 2 u32 match ip dst 10.2.5.15 flowid
5:2013 ### Joel
test $TC class
add dev eth4 parent 5:1 classid 5:2014 htb rate 40kbit ceil 50kbit quantum
3000 $TC qdisc
add dev eth4 parent 5:2014 handle 2014 sfq perturb
10 $ADDFILTER
protocol ip parent 5: prio 2 u32 match ip dst 10.10.10.10 flowid
5:2014 |