[ovs-discuss] problem about vlan

韩金朋 hanjp at neusoft.com
Wed Mar 27 04:03:08 UTC 2013


hi,friend:
I have four vm on host.

Bridge "kvmbr0"
        Port "vnet1"
            tag: 10
            Interface "vnet1"
        Port "kvmbr0"
            Interface "kvmbr0"
                type: internal
        Port "eth0"
            Interface "eth0"
        Port "vnet3"
            tag: 30
            Interface "vnet3"
        Port "vnet2"
            tag: 10
            Interface "vnet2"
        Port "vnet0"
            tag: 10
            Interface "vnet0"
    ovs_version: "1.7.1"

vm1:10.190.30.2(vnet1)
vm3:10.190.30.5(vnet3)
I want to make vm1 communicate with vm3 by modifying the vlan tag.I used ovs-ofctl command add flow 
ovs-ofctl add-flow br0 cookie=1,nw_src=10.190.30.2,nw_dst=10.190.30.5,ip,actions=mod_vlan_vid:9,NORMALbut it did not work. You tell me the vnet1 and vnet3 is access port ,not trunk port,but I can not find in the documentation how to define a port access port or trunk port .Plus vlan tag on the port is access port, without is the trunk port? I read ovs-vswitchd.conf.db.5 document , at Port Table part,VLAN Configuration:vlan_mode :  optional string, one of access, native−tagged,native−untagged, or trunkthen I set vnet1 and vnet3 vlan mode is trunk,they can communication,did not set any flow.when I read FAQ,Q: My OpenFlow controller doesn't see the VLANs that I expect.

A: The configuration for VLANs in the Open vSwitch database (e.g. via
   ovs-vsctl) only affects traffic that goes through Open vSwitch's
   implementation of the OpenFlow "normal switching" action.  By
   default, when Open vSwitch isn't connected to a controller and
   nothing has been manually configured in the flow table, all traffic
   goes through the "normal switching" action.  But, if you set up
   OpenFlow flows on your own, through a controller or using ovs-ofctl
   or through other means, then you have to implement VLAN handling
   yourself.

   You can use "normal switching" as a component of your OpenFlow
   actions, e.g. by putting "normal" into the lists of actions on
   ovs-ofctl or by outputting to OFPP_NORMAL from an OpenFlow
   controller.  In situations where this is not suitable, you can
   implement VLAN handling yourself, e.g.:

       - If a packet comes in on an access port, and the flow table
         needs to send it out on a trunk port, then the flow can add
         the appropriate VLAN tag with the "mod_vlan_vid" action.

       - If a packet comes in on a trunk port, and the flow table
         needs to send it out on an access port, then the flow can
         strip the VLAN tag with the "strip_vlan" action.this tell me "implement VLAN handling yourself",OpenvSwitch does not support inter-vlan communication or I use ovs-ofctl command implement VLAN handling.please answer,thanks.




韩金朋
---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---------------------------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20130327/835d6832/attachment.html>


More information about the discuss mailing list