VLAN

Virtual Local Area Networks (VLAN) allows to divide a network into several logical networks domains. The standard 802.1Q protocol is used to add a tag identifier between 1 and 4094. VLAN stacking or QinQ is supported by simply binding the VLAN interface to another.

To configure VLAN, enter the context interface type vlan from the VRF in which you plan to define VLAN logical interface. The VLAN configuration is valid as soon as the VLAN ID is set and the bound interface is set.

Here is an example of VLAN named vlan-blue in VRF main, with a tag identifier 300 and bound to underlying interface named eth0:

vrouter running vrf main# interface vlan vlan-blue
vrouter running vlan vlan-blue#! vlan-id 300
vrouter running vlan vlan-blue#! link-interface eth0
vrouter running vlan vlan-blue# commit

The VLAN interface is configured provided eth0 is configured in VRF main.

Let’s fetch the state afer committing this configuration:

vrouter running vrf main# interface vlan vlan-blue
vrouter running vlan vlan-blue# show state
vlan vlan-blue
    protocol 802.1q
    ethernet
        mac-address de:ad:de:01:02:03
        ..
    mtu 1500
    counters
        out-octets 0
        in-octets 0
        in-unicast-pkts 0
        out-unicast-pkts 9
        in-discards 0
        in-errors 0
        out-discards 0
        out-errors 0
        ..
    link-interface eth0
    oper-status UP
    enabled true
    ipv6
        address fe80::dcad:deff:fe01:203/64
            ..
        ..
    vlan-id 300
    ..

The same configuration can be made using this NETCONF XML configuration:

vrouter> show config xml absolute vrf main interface vlan vlan-blue
<config xmlns="urn:6wind:vrouter">
  <vrf>
    <name>main</name>
    <interface xmlns="urn:6wind:vrouter/interface">
      <vlan xmlns="urn:6wind:vrouter/vlan">
        <name>vlan-blue</name>
        <protocol>802.1q</protocol>
        <vlan-id>300</vlan-id>
        <link-interface>eth0</link-interface>
        (...)
      </vlan>
    </interface>
  </vrf>
</config>

See also

The command reference for details.

Cross VRF setup

By default, the link interface must be in the same VRF than the VLAN interface. However, a VLAN interface can bind a link interface which is located in another VRF: this type of setup is called cross-vrf.

To change the link VRF, set the link-vrf:

vrouter running vrf main# interface vlan vlan-green
vrouter running vlan vlan-green#! vlan-id 400
vrouter running vlan vlan-green#! link-interface eth0
vrouter running vlan vlan-green# link-vrf vrf1
vrouter running vlan vlan-green# commit