From: Stef Coene Date: Mon, 29 Nov 2004 21:22:20 +0000 Subject: Re: [LARTC] Shaping with htb and VLAN Message-Id: <200411292222.20202.stef.coene@docum.org> List-Id: References: <001001c4d34a$d5660490$0100a8c0@taika> In-Reply-To: <001001c4d34a$d5660490$0100a8c0@taika> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org On Friday 26 November 2004 00:59, wschmid@muenster.de wrote: > Hello > > At first I must tell you that I=B4m a real newbie with Linux (and english= as > well...) I=B4m using 2 vlans and shaping works quite well without vlan > Now I want to do load balancing at these vlans. > Any vlan should get the same minimum/maximum bandwidth of download and use > the bandwidth that isn=B4t used by the other one at the moment. But with = vlan > the shaping doesn=B4t work. > Can you please tell me the mistakes in my script you can see below? > > #!/bin/sh > > #mark > /sbin/iptables -t mangle -A PREROUTING -i ppp0 -j MARK --set-mark 9 > > #delete old qdisc > /sbin/tc qdisc del dev ppp0 root 2> /dev/null >/dev/null > /sbin/tc qdisc del dev ppp0 ingress 2> /dev/null >/dev/null > /sbin/tc qdisc del dev eth0 root 2> /dev/null >/dev/null > /sbin/tc qdisc del dev lo root 2> /dev/null >/dev/null > > #create qdisc > /sbin/tc qdisc add dev eth0 root handle 1: htb default 0 The 0 class is a special one, it will send all packets as fats as possible.= I=20 don't think you want this as the default class. > #all pakets get here > /sbin/tc class add dev eth0 parent 1: classid 1:1 htb rate 200kbit burst > 10kbit > > #class for the clients > /sbin/tc class add dev eth0 parent 1:1 classid 1:10 htb rate 100kbit burst > 10kbit ceil 100kbit prio 10 > /sbin/tc class add dev eth0 parent 1:1 classid 1:20 htb rate 100kbit burst > 10kbit ceil 100kbit prio 10=20 If you want these classes to share bandwidth, you have to give them ceil=20 200kbit. > #balacing > /sbin/tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10 > /sbin/tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10 > > #filter > /sbin/tc filter add dev eth0 protocol 802.1q parent 1: prio 1 handle 9 fw > flowid 1:1 > > /sbin/tc filter add dev eth0 protocol 802.1q parent 1:1 prio 1 u32 match = ip > dst 192.168.12.4 flowid 1:10 > /sbin/tc filter add dev eth0 protocol 802.1q parent 1:1 prio 1 u32 match = ip > dst 192.168.13.4 flowid 1:10=20 Are you sure you want direct the 2 filters to the same class ? Stef --=20 stef.coene@docum.org =A0"Using Linux as bandwidth manager" =A0 =A0 =A0http://www.docum.org/ _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/