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:

vsr running vrf main# interface vlan vlan-blue
vsr running vlan vlan-blue#! vlan-id 300
vsr running vlan vlan-blue#! link-interface eth0
vsr 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:

vsr running vrf main# interface vlan vlan-blue
vsr running vlan vlan-blue# show state
vlan vlan-blue
    protocol 802.1q
        mac-address de:ad:de:01:02:03
    mtu 1500
        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
        address fe80::dcad:deff:fe01:203/64
    vlan-id 300

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

vsr> show config xml absolute vrf main interface vlan vlan-blue
<config xmlns="urn:6wind:vrouter">
    <interface xmlns="urn:6wind:vrouter/interface">
      <vlan xmlns="urn:6wind:vrouter/vlan">

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:

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