problem with 2 Mbit egress rate

Linux Advanced Routing and Traffic Control

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

 



i'm trying to limit my egress bandwidth over 2 interfaces (eth1 and eth2) to
2 Mbit

my script is something like this:
tc=/sbin/ip
ipt=/sbin/iptables

$tc class add dev imq0 parent 2: classid 2:4 htb rate 1845Kbit quantum 3000
$tc filter add dev imq0 parent 2: protocol ip handle 4 fw classid 2:4
$tc class add dev imq0 parent 2:4 classid 2:40 htb rate 0.5Mbit quantum 3000
prio 5
$tc qdisc add dev imq0 parent 2:40 handle 40 sfq
$tc filter add dev imq0 parent 2:4 protocol ip u32 match ip dst 10.0.2.0/26
classid 2:40
$tc filter add dev imq0 parent 2:4 protocol ip u32 match ip dst
10.0.3.248/30 classid 2:40
$tc class add dev imq0 parent 2:4 classid 2:41 htb rate 1Mbit quantum 3000
prio 5
$tc qdisc add dev imq0 parent 2:41 handle 41 sfq
$tc filter add dev imq0 parent 2:4 protocol ip prio 30 u32 match ip dst
10.0.3.192/28 classid 2:41
$tc filter add dev imq0 parent 2:4 protocol ip prio 30 u32 match ip dst
10.0.3.246 classid 2:41
$tc class add dev imq0 parent 2:4 classid 2:48 htb prio 1 rate 1.5Mbit ceil
1845Kbit quantum 3000
$tc class add dev imq0 parent 2:4 classid 2:49 htb prio 0 rate 0.5Mbit ceil
1845Kbit quantum 3000
$tc qdisc add dev imq0 parent 2:48 handle 48 sfq
$tc qdisc add dev imq0 parent 2:49 handle 49 sfq
$tc filter add dev imq0 parent 2:4 protocol ip pref 4 u32 match ip dst
10.0.0.0/24 classid 2:48
$tc filter add dev imq0 parent 2:4 protocol ip pref 4 u32 match ip sport
27000 0xfc17 match ip dst 10.0.0.0/24 classid 2:49

$ipt -A POSTROUTING -t mangle -o eth2 -j IMQ
$ipt -A POSTROUTING -t mangle -o eth1 -j IMQ
$ipt -A PREROUTING -t mangle -i eth0 -j MARK --set-mark 4
$ipt -A PREROUTING -t mangle -i eth0 -j RETURN

the problem is that the class (2:4) gets more rate than the given:

class htb 2:4 root rate 1845Kbit ceil 1845Kbit burst 3960b cburst 3960b
 Sent 21632726550 bytes 15648365 pkts (dropped 27, overlimits 0)
 rate 276489bps 186pps
 lended: 818215 borrowed: 0 giants: 0
 tokens: -59480349 ctokens: -59480349

i'm useing slackware 9.1 with kernel 2.6.5
tc is from this package
http://luxik.cdi.cz/~devik/qos/htb/v3/htb3.6-020525.tgz

where i'm wrong...
how can i limit ingress on eth0 and is this a solution?



_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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