Redistributing Routes with BGP
Problem
You want to redistribute routes between an IGP and BGP.
Solution
When connecting two or more IGPs using BGP, you sometimes need to configure redistribution between the IGP and BGP on both routers. To make the example more interesting, we will assume that we need to connect an EIGRP network to an OSPF network using a pair of BGP routers.
The first router redistributes routes from BGP into OSPF:
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#router ospf
Router1(config-router)#
100
network
172.26.0.0 0.0.255.255
area
Router1(config-router)#
0
redistribute bgp
65500
metric
500
subnets
Router1(config-router)#exit
Router1(config)#router bgp
Router1(config-router)#
65500
neighbor
192.168.1.5
remote-as
Router1(config-router)#
65520
network
Router1(config-router)#
172.26.0.0
exit
Router1(config)#end
Router1#
And this is the configuration for the router that redistributes BGP routes into EIGRP:
Router2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router2(config)#router eigrp
Router2(config-router)#
99
network
Router2(config-router)#
172.25.0.0
redistribute bgp
65520
metric
Router2(config-router)#
500 10 255 1 1500
exit
Router2(config)#router bgp
Router2(config-router)#
65520
neighbor
192.168.1.6
remote-as
Router2(config-router)#
65500
network
Router2(config-router)#
172.25.0.0
exit
Router2(config)end
Router2#
Discussion
Before we say anything about this recipe, we need to stress ...
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.