[one-users] Multiple VLAN and Bridge

Stefan Kooman stefan at bit.nl
Tue Sep 16 03:17:57 PDT 2014


Hi,

Quoting Amier Anis (mymabma at gmail.com):
> Dear Stefan,
> 
> It's great ... yes I would like you to share here. I hv tried before but no
> luck.
> My server have at least 2 physical nic. 1 is management and another one is
> storage.

I use this little script to setup networking on our hosts (openvswitch
should already be installed and running):

#!/bin/sh
echo "adding bridges"
ovs-vsctl add-br storage
ovs-vsctl add-br uplink
ovs-vsctl add-br mgmt-migr

echo "adding bonds"
ovs-vsctl add-bond storage bond0 eth0 eth5 bond_mode=balance-tcp
lacp=active other_config:lacp-time=fast trunks=list-of-vlan-ids-here
ovs-vsctl add-bond uplink bond1 eth1 eth4 bond_mode=balance-tcp
lacp=active other_config:lacp-time=fast trunks=list-of-vlan-ids-here
ovs-vsctl add-bond mgmt-migr bond2 eth2 eth3 bond_mode=balance-tcp
lacp=active other_config:lacp-time=fast trunks=list-of-vlan-ids-here

We have all vlans "tagged/trunked" on the port(s)(channels). In order to
have vlan interface(s) on the hypervisor itself we create some
openvswitch "internal" ports:

echo "adding vlans"
ovs-vsctl add-port storage vlanVID tag=VID -- set interface vlanID
type=internal
ovs-vsctl add-port mgmt-migr vlanVID tag=VID -- set interface vlanVID
type=internal
ovs-vsctl add-port mgmt-migr vlanVID tag=VID -- set interface vlanVID
type=internal

That way we can configure networking for hypervisor management,
vm-migration and storage (nfs) on the hypervisors themselves. It will
just show up as a regular interface (ip list).

If you don't want / can't make portchannels (bonds/trunkports/teams,
whatever you want to call them: 802.3ad) you can add ports to bridges
like this:

ovs-vsctl add-br bridge-name

At this point you got two options. Create a trunk port (tag all vlans:
802.1Q), or provide a list of vlans. If you define a "trunk port" you
don't have to add newly created vlans on the openvswitch port if you add
new vlans on the physical switch port.

trunk port:
ovs-vsctl add-port eth0 bridge-name vlan_mode=trunk

or

Explicitly specify vlans:
ovs-vsctl add-port eth0 bridge-name trunks=vlan_id1,vlan_id2

In /etc/network/interfaces (if using Ubuntu/Debian) you have to make
sure the physical devices are marked up/down:

auto eth0
iface eth0 inet manual
      pre-up ip link set $IFACE up
      post-down ip link set $IFACE down

auto eth1
iface eth1 inet manual
      pre-up ip link set $IFACE up
      post-down ip link set $IFACE down

...
for every interface you want to add to openvswitch
...

And of course configure networking for the vlan (internal)
interface(s).

ovs-vsctl show should give you a nice overview of what has been
configured. 

Just add the openvswitch bridge(s) to OpenNebula and off you go.

Let me know if I can be of any further assistance.

Gr. Stefan


-- 
| BIT BV  http://www.bit.nl/        Kamer van Koophandel 09090351
| GPG: 0xD14839C6                   +31 318 648 688 / info at bit.nl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 230 bytes
Desc: not available
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20140916/26b24719/attachment.pgp>


More information about the Users mailing list