XVRF¶
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 configuredxvrf
interfaces are flaggedNOARP
, meaning that no ARP or NDP resolution is done when sending an IP packet through itxvrf
interfaces do not support IP configuration
See also
Here is an example of configuration where xvrf
interfaces connect two
VRF.
vrouter running config# / vrf vr1
vrouter running vrf vr1# interface xvrf to-vr2
vrouter running xvrf to-vr2#! link-interface to-vr1 link-vrf vr2
vrouter running xvrf to-vr2#! / vrf vr2
vrouter running vrf vr2#! interface xvrf to-vr1
vrouter running xvrf to-vr1#! link-interface to-vr2 link-vrf vr1
vrouter 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 10.100.0.0/16 through vr1:
vrouter running config# vrf vr2
vrouter running vrf vr2# routing static
vrouter running static# ipv4-route 10.100.0.0/16 next-hop 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 to-vr2
mtu 1500
promiscuous false
enabled true
oper-status UP
counters
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.
vrouter running config# show config xml absolute
<config xmlns="urn:6wind:vrouter">
<vrf>
<name>vr1</name>
<interface xmlns="urn:6wind:vrouter/interface">
<xvrf xmlns="urn:6wind:vrouter/xvrf">
<name>to-vr2</name>
<enabled>true</enabled>
<link-interface>to-vr1</link-interface>
<link-vrf>vr2</link-vrf>
(...)
</xvrf>
</interface>
</vrf>
<vrf>
<name>vr2</name>
<interface xmlns="urn:6wind:vrouter/interface">
<xvrf xmlns="urn:6wind:vrouter/xvrf">
<name>to-vr1</name>
<enabled>true</enabled>
<link-interface>to-vr2</link-interface>
<link-vrf>vr1</link-vrf>
(...)
</xvrf>
</interface>
</vrf>
</config>
See also
The command reference for details.
An example of application of Cross-VRF interfaces is to provide vrf route leaking mechanisms with BGP. Cross-VRF interfaces are used to carry traffic from one VR to an other one. In the L3VPN case, the Cross-VRF interfaces can be the border between overlay and underlay information, as encapsulation and decapsulation operations will take place at this point.
See also
The BGP L3VPN for details.