PE-CE Communication via BGP

Problem

You want to use BGP to exchange routing information between CE and PE routers.

Solution

Once again, this problem is similar to the RIP, OSPF, and EIGRP examples in Recipes 26.5, 26.6, and 26.7. First we have to enable the routing protocol on the CE routers, which we do by configuring a new AS number on the CE routers. These devices are part of a different AS than the MPLS cloud, so they must have different AS numbers:

Router-CE-A1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router-CE-A1(config)#router bgp 65535
Router-CE-A1(config-router)#neighbor 192.168.1.1 remote-as 100
Router-CE-A1(config-router)#redistribute ospf 155
Router-CE-A1(config-router)#no synchronization
Router-CE-A1(config-router)#no auto-summary
Router-CE-A1(config-router)#exit
Router-CE-A1(config)#router ospf 155
Router-CE-A1(config-router)#redistribute bgp 65535 subnets
Router-CE-A1(config-router)#network 192.168.5.0 0.0.0.255 area 0
Router-CE-A1(config-router)#end
Router-CE-A1#

At this site, we are using the same OSPF configuration as in Recipe 26.6 to facilitate routing within the site, so we must redistribute the OSPF routes into BGP, and vice versa.

We configure the other CE router similarly, but with a different AS number:

Router-CE-A2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router-CE-A2(config)#router bgp 65534
Router-CE-A2(config-router)#neighbor 192.168.3.1 remote-as 100 Router-CE-A2(config-router)# ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.