From: Date: Thu, 25 Nov 2004 23:59:43 +0000 Subject: [LARTC] Shaping with htb and VLAN Message-Id: <001001c4d34a$d5660490$0100a8c0@taika> MIME-Version: 1 Content-Type: multipart/mixed; boundary="----=_NextPart_000_000D_01C4D353.36F7EAE0" List-Id: To: lartc@vger.kernel.org This is a multi-part message in MIME format. ------=_NextPart_000_000D_01C4D353.36F7EAE0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 #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 #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 echo "shaping on" best regards Wolfgang Schmid // M=FCnster (Germany) ------=_NextPart_000_000D_01C4D353.36F7EAE0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello
 
At first I must tell you that I=B4m a = real newbie=20 with Linux (and english as well...)
I=B4m using 2 vlans = and shaping works quite=20 well without vlan
Now I want to do load balancing at = these=20 vlans.
Any vlan should get the same = minimum/maximum=20 bandwidth of download and use the bandwidth that isn=B4t used by the = other one at=20 the moment.
But with vlan the shaping doesn=B4t=20 work.
Can you please tell me the mistakes in = my script=20 you can see below?
 
#!/bin/sh
 
#mark
/sbin/iptables -t mangle -A PREROUTING = -i ppp0 -j=20 MARK --set-mark 9
 
#delete old qdisc
/sbin/tc qdisc del dev ppp0=20 root         2> &nbs= p; =20 /dev/null >/dev/null
/sbin/tc qdisc del dev ppp0=20 ingress    2>    /dev/null=20 >/dev/null
/sbin/tc qdisc del dev eth0=20 root         =20 2>    /dev/null >/dev/null
/sbin/tc qdisc del dev lo=20 root           &nb= sp; =20 2>    /dev/null >/dev/null
 
#create qdisc
/sbin/tc qdisc add dev eth0 root handle = 1: htb=20 default 0
 
#all pakets get here
/sbin/tc class add dev eth0 parent 1: = classid 1:1=20 htb rate 200kbit burst 10kbit
 
#class for the clients
/sbin/tc class add dev eth0 parent = 1:1 classid=20 1:10 htb rate 100kbit burst 10kbit ceil 100kbit prio 10
/sbin/tc class add dev eth0 parent = 1:1 classid=20 1:20 htb rate 100kbit burst 10kbit ceil 100kbit prio 10
 
#balacing
/sbin/tc qdisc add dev eth0 parent 1:10 = handle 10:=20 sfq perturb 10
/sbin/tc qdisc add dev eth0 parent 1:20 = handle 20:=20 sfq perturb 10
 
#filter
/sbin/tc filter add dev eth0 protocol = 802.1q parent=20 1: prio 1 handle 9 fw flowid 1:1
 
/sbin/tc filter add dev eth0 protocol = 802.1q parent=20 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=20 1:1 prio 1 u32 match ip dst 192.168.13.4 flowid 1:10
 
echo "shaping on"
 
best regards
 
Wolfgang Schmid // M=FCnster (Germany)
 
 
 
------=_NextPart_000_000D_01C4D353.36F7EAE0-- _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/