You can configure an IPv4 static interface route from one VRF to an IPv4 interface in a different VRF.
Consider VRF A and VRF B with the following characteristics. The steps in this procedure create an interface route between these two sample VRFs.
VRF A | VRF B | |
---|---|---|
Route Distinguisher | 1:1 | 2:2 |
Interface | Ethernet port 1/1 | Ethernet port 1/2 |
IP Address | 10.0.0.1/24 | 10.0.0.1/24 |
device# configure terminal device(config)# vrf A device(config-vrf-A)# rd 1:1
device(config-vrf-A)# address-family ipv4 unicast device(config-vrf-A-ipv4-unicast)# exit device(config-vrf-A)# exit
device(config)# interface ethernet 1/1 device(config-if-e10000-1/1)# vrf forwarding A
device(config-if-e10000-1/1)# ip address 10.0.0.1/24 device(config-if-e10000-1/1)# exit device(config)#
device(config)# vrf b device(config-vrf-b)# rd 2:2
device(config-vrf-b)# address-family ipv4 unicast device(config-vrf-b-ipv4-unicast)# exit device(config-vrf-b)# exit
device(config)# interface ethernet 1/2 device(config-if-e10000-1/2)# vrf forwarding B
device(config-if-e10000-1/2)# ip address 10.0.0.1/24 device(config-if-e10000-1/2)# exit
device(config)# vrf a device(config-vrf-A)# ip route 10.0.0.1/24 ethernet 1/2
The following is the complete process for configuring VRF A to forward traffic over port 1/1 and VRF B to forward traffic over port 1/2. Port 1/2 is configured with an IP address of 10.0.0.1/24.The last step configures a static route on VRF A to use port 1/2 as the next-hop to network destinations beginning with 10.0.0.1/24, thereby connecting VRF A to VRF B.
device# configure terminal device(config)# vrf A device(config-vrf-A)# rd 1:1 device(config-vrf-A)# address-family ipv4 unicast device(config-vrf-A-ipv4-unicast)# exit device(config-vrf-A)# exit device(config)# interface ethernet 1/1 device(config-if-e10000-1/1)# vrf forwarding A device(config-if-e10000-1/1)# ip address 10.0.0.1/24 device(config-if-e10000-1/1)# exit device(config)# vrf B device(config-vrf-B)# rd 2:2 device(config-vrf-B)# address-family ipv4 unicast device(config-vrf-B-ipv4u)# exit device(config-vrf-B)# exit device(config)# interface ethernet 1/2 device(config-if-e10000-1/2)# vrf forwarding B device(config-if-e10000-1/2)# ip address 10.0.0.1/24 device(config-if-e10000-1/2)# exit device(config)# vrf a device(config-vrf-A)# ip route 10.0.0.1/24 ethernet 1/2