Re: Shaping with htb and VLAN

Linux Advanced Routing and Traffic Control

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

 



On Friday 26 November 2004 00:59, wschmid@xxxxxxxxxxx wrote:
> Hello
>
> At first I must tell you that I´m a real newbie with Linux (and english as
> well...) I´m 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´t used by the other one at the moment. But with vlan
> the shaping doesn´t 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 
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 
If you want these classes to share bandwidth, you have to give them ceil 
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 
Are you sure you want direct the 2 filters to the same class ?

Stef

-- 
stef.coene@xxxxxxxxx
 "Using Linux as bandwidth manager"
     http://www.docum.org/
_______________________________________________
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