[ovs-discuss] VLAN tagged and untagged with VM and real switch

Qin, Xiaohong Xiaohong.Qin at emc.com
Mon Apr 21 16:52:48 UTC 2014


I was quickly scanning through this FAQ link,

https://raw.githubusercontent.com/openvswitch/ovs/master/FAQ

found this Q/A paragraph,

Q: I thought Open vSwitch was a virtual Ethernet switch, but the
   documentation keeps talking about bridges.  What's a bridge?

A: In networking, the terms "bridge" and "switch" are synonyms.  Open
   vSwitch implements an Ethernet switch, which means that it is also
   an Ethernet bridge.

In the physical network world, bridge and switch are two different gears, they are not synonyms.

Dennis Qin

-----Original Message-----
From: discuss [mailto:discuss-bounces at openvswitch.org] On Behalf Of Brian Candler
Sent: Sunday, April 20, 2014 2:18 PM
To: Alex; discuss openvswitch.org
Subject: Re: [ovs-discuss] VLAN tagged and untagged with VM and real switch

On 19/04/2014 20:20, Alex wrote:
> I don't know if that what I want to do is possible with OpenVSwitch.
>
> The real switch is connected to Host here the link transports VLAN1 untagged and VLAN2 and 3 tagged.
> Without OVS I can use eth0 and eth0.2 to comunicate to the devices on both nets.
> eth0 has 192.168.0.1 and eth0.2 has 10.0.0.1 and eth0.3 172.16.0.1
>
> VLAN3 is the management VLAN.
>
> On Host there four KVM-VMs three of them should only see VLAN1 but one of them should see VLAN1 untagged and VLAN2 tagged.
>
> I've configured an OVS-bridge switch0 and added eth0, vnet0, vnet1, vnet2, vnet3.
>
> My question is how to set up the vlans that they can talk to the real switch?
So you want a trunk port (i.e. just add eth0 to switch0) except that you want VLAN1 untagged.

For the answer see the Openvswitch FAQ at https://raw.githubusercontent.com/openvswitch/ovs/master/FAQ

        - Change the OVS configuration for the physical port to a
          native VLAN mode.  For example, the following sets up a
          bridge with port eth0 in "native-tagged" mode in VLAN 9:

              ovs-vsctl add-br br0
              ovs-vsctl add-port br0 eth0 tag=9 vlan_mode=native-tagged

          In this situation, "native-untagged" mode will probably work
          equally well.  Refer to the documentation for the Port table
          in ovs-vswitchd.conf.db(5) for more information.

(the question to which this answer relates describes the situation of a switch where one VLAN is native and the others are tagged)

The manpage referred to can be found at
http://openvswitch.org/ovs-vswitchd.conf.db.5.pdf

> And how to set up an IP for Host?
Also in the FAQ.

Q: I created a bridge and added my Ethernet port to it, using commands
    like these:

        ovs-vsctl add-br br0
        ovs-vsctl add-port br0 eth0

    and as soon as I ran the "add-port" command I lost all connectivity
    through eth0.  Help!

A: A physical Ethernet device that is part of an Open vSwitch bridge
    should not have an IP address.  If one does, then that IP address
    will not be fully functional.

    You can restore functionality by moving the IP address to an Open
    vSwitch "internal" device, such as the network device named after
    the bridge itself.  For example, assuming that eth0's IP address is
    192.168.128.5, you could run the commands below to fix up the
    situation:

        ifconfig eth0 0.0.0.0
        ifconfig br0 192.168.128.5

And:

Q: Can I configure an IP address on a VLAN?

A: Yes.  Use an "internal port" configured as an access port.  For
    example, the following configures IP address 192.168.0.7 on VLAN 9.
    That is, OVS will forward packets from eth0 to 192.168.0.7 only if
    they have an 802.1Q header with VLAN 9.  Conversely, traffic
    forwarded from 192.168.0.7 to eth0 will be tagged with an 802.1Q
    header with VLAN 9:

        ovs-vsctl add-br br0
        ovs-vsctl add-port br0 eth0
        ovs-vsctl add-port br0 vlan9 tag=9 -- set interface vlan9 type=internal
        ifconfig vlan9 192.168.0.7


HTH,

Brian.
_______________________________________________
discuss mailing list
discuss at openvswitch.org
http://openvswitch.org/mailman/listinfo/discuss




More information about the discuss mailing list