cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4600
Views
5
Helpful
9
Replies

Redistribute BGP Routes to OSPF

cdegroat82
Level 1
Level 1

Hi,

BGP newbie here.  I was messing around with a few different configs on GNS3 and Packet tracer.  The lab I was trying to build was 2 seperate locations running OSPF, with a router in the middle running a basic BGP configuration.  Everything is working right so far, I was just wondering if there was a way to take the routes learned from BGP, and redistribute them to OSPF so those routes will populate internally.  I've done some quick reading on the redistribute commands, but they dont seem to be working for me - or at least I may not be understanding them correctly.  What happens is R1 on both ends shows all networks, as well as the BGP router in tbe middle, but OSPF isnt sending those routes throughout either network.  Can anyone shed some light?

Config on R1 on Network Segment A

router ospf 60286

router-id 65.19.255.1

log-adjacency-changes

redistribute bgp 47286 subnets

redistribute static subnets

redistribute connected subnets

network 0.0.0.0 255.255.255.255 area 0

!

router bgp 47286

bgp log-neighbor-changes

bgp redistribute-internal

no synchronization

neighbor 7.1.1.2 remote-as 60286

redistribute static

Config on R1 in Network Segment B

router ospf 65535

router-id 65.19.100.1

log-adjacency-changes

redistribute bgp 60218 subnets

redistribute static subnets

redistribute connected subnets

network 0.0.0.0 255.255.255.255 area 0

!

router bgp 60218

bgp log-neighbor-changes

no synchronization

neighbor 60.12.1.1 remote-as 60286

redistribute ospf 65535

redistribute static

Config on the BGP-only router between them

router bgp 60286

bgp log-neighbor-changes

no synchronization

neighbor 60.12.1.2 remote-as 60218

neighbor 7.1.1.1 remote-as 47286

redistribute static

9 Replies 9

Richard Burts
Hall of Fame
Hall of Fame

Chris

The syntax of your redistribute command to redistribute BGP routes into OSPF seems to be right. The most common mistake that people make about redistributing routes into OSPF is that they do not specify the subnets keyword. But you have done this. So from a syntax perspective your config should be working fine.

If it is not giving the results that you expect then there is probably some other issue. And the thing that I wonder about first is whether there are really BGP routes to redistribute into OSPF. I do not see any network statement in any of the BGP configst. In most configurations the network statement is the most common way to specify what networks BGP is to advertise. And you have not specified any in this way. The BGP configs do redistribute static routes. But we do not know whether there are valid static routes on these routers. Probably the best way to check this out is to post the output of show ip bgp on both of the edge BGP routers.

HTH

Rick

HTH

Rick

It sounds like I might be missing (depending on if this is possible), the part where I'd be sending The OSPF routes from the respective sides to BGP to be sent across?  For what its worth, hes the output from the edge routers as is.

R1 "A" End

r1.a.net#sh ip bgp

BGP table version is 25, local router ID is 65.19.255.1

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

*> 10.2.27.0/24      7.1.1.2                  0     0     0 60286 60218 ?

*> 10.14.16.0/24     7.1.1.2                  0     0     0 60286 60218 ?

*> 10.19.26.0/24     7.1.1.2                  0     0     0 60286 60218 ?

*> 10.223.1.0/24     7.1.1.2                  0     0     0 60286 60218 ?

*> 12.1.1.0/29       7.1.1.2                  0     0     0 60286 60218 ?

*> 24.38.62.0/29     7.1.1.2                  0     0     0 60286 60218 ?

*> 24.112.2.0/28     7.1.1.2                  0     0     0 60286 60218 ?

*> 60.12.1.0/30      7.1.1.2                  0     0     0 60286 60218 ?

*> 65.10.1.0/30      7.1.1.2                  0     0     0 60286 60218 ?

*> 65.14.16.252/30   7.1.1.2                  0     0     0 60286 60218 ?

*> 65.19.100.1/32    7.1.1.2                  0     0     0 60286 60218 ?

*> 65.19.100.2/32    7.1.1.2                  0     0     0 60286 60218 ?

*> 65.19.100.3/32    7.1.1.2                  0     0     0 60286 60218 ?

*> 65.19.100.4/32    7.1.1.2                  0     0     0 60286 60218 ?

*> 65.112.10.0/30    7.1.1.2                  0     0     0 60286 60218 ?

*> 68.237.5.8/30     7.1.1.2                  0     0     0 60286 60218 ?

*> 167.206.3.0/24    7.1.1.2                  0     0     0 60286 60218 ?

*> 167.206.15.16/30  7.1.1.2                  0     0     0 60286 60218 ?

*> 173.16.1.0/30     7.1.1.2                  0     0     0 60286 60218 ?

*> 173.16.2.0/30     7.1.1.2                  0     0     0 60286 60218 ?

*> 173.16.3.0/30     7.1.1.2                  0     0     0 60286 60218 ?

*> 173.16.4.0/30     7.1.1.2                  0     0     0 60286 60218 ?

B End

R1.b.net#sh ip bgp

BGP table version is 68, local router ID is 65.19.100.1

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

*  10.2.27.0/24      173.16.4.1               0     0     0 60218 ?

*                    173.16.1.2               0     0     0 60218 ?

*> 10.14.16.0/24     173.16.4.1               0     0     0 60218 ?

*> 10.19.26.0/24     173.16.1.2               0     0     0 60218 ?

*> 10.223.1.0/24     0.0.0.0                  0     0 32768 i

*                    10.223.1.0               0     0     0 60218 ?

*> 12.1.1.0/29       173.16.1.2               0     0     0 60218 ?

*> 24.38.62.0/29     65.10.1.2                0     0     0 60218 ?

*> 24.112.2.0/28     65.112.10.2              0     0     0 60218 ?

*> 60.12.1.0/30      0.0.0.0                  0     0 32768 i

*                    60.12.1.0                0     0     0 60218 ?

*> 65.10.1.0/30      0.0.0.0                  0     0 32768 i

*                    65.10.1.0                0     0     0 60218 ?

*> 65.14.16.252/30   173.16.4.1               0     0     0 60218 ?

*> 65.19.100.1/32    0.0.0.0                  0     0 32768 i

*> 65.19.100.2/32    173.16.1.2               0     0     0 60218 ?

*  65.19.100.3/32    173.16.4.1               0     0     0 60218 ?

*                    173.16.1.2               0     0     0 60218 ?

*> 65.19.100.4/32    173.16.4.1               0     0     0 60218 ?

*> 65.112.10.0/30    0.0.0.0                  0     0 32768 i

*                    65.112.10.0              0     0     0 60218 ?

*> 68.237.5.8/30     0.0.0.0                  0     0 32768 i

*                    68.237.5.8               0     0     0 60218 ?

*> 167.206.3.0/24    68.237.5.10              0     0     0 60218 ?

*> 167.206.15.16/30  173.16.1.2               0     0     0 60218 ?

*> 173.16.1.0/30     0.0.0.0                  0     0 32768 i

*                    173.16.1.0               0     0     0 60218 ?

*>                   0.0.0.0                  0     0 32768 i

*> 173.16.2.0/30     173.16.1.2               0     0     0 60218 ?

*> 173.16.3.0/30     173.16.4.1               0     0     0 60218 ?

*> 173.16.4.0/30     0.0.0.0                  0     0 32768 i

*                    173.16.4.0               0     0     0 60218 ?

*>                   0.0.0.0                  0     0 32768 i

I added  "redistribute ospf 60286" to R1 on the "A" end.  R1 is now populating bgp with the OSPF routes for that segment.  They do seem to be getting across, however, just not sent to the other routers.

R1 "A" End

r1.a.net#sh ip bgp

BGP table version is 53, local router ID is 65.19.255.1

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

*> 5.1.1.0/30        0.0.0.0                  0     0 32768 i

*>                   0.0.0.0                  0     0 32768 i

*> 5.2.1.0/30        0.0.0.0                  0     0 32768 i

*>                   0.0.0.0                  0     0 32768 i

*> 5.3.1.0/30        5.2.1.2                  0     0     0 47286 ?

*> 5.4.1.0/30        5.1.1.1                  0     0     0 47286 ?

*  7.1.1.0/30        7.1.1.0                  0     0     0 47286 ?

*>                   0.0.0.0                  0     0 32768 i

*> 10.2.27.0/24      7.1.1.2                  0     0     0 60286 60218 ?

*> 10.14.16.0/24     7.1.1.2                  0     0     0 60286 60218 ?

*> 10.19.26.0/24     7.1.1.2                  0     0     0 60286 60218 ?

*> 10.223.1.0/24     7.1.1.2                  0     0     0 60286 60218 ?

*> 12.1.1.0/29       7.1.1.2                  0     0     0 60286 60218 ?

*> 24.38.62.0/29     7.1.1.2                  0     0     0 60286 60218 ?

*> 24.112.2.0/28     7.1.1.2                  0     0     0 60286 60218 ?

*> 60.12.1.0/30      7.1.1.2                  0     0     0 60286 60218 ?

*> 65.10.1.0/30      7.1.1.2                  0     0     0 60286 60218 ?

*> 65.14.16.252/30   7.1.1.2                  0     0     0 60286 60218 ?

*> 65.19.100.1/32    7.1.1.2                  0     0     0 60286 60218 ?

*> 65.19.100.2/32    7.1.1.2                  0     0     0 60286 60218 ?

*> 65.19.100.3/32    7.1.1.2                  0     0     0 60286 60218 ?

*> 65.19.100.4/32    7.1.1.2                  0     0     0 60286 60218 ?

*  65.19.255.1/32    65.19.255.1              0     0     0 47286 ?

*>                   0.0.0.0                  0     0 32768 i

*> 65.19.255.2/32    5.2.1.2                  0     0     0 47286 ?

*> 65.19.255.3/32    5.2.1.2                  0     0     0 47286 ?

*>                   5.1.1.1                  0     0     0 47286 ?

*> 65.19.255.4/32    5.1.1.1                  0     0     0 47286 ?

*> 65.112.10.0/30    7.1.1.2                  0     0     0 60286 60218 ?

*> 68.237.5.8/30     7.1.1.2                  0     0     0 60286 60218 ?

*> 167.206.3.0/24    7.1.1.2                  0     0     0 60286 60218 ?

*> 167.206.15.16/30  7.1.1.2                  0     0     0 60286 60218 ?

*> 173.16.1.0/30     7.1.1.2                  0     0     0 60286 60218 ?

*> 173.16.2.0/30     7.1.1.2                  0     0     0 60286 60218 ?

*> 173.16.3.0/30     7.1.1.2                  0     0     0 60286 60218 ?

*> 173.16.4.0/30     7.1.1.2                  0     0     0 60286 60218 ?

B End

R1.b.net#sh ip bgp

BGP table version is 77, local router ID is 65.19.100.1

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

*> 5.1.1.0/30        60.12.1.1                0     0     0 60286 47286 ?

*> 5.2.1.0/30        60.12.1.1                0     0     0 60286 47286 ?

*> 5.3.1.0/30        60.12.1.1                0     0     0 60286 47286 ?

*> 5.4.1.0/30        60.12.1.1                0     0     0 60286 47286 ?

*> 7.1.1.0/30        60.12.1.1                0     0     0 60286 47286 ?

*  10.2.27.0/24      173.16.4.1               0     0     0 60218 ?

*                    173.16.1.2               0     0     0 60218 ?

*> 10.14.16.0/24     173.16.4.1               0     0     0 60218 ?

*> 10.19.26.0/24     173.16.1.2               0     0     0 60218 ?

*> 10.223.1.0/24     0.0.0.0                  0     0 32768 i

*                    10.223.1.0               0     0     0 60218 ?

*> 12.1.1.0/29       173.16.1.2               0     0     0 60218 ?

*> 24.38.62.0/29     65.10.1.2                0     0     0 60218 ?

*> 24.112.2.0/28     65.112.10.2              0     0     0 60218 ?

*> 60.12.1.0/30      0.0.0.0                  0     0 32768 i

*                    60.12.1.0                0     0     0 60218 ?

*> 65.10.1.0/30      0.0.0.0                  0     0 32768 i

*                    65.10.1.0                0     0     0 60218 ?

*> 65.14.16.252/30   173.16.4.1               0     0     0 60218 ?

*> 65.19.100.1/32    0.0.0.0                  0     0 32768 i

*> 65.19.100.2/32    173.16.1.2               0     0     0 60218 ?

*  65.19.100.3/32    173.16.4.1               0     0     0 60218 ?

*                    173.16.1.2               0     0     0 60218 ?

*> 65.19.100.4/32    173.16.4.1               0     0     0 60218 ?

*> 65.19.255.1/32    60.12.1.1                0     0     0 60286 47286 ?

*> 65.19.255.2/32    60.12.1.1                0     0     0 60286 47286 ?

*> 65.19.255.3/32    60.12.1.1                0     0     0 60286 47286 ?

*> 65.19.255.4/32    60.12.1.1                0     0     0 60286 47286 ?

*> 65.112.10.0/30    0.0.0.0                  0     0 32768 i

*                    65.112.10.0              0     0     0 60218 ?

*> 68.237.5.8/30     0.0.0.0                  0     0 32768 i

*                    68.237.5.8               0     0     0 60218 ?

*> 167.206.3.0/24    68.237.5.10              0     0     0 60218 ?

*> 167.206.15.16/30  173.16.1.2               0     0     0 60218 ?

*> 173.16.1.0/30     0.0.0.0                  0     0 32768 i

*                    173.16.1.0               0     0     0 60218 ?

*>                   0.0.0.0                  0     0 32768 i

*> 173.16.2.0/30     173.16.1.2               0     0     0 60218 ?

*> 173.16.3.0/30     173.16.4.1               0     0     0 60218 ?

*> 173.16.4.0/30     0.0.0.0                  0     0 32768 i

*                    173.16.4.0               0     0     0 60218 ?

*>                   0.0.0.0                  0     0 32768 i


Hi,

could you post a diagram.

Regards.

Alain.

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

Attached is the Cisco Packet tracer file.  Although I kind of had a slight eureka moment.  I could technically setup routes of last resort back to each edge BGP router.  This would work, but, unless Im understanding this setup wrong, I should be able to push those routes out to the other routers.

Hi,

you have a discontiguous area 0 and that is surely the problem, unfortunately your IOS version/platform on both redistributing routers doesn't support GRE tunneling so I couldn't try to make it continuous with this trick.

I'm gonna try it on GNS3 this evening if I've got time.

Regards.

Alain.

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

Oddly enough, I setup the same network in GNS3 using a 7200 as the BGP router in the middle and 2 3640 edge routers pushing the BGP routes to OSPF, and everything works.  All the routes populate correctly.  Odd it doesnt work right in packet tracer.

Chris

Thank you for posting to the thread and telling us that the set up works as expected in GNS3. So the failure appears to be a defect in packet tracer and not a configuration issue. That is a very interesting outcome.

HTH

Rick

HTH

Rick

Hello Chris,

The Packet Tracer is a fine tool for practicing commands and learning basic stuff (understand - CCNA level). However, the Packet Tracer does not really implement all the simulated protocols in their entirety, rather, it mimics their behavior. I am not sure how much of a true OSPF and BGP is running inside Packet Tracer. Therefore, the precision and fidelity of more complex protocols and their interaction is highly questionable. This is the reason I do not recommend using Packet Tracer to learn about advanced details of a particular protocol - because it is not certain how close to reality the simulation performed by Packet Tracer is.

The ultimate source for detailed and in-depth knowledge about these protocols is, beyond all official specifications, either real gear or dynamips/dynagen/gns3/iou running real IOS code.

Cisco should really think about making educational versions of IOS or IOU more accessible to general public. C'mon, the IOS or IOU can always be made with gross limitations on its performance, thereby making it unsuitable for any practical application except educational purposes.

Best regards,

Peter

Review Cisco Networking products for a $25 gift card