02-06-2020 06:32 AM
Hi Guys,
I am facing an issue when redistributing routes from BGP into OSPF.
Below is the detailed summary:
--------------------------------------------------------------------------
Connectivity: R1------EBGP-------R2-------OSPF--------R3
( 10.10.12.0/24) (10.10.23.0/24)
R1 AS(BGP): 1 R2 AS(BGP):2 R2 & R3 OSPF Process ID: 1
===========================
1. We have created two loopbacks i.e 2.2.2.2 & 22.22.22.22 on R2 and redistributed in BGP via Redistribute connected command.
2. Mutual redistribution has been done on R2 i.e BGP to OSPF vise versa.
3. We can see both loopbacks in BGP table but not getting into OSPF DB.
===========================
Configuration and CLI output from R2
=================================================
R2#sh ip int bri
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 10.10.12.2 YES manual up up
FastEthernet1/0 10.10.23.2 YES manual up up
Loopback0 2.2.2.2 YES manual up up
Loopback1 22.22.22.22 YES manual up up
R2#sh run int fa0/0
Building configuration...
Current configuration : 83 bytes
!
interface FastEthernet0/0
ip address 10.10.12.2 255.255.255.0
duplex half
end
R2#sh run int fa1/0
Building configuration...
Current configuration : 101 bytes
!
interface FastEthernet1/0
ip address 10.10.23.2 255.255.255.0
ip ospf 1 area 0
duplex half
end
R2#sh run int loopback0
Building configuration...
Current configuration : 63 bytes
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
end
R2#sh run int loopback1
Building configuration...
Current configuration : 67 bytes
!
interface Loopback1
ip address 22.22.22.22 255.255.255.255
end
R2#sh run | sec r b
router bgp 2
no synchronization
bgp log-neighbor-changes
redistribute connected
redistribute ospf 1 match internal external 1 external 2
neighbor 10.10.12.1 remote-as 1
no auto-summary
R2#
R2#
R2#sh run | sec r o
router ospf 1
log-adjacency-changes
redistribute bgp 2 subnets
!
!
!
R2#sh ip bgp
BGP table version is 7, local router ID is 22.22.22.22
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 2.2.2.2/32 0.0.0.0 0 32768 ?
*> 10.10.12.0/24 0.0.0.0 0 32768 ?
*> 10.10.23.0/24 0.0.0.0 0 32768 ?
*> 22.22.22.22/32 0.0.0.0 0 32768 ?
R2#
R2#
R2#
R2#
R2#sh ip ospf d
OSPF Router with ID (10.10.23.2) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
10.10.23.2 10.10.23.2 1534 0x80000005 0x00383F 1
10.10.23.3 10.10.23.3 1343 0x80000003 0x003A3C 1
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
10.10.23.3 10.10.23.3 830 0x80000002 0x00DBA5
R2#
=======================================================================
Could you please advise why loopback are not getting redistributed into OSPF.
regards
Sanjay Kumar
02-06-2020 02:54 PM
how about adding a command to BGP in R2?
bgp redistribute-internal
02-06-2020 07:17 PM
Hi Balaji,
Thanks for your reply. It's not working after adding bgp redistribute-internal, bgp redistribute-internal is all about to allow ibgp routes to be redistributed in IGP.
regards
Sanjay Kumar
02-07-2020 12:54 AM
You can only redistribute routes that are in the IP routing table.
So the connected route gets redistributed into BGP but the BGP route is not in the IP routing table because connected has a better AD so BGP cannot redistribute that route into OSPF.
If you want the loopback subnet in OSPF you would need either a network statement or redistribute connected in your OSPF configuration.
Jon
02-07-2020 06:11 AM
Since R2 has both BGP and OSPF, why not introuduce network statement with IGP.
02-07-2020 12:53 AM
Hello,
there are no BGP routes in the RIB (routing table) for OSPF to redistribute. If any BGP route would come from R1, the redistribution would work, but since the loopbacks are not announced on another router, there is no 'B" route in the routing table of R2. The only way to get the loopbacks into OSPF is to either announce them in OSPF, or by configuring 'redistribute connected' under the OSPF process on R2.
02-07-2020 09:52 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide