[ovs-discuss] VLAN question

kruskakli kruskakli at gmail.com
Fri Aug 3 14:10:32 UTC 2012


Hi,

I wanted to play around with VLAN so I created 3 VM's
(running kvm on Ubuntu 12.04 with the openvswitch 1.7.0).

Two of them was in VLAN 10. It worked nice. They could talk to
each other but not to the third VM which was in (the default?) VLAN 0.

However, to make external IP traffic possible I had to add my (only)
pyshical device (eth0) to VLAN 10. Fine, now external access worked
from the two VM's.

But, now I couldn't access the outside from within my host machine.
(I was able to restore it by removing eth0 from VLAN 10 and
attach it to VLAN0 again...)

So, my question is, how I could solve this so that it works for
both my host machine as well as those VLAN-guest VMs?

I attach some info below in case that would be helpful.

Cheers, Tobbe

# ovs-vsctl show
412279fe-57da-42c5-a2d3-ead66689f6cb
     Bridge "br0"
         Port "vnet0"
             Interface "vnet0"
         Port "vnet2"
             tag: 10
             Interface "vnet2"
         Port "vnet1"
             tag: 10
             Interface "vnet1"
         Port "br0"
             Interface "br0"
                 type: internal
         Port "eth0"
             tag: 0
             Interface "eth0"

# ip a ls
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
     inet 127.0.0.1/8 scope host lo
     inet 169.254.169.254/32 scope link lo
     inet6 ::1/128 scope host
        valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc 
pfifo_fast state UP qlen 1000
     link/ether d4:be:d9:98:59:7c brd ff:ff:ff:ff:ff:ff
10: br0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc 
noqueue state UNKNOWN
     link/ether d4:be:d9:98:59:7c brd ff:ff:ff:ff:ff:ff
     inet 192.168.1.115/24 brd 192.168.1.255 scope global br0
     inet6 fe80::a444:1ff:fe24:fd46/64 scope link
        valid_lft forever preferred_lft forever
16: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast 
state UP qlen 500
     link/ether 4a:d9:f8:ed:e5:28 brd ff:ff:ff:ff:ff:ff
     inet6 fe80::48d9:f8ff:feed:e528/64 scope link
        valid_lft forever preferred_lft forever
18: vnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast 
state UP qlen 500
     link/ether ce:3b:44:0d:db:e3 brd ff:ff:ff:ff:ff:ff
     inet6 fe80::cc3b:44ff:fe0d:dbe3/64 scope link
        valid_lft forever preferred_lft forever
19: vnet2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast 
state UP qlen 500
     link/ether da:72:1a:ed:bf:a7 brd ff:ff:ff:ff:ff:ff
     inet6 fe80::d872:1aff:feed:bfa7/64 scope link
        valid_lft forever preferred_lft forever

Example, on how I started kvm:

kvm -m 2048 -net nic,vlan=10,model=virtio,macaddr=00:00:00:00:cc:12 -net 
tap,vlan=10,ifname=vnet2,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown 
-boot c -hda /var/lib/libvirt/images/debian-6.0.5_boot2-c3.img





More information about the discuss mailing list