[LARTC] Limiting bandwidth to entire LAN
Gastón
gaston@steel.com.ar
Thu, 4 Mar 2004 11:55:00 -0300
Hi, first of all thanks for all your help. I`m using a bridge and I want to
assign the lan (with public routable ips) only 512Kbits (The internet link
is 1Mbit). What i thought was creating a class with a ceil of 512Kbit an
applying a filter to it with the entire net (1.2.3.0/24). This approach
didn´t work for me(the ceil was bypassed). Should I use policing instead?
These are the commands I used:
tc qdisc del dev eth0 root
tc qdisc add dev eth0 root handle 1 htb default 10 r2q 5
tc qdisc del dev eth1 root
tc qdisc add dev eth1 root handle 1 htb default 10 r2q 5
tc class add dev eth0 parent 1: classid 1:2 htb rate 512Kbit
tc class add dev eth0 parent 1:2 classid 1:30 htb rate 448Kbit ceil 512Kbit
tc qdisc add dev eth0 parent 1:30 handle 30 sfq perturb 10
tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip src
1.2.3.0/24 classid 1:30
tc class add dev eth1 parent 1: classid 1:2 htb rate 512Kbit
tc class add dev eth1 parent 1:2 classid 1:30 htb rate 448Kbit ceil 512Kbit
tc qdisc add dev eth1 parent 1:30 handle 30 sfq perturb 10
tc filter add dev eth1 parent 1:0 protocol ip prio 100 u32 match ip dst
1.2.3.0/24 classid 1:30