A usual way to connect VRF together is to use a xvrf interface. The xvrf interfaces are virtual Ethernet devices that are always created in interconnected pairs. They can act as tunnels between network namespaces.

xvrf interfaces are similar to veth interfaces, with the following differences:

  • xvrf interfaces have a fixed MAC address and cannot be configured

  • xvrf interfaces are flagged NOARP, meaning that no ARP or NDP resolution is done when sending an IP packet through it

  • xvrf interfaces do not support IP configuration

See also

veth interfaces.

Here is an example of configuration where xvrf interfaces connect two VRF.

vsr running config# / vrf vr1
vsr running vrf vr1# interface xvrf to-vr2
vsr running xvrf to-vr2#! link-interface to-vr1 link-vrf vr2
vsr running xvrf to-vr2#! / vrf vr2
vsr running vrf vr2#! interface xvrf to-vr1
vsr running xvrf to-vr1#! link-interface to-vr2 link-vrf vr1
vsr running xvrf to-vr1# commit

A YANG condition ensures that the binding of xvrf interfaces is consistent: the xvrf interfaces of a given pair must bind each other.

A route can then be added in vr2 to reach a network through vr1:

vsr running config# vrf vr2
vsr running vrf vr2# routing static
vsr running static# ipv4-route next-hop to-vr1
vsr running static# commit

Let’s fetch the xvrf state inside vr1 after committing this configuration:

vsr running config# show state vrf vr1 interface xvrf
xvrf to-vr2
    mtu 1500
    promiscuous false
    enabled true
    oper-status UP
        in-octets 360
        in-unicast-pkts 4
        in-discards 0
        in-errors 0
        out-octets 360
        out-unicast-pkts 4
        out-discards 0
        out-errors 0
    link-interface to-vr1
    link-vrf vr2

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

vsr running config# show config xml absolute
<config xmlns="urn:6wind:vrouter">
    <interface xmlns="urn:6wind:vrouter/interface">
      <xvrf xmlns="urn:6wind:vrouter/xvrf">
    <interface xmlns="urn:6wind:vrouter/interface">
      <xvrf xmlns="urn:6wind:vrouter/xvrf">

See also

The command reference for details.