cisco — Configuration Example: Multi-VRF CE

Device(config-if)#switchport mode trunk Device(config-if)#no ip address Device(config-if)#exit Device(config)#interface gigabitethernet1/0/8 Device(config-if)#switchport access vlan 208 Device(config-if)#no ip address Device(config-if)#exit Device(config)#interface gigabitethernet1/0/11 Device(config-if)#switchport trunk encapsulation dot1q Device(config-if)#switchport mode trunk Device(config-if)#no ip address Device(config-if)#exit Configure the VLANs used on Switch A. VLAN 10 is used by VRF 11 between the CE and the PE. VLAN 20 is used by VRF 12 between the CE and the PE. VLANs 118 and 208 are used for the VPNs that include Switch F and Switch D, respectively:

Device(config)#interface vlan10 Device(config-if)#ip vrf forwarding v11 Device(config-if)#ip address 38.0.0.8 255.255.255.0 Device(config-if)#exit Device(config)#interface vlan20 Device(config-if)#ip vrf forwarding v12 Device(config-if)#ip address 83.0.0.8 255.255.255.0 Device(config-if)#exit Device(config)#interface vlan118 Device(config-if)#ip vrf forwarding v12 Device(config-if)#ip address 118.0.0.8 255.255.255.0 Device(config-if)#exit Device(config)#interface vlan208 Device(config-if)#ip vrf forwarding v11 Device(config-if)#ip address 208.0.0.8 255.255.255.0 Device(config-if)#exit Configure OSPF routing in VPN1 and VPN2.

Device(config)#router ospf 1 vrf vl1 Device(config-router)#redistribute bgp 800 subnets Device(config-router)#network 208.0.0.0 0.0.0.255 area 0 Device(config-router)#exit Device(config)#router ospf 2 vrf vl2 Device(config-router)#redistribute bgp 800 subnets Device(config-router)#network 118.0.0.0 0.0.0.255 area 0 Device(config-router)#exit Configure BGP for CE to PE routing.

Device(config)#router bgp 800 Device(config-router)#address-family ipv4 vrf vl2 Device(config-router-af)#redistribute ospf 2 match internal Device(config-router-af)#neighbor 83.0.0.3 remote-as 100 Device(config-router-af)#neighbor 83.0.0.3 activate Device(config-router-af)#network 8.8.2.0 mask 255.255.255.0 Device(config-router-af)#exit Device(config-router)#address-family ipv4 vrf vl1 Device(config-router-af)#redistribute ospf 1 match internal Device(config-router-af)#neighbor 38.0.0.3 remote-as 100 Device(config-router-af)#neighbor 38.0.0.3 activate Device(config-router-af)#network 8.8.1.0 mask 255.255.255.0 Device(config-router-af)#end Switch D belongs to VPN 1.

Configure the connection to Switch A by using these commands. Configuring Multi-VRF CE Configuration Example: Multi-VRF CE Configuring Multi-VRF CE 22