[ovs-discuss] Open-vswitch network configuration on Debian

Frank frank.baalbergen at mendix.com
Thu Oct 20 11:08:57 UTC 2011


Hello,

We're currently experimenting with open-vswitch, planning to use it as 
replacement for vconfig/bridges in a debian/xen environment.

The primary goal we're looking for is to cleanup the numerous bridges 
and interfaces in vm's when working with a whole bunch of vlans, 
replacing them by just things like trunk=1,2,7 etc on a port to a vm.

We're testing on debian squeeze, using backports of open-vswitch from 
testing. (now at 1.2.1-3)

This all works fine. We already added a vlan with a management IP 
address by doing following by hand:
- ovs-vsctl add-br br0
- ovs-vsctl add-port br0 eth0
- ip link set up dev br0
- ovs-vsctl add-port br0 vlan32 tag=32 -- set interface vlan32 type=internal
- ip link set up dev vlan32
- ip route add default via 10.140.32.1 dev vlan32

Now we have internet connection. But if we do a reboot of the 
dom0/psychical machine the internet interfaces (br0 and vlan32) states 
will be 'DOWN'. The information is saved of the interfaces we added.

According of the output of "ovs-vsctl show".

13448e0d-4913-4e1b-8f6c-067c75823e4f
     Bridge "br0"
         Port "eth0"
             Interface "eth0"
         Port "vlan32"
             tag: 32
             Interface "vlan32"
                 type: internal
         Port "br0"
             Interface "br0"
                 type: internal
     ovs_version: "1.2.1+build0"

In our current setup we have something like this in /etc/network/interfaces:

iface mgt inet manual
	up vconfig add eth0 32
	up ip link set up dev eth0.32
	up brctl addbr br32
	up brctl setfd br32 0
	up ip link set up dev br32
	up brctl addif br32 eth0.32
	up ip addr add 10.140.32.34/24 brd + dev br32
	up ip route add 10.140.0.0/16 via 10.140.32.1 dev br32
	up ip route add 10.140.10.0/24 via 10.140.32.5 dev br32
	up ip route add default via 10.140.32.5 dev br32
	down ip addr del 10.140.32.34/24 dev br32
	down ip link set down dev br32
	down brctl delif br32 eth0.32
	down brctl delbr br32
	down ip link set down dev eth0.32
	down vconfig rem eth0.32

We've found out that the script that adds the vlan configuration (Output 
of ovs-vsctl show) is /etc/init.d/openvswitch-switch.

Is there a good way to with some kind of hook to add ip addresses to 
interfaces defined via ovs-vsctl and set interfaces links up?

-- 
Frank Baalbergen - System / Network Administrator
T +31 (0)10 2760434 | frank.baalbergen at mendix.com | www.mendix.com



More information about the discuss mailing list