cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
996
Views
0
Helpful
6
Replies

BGP Routes Not Getting Installed in OSPF DB

sanju
Level 1
Level 1

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

6 Replies 6

balaji.bandi
Hall of Fame
Hall of Fame

how about adding a command to BGP in R2?

 

bgp redistribute-internal

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

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

 

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

 

Since R2 has both BGP and OSPF, why not introuduce network statement with IGP.

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

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.

hi , when i entered the network command under BGP for one of Loopback, that ip got installed in ospf DB as LSA 5, starts advertising to R3 router via OSPF.

Here route for 2.2.2.2 is not in RIB table from BGP but its now installed in OSPF DB.

What is the logic behind this, just want to understand?

=============================================
R2#sh running-config | section r b
router bgp 2
no synchronization
bgp log-neighbor-changes
network 2.2.2.2 mask 255.255.255.255
redistribute connected
redistribute ospf 1 match internal external 1 external 2
neighbor 10.10.12.1 remote-as 1
no auto-summary
R2#
R2#sh running-config | section r o
router ospf 1
log-adjacency-changes
redistribute bgp 2 subnets
R2#
R2#sh ip bgp
BGP table version is 16, 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 i
*> 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#sh ip ospf d

OSPF Router with ID (2.2.2.2) (Process ID 1)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 769 0x80000003 0x0009BA 1
10.10.23.3 10.10.23.3 773 0x80000002 0x003643 1

Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum
10.10.23.3 10.10.23.3 773 0x80000001 0x001394

Type-5 AS External Link States

Link ID ADV Router Age Seq# Checksum Tag
2.2.2.2 2.2.2.2 306 0x80000001 0x009013 0
R2#


============================================

R3:
R3#sh ip route 2.2.2.2
Routing entry for 2.2.2.2/32
Known via "ospf 1", distance 110, metric 1, type extern 2, forward metric 1
Last update from 10.10.23.2 on FastEthernet0/0, 00:05:58 ago
Routing Descriptor Blocks:
* 10.10.23.2, from 2.2.2.2, 00:05:58 ago, via FastEthernet0/0
Route metric is 1, traffic share count is 1

R3#

regards

Review Cisco Networking for a $25 gift card