What is VRF route replication and why to use it?
Route replication is an easy way to allow routes to replicate between virtual networks and clients who reside in one virtual network can reach prefixes that exist in another virtual network. Route replication is supported for Static, Enhanced Interior Gateway Routing Protocol (EIGRP), and Open Shortest Path First (OSPF) routes. It is not possible to replicate routes to and from Border Gateway Protocol (BGP), but that is not an issue because the BGP import and export method of copying routes between Virtual Routing and Forwarding (VRF) is available in a virtual network.
Steps to configure VRFs
Step 1: Create two VRFs, one named VRF-1 and a second named VRF-2.
R1(config)#ip vrf vrf-1 ! R1(config)#ip vrf vrf-2
Step 2: Assign the VRF-1 to FastEthernet0/0 and FastEthernet1/0.
R1(config)#interface FastEthernet0/0 R1(config-if)#ip vrf forwarding vrf-1 ! R1(config)#interface FastEthernet1/0 R1(config-if)#ip vrf forwarding vrf-1
Step 3: Assign the VRF-2 to FastEthernet0/1 and FastEthernet1/1.
R1(config)#interface FastEthernet0/1 R1(config-if)#ip vrf forwarding vrf-2 ! R1(config)#interface FastEthernet1/1 R1(config-if)#ip vrf forwarding vrf-2
Step 4: Configure a IP address all applicable router interfaces.
R1(config)#interface FastEthernet0/0 R1(config-if)#ip address 192.168.1.1 255.255.255.0 ! R1(config)#interface FastEthernet0/1 R1(config-if)#ip address 172.16.1.1 255.255.255.0 ! R1(config)#interface FastEthernet1/0 R1(config-if)#ip address 192.168.2.1 255.255.255.0 ! R1(config)#interface FastEthernet1/1 R1(config-if)#ip address 172.16.2.1 255.255.255.0
NOTE: You must configure IP addressing on an interface after a VRF is assigned to the interface. Adding or removing a VRF from an interface will remove all IP addressing from the interface to which the VRF was added or removed.
Steps to configure VRF route replication
Step 5: Configure each VRF to replicate routes into another VRF routing instance. In this example we will replicate the routing instance of vrf-1 into vrf-2, and vrf-2 into vrf-1.
R1(config)#ip vrf vrf-1 R1(config-vrf)#route-replicate from vrf vrf-2 unicast connected ! R1(config)#ip vrf vrf-2 R1(config-vrf)#route-replicate from vrf vrf-1 unicast connected
Verify the configuration
Now that the configuration is finished lets verify our VRF deployment. Using the show ip route vrf WORD, show ip vrf WORD commands on R1 you can verify the global and separate vrf routing tables as well as VPN routing/forwarding instance information. With the route replication in place vrf-1 and vrf-2 are now sharing routes between the separate routing instances.