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.

vrouter running config# / vrf vr1
vrouter running vrf vr1# interface xvrf xvrf-to-vr2
vrouter running xvrf xvrf-to-vr2#! link-interface xvrf-to-vr1 link-vrf vr2
vrouter running xvrf xvrf-to-vr2#! / vrf vr2
vrouter running vrf vr2#! interface xvrf xvrf-to-vr1
vrouter running xvrf xvrf-to-vr1#! link-interface xvrf-to-vr2 link-vrf vr1
vrouter running xvrf 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:

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

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

vrouter running config# show state vrf vr1 interface xvrf
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 xvrf-to-vr1
    link-vrf vr2

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

vrouter 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.