All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] CBQ and VLAN's
@ 2000-12-27 10:34 josdg
  2000-12-27 16:22 ` josdg
  0 siblings, 1 reply; 2+ messages in thread
From: josdg @ 2000-12-27 10:34 UTC (permalink / raw)
  To: lartc

<PRE>Hi,

I would like to setup the following:

        Internet                       ------------        5
--------------------------------eth0---| linuxbox |---eth1.6----\
                                       ------------        7     |
                                                                 |
-----------------------                                          |
|<i> Cisco catalist 2924 |                                          |
</I>--|---|---|---------|--                                          |
  |   | Vlan7       \-------------------------------------------/
  | Vlan6  
Vlan5 


eth1 has 802.1q VLAN tagging enabeled, and 3 vlan's configured.

Each vlan has it's own interface on the linux box and an own private
subnet.  Now would i like to do bandwidth division, and allowing vlan's to
borrow bandwidth from each other.

I have put the three vlan interfaces into the same root class.

The configuration works fine exept that each vlan seems to have the whole
&quot;128K&quot; of its own, each vlan can download at 128K at the same time.

It seems to me that each interface is in a class of its own. How can i
correct this ???

I use the following script to setup things.

Vlan setup:
------

#!/bin/sh

# add vlan's to eth1
vlanctl add eth1 5
vlanctl add eth1 6
vlanctl add eth1 7

# set eth1 up
ifconfig eth1 up

# run ifconfig on vlan's
ifconfig eth1.5 192.168.15.254 netmask 255.255.255.0 
ifconfig eth1.6 192.168.16.254 netmask 255.255.255.0
ifconfig eth1.7 192.168.17.254 netmask 255.255.255.0

# turn on forwarding and masquerading:
echo 1 &gt; /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

------------------
CBQ setup:
------
#!/bin/sh

# Bandwith division
# Put all interfaces in root queueing discipline:
tc qdisc add dev eth1.5 root handle 10: cbq bandwidth 100Mbit avpkt 1000
tc qdisc add dev eth1.6 root handle 10: cbq bandwidth 100Mbit avpkt 1000
tc qdisc add dev eth1.7 root handle 10: cbq bandwidth 100Mbit avpkt 1000

# Genereate root classes and put all vlans in it
tc class add dev eth1.5 parent 10:0 classid 10:1 cbq bandwidth 100Mbit
rate 128Kbit allot 1514 weight 10Mbit prio 5 maxburst 0 avpkt 1000 bounded
tc class add dev eth1.6 parent 10:0 classid 10:1 cbq bandwidth 100Mbit
rate 128Kbit allot 1514 weight 10Mbit prio 5 maxburst 0 avpkt 1000 bounded
tc class add dev eth1.7 parent 10:0 classid 10:1 cbq bandwidth 100Mbit
rate 128Kbit allot 1514 weight 10Mbit prio 5 maxburst 0 avpkt 1000 bounded

# Generate a class for each vlan 
tc class add dev eth1.5 parent 10:1 classid 10:100 cbq bandwidth 100Mbit
rate 64Kbit allot 1514 weight 10Mbit prio 5 maxburst 0 avpkt 1000
tc class add dev eth1.6 parent 10:1 classid 10:200 cbq bandwidth 100Mbit
rate 64Kbit allot 1514 weight 10Mbit prio 5 maxburst 0 avpkt 1000
tc class add dev eth1.7 parent 10:1 classid 10:300 cbq bandwidth 100Mbit
rate 64Kbit allot 1514 weight 10Mbit prio 5 maxburst 0 avpkt 1000

# Set queueing Method
tc qdisc add dev eth1.5 parent 10:100 sfq quantum 1514b perturb 15
tc qdisc add dev eth1.6 parent 10:200 sfq quantum 1514b perturb 15
tc qdisc add dev eth1.7 parent 10:300 sfq quantum 1514b perturb 15

# Set filters to Apply Queueing
tc filter add dev eth1.5 parent 10:0 protocol ip prio 100 u32 match ip dst
192.168.15.0/24 flowid 10:100
tc filter add dev eth1.6 parent 10:0 protocol ip prio 100 u32 match ip dst
192.168.16.0/24 flowid 10:200
tc filter add dev eth1.7 parent 10:0 protocol ip prio 100 u32 match ip dst
192.168.17.0/24 flowid 10:300


Greetings,
jos

-- 
&lt;------------------------- De Graeve Jos --------------------------&gt;
Systeembeheer                                Tel:    +32/9/269.04.51 
XS4ALL Internet N.V.                         Fax:    +32/9/269.00.52
&lt;--------- <A HREF="mailto:Josdg@xs4all.be">Josdg@xs4all.be</A> ---------- PGP-Key ID: 0xD3A7F2EC ------&gt;





</PRE>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-12-27 16:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-12-27 10:34 [LARTC] CBQ and VLAN's josdg
2000-12-27 16:22 ` josdg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.