Configure VRF—RD and Route Targets
After the VRF is created, configure Router Distinguishers and the Route Targets.
Configure Route Distinguishers
Route Distinguishers (RDs) make all customer routes unique. The routes must be unique, so that Multi-Protocol BGP treats the same prefix from two different VPNs as non-comparable routes. To configure RDs, a sequence of 64 bits is prepended to the IPv4 address in the Multi-Protocol BGP update. BGP considers two IPv4 addresses with different RDs as non-comparable, even if they have the same address and mask.
Assign a particular value to the RD for each VRF on the PE router. To display the routing table for a VRF, use the show ip route vrf command.
The following example shows adding an RD. Configure a VRF in both PEs with a unique RD value:
PE1
|
#configure terminal |
Enter the configure terminal |
|
(config)#ip vrf ComA |
Configure VRF instance |
|
(config-vrf)#rd 2:2 |
Configure Router Distinguisher value |
|
(config-vrf)#route-target both 200:1 |
Configure route-target as both |
|
(config-vrf)#exit |
Exit VRF mode |
|
(config)#ip vrf ComB |
Configure VRF instance |
|
(config-vrf)#rd 1:1 |
Configure Router Distinguisher value |
|
(config-vrf)#route-target both 100:1 |
Configure route-target as both |
|
(config-vrf)#exit |
Exit VRF mode |
|
(config)#commit |
Commit the transaction. |
PE2
|
#configure terminal |
Enter the configure terminal |
|
(config)#ip vrf ComA |
Configure VRF instance |
|
(config-vrf)#rd 2:1 |
Configure Router Distinguisher value |
|
(config-vrf)#route-target both 200:1 |
Configure route-target as both |
|
(config-vrf)#exit |
Exit VRF mode |
|
(config)#ip vrf ComB |
Configure VRF instance |
|
(config-vrf)#rd 1:2 |
Configure Router Distinguisher value |
|
(config-vrf)#route-target both 100:1 |
Configure route-target as both |
|
(config-vrf)#exit |
Exit VRF mode |
|
(config)#commit |
Commit the transaction. |
Configure Route Targets
Any routes learned from customers are advertised across the network through Multi-Protocol BGP, and any routes learned through Multi-Protocol BGP are added into the appropriate VRFs. The route target helps PE routers identify which VRFs should receive the routes.
The route-target command creates lists of import and export route-target extended communities for the VRF. It specifies a target VPN extended community. Execute the command once for each community. All routes with the specific route-target extended community are imported into all VRFs with the same extended community as an import route-target.
The following example demonstrates the route-target configuration.
PE1
|
#configure terminal |
Enter the configure terminal |
|
(config)#ip vrf ComA |
Configure VRF instance |
|
(config-vrf)#rd 2:2 |
Configure Router Distinguisher value |
|
(config-vrf)#route-target both 200:1 |
Configure route-target as both |
|
(config-vrf)#exit |
Exit VRF mode |
|
(config)#ip vrf ComB |
Configure VRF instance |
|
(config-vrf)#rd 1:1 |
Configure Router Distinguisher value |
|
(config-vrf)#route-target both 100:1 |
Configure route-target as both |
|
(config-vrf)#exit |
Exit VRF mode |
|
(config)#commit |
Commit the transaction. |
PE2
|
#configure terminal |
Enter the configure terminal |
|
(config)#ip vrf ComA |
Configure VRF instance |
|
(config-vrf)#rd 2:1 |
Configure Router Distinguisher value |
|
(config-vrf)#route-target both 200:1 |
Configure route-target as both |
|
(config-vrf)#exit |
Exit VRF mode |
|
(config)#ip vrf ComB |
Configure VRF instance |
|
(config-vrf)#rd 1:2 |
Configure Router Distinguisher value |
|
(config-vrf)#route-target both 100:1 |
Configure route-target as both |
|
(config-vrf)#exit |
Exit VRF mode |
|
(config)#commit |
Commit the transaction. |