Route Redistribution in BGP
If there are routers that run both OSPF and BGP, certain OSPF routes might have to be sent to other eBGP peers. This can be achieved using the redistribution feature. Consider the following topology, in which R1 and R2 are eBGP peers, and R2 and R3 are OSPF peers. R2 is redistributing OSPF routes into BGP. The OSPF routes are sent to the R1 BGP routing table. This configuration assumes that all OSPF and eBGP sessions are up and running, and that only the redistribution must be configured.
Topology
Figure 1-18: Redistribute with OSPF
R2
#configure terminal | Enter configure mode. |
---|
(config)#router bgp 100 | Define the routing process. The number 100 specifies the AS number of R2. |
(config-router)# address-family ipv4 unicast | Enter address-family ipv4 unicast mode |
(config-router-af)#redistribute ospf | Redistribute OSPF routes in the R2 routing table into the R1 BGP routing table. |
(config-router-af)# exit-address-family | Exit address-family mode. |
(config-router)#commit | Commit the candidate configuration to the running configuration. |
Validation
#show ip bgp
BGP table version is 3, local router ID is 192.168.52.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 3.3.3.3/32 10.10.10.2 11 100 0 100 ?
*> 11.11.11.0/24 10.10.10.2 1 100 0 100 ?
Total number of prefixes 2
Last modified date: 10/16/2023