cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
830
Views
10
Helpful
4
Replies

Not learning route from eBGP

DutchEllie
Level 1
Level 1

Hello, I am trying to connect a few routers via BGP and OSPF, my network topology is as follows:

 

Lab4.png

 

These are the outputs of the relevant parts of show run from all routers.

R1:

router ospf 1
 router-id 2.2.2.2
 log-adjacency-changes
 redistribute connected subnets
 redistribute bgp 120 subnets
 network 20.0.0.0 0.0.0.255 area 0
router bgp 120
 no synchronization
 bgp log-neighbor-changes
 redistribute connected
 redistribute ospf 1
 neighbor 20.0.0.2 remote-as 120
 neighbor 30.0.255.253 remote-as 130
 no auto-summary

 

R2:

router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes

 redistribute bgp 120 subnets

 redistribute connected subnets
 network 20.0.0.0 0.0.0.255 area 0
router bgp 120
 no synchronization
 bgp log-neighbor-changes
 redistribute connected
 redistribute ospf 1
 neighbor 20.0.0.1 remote-as 120
 neighbor 40.0.255.253 remote-as 140
 no auto-summary

 

ISP1:

router bgp 130
 no synchronization
 bgp log-neighbor-changes
 redistribute connected
 neighbor 30.0.255.250 remote-as 140
 neighbor 30.0.255.254 remote-as 120
 no auto-summary

 

ISP2:

router bgp 140
 no synchronization
 bgp log-neighbor-changes
 redistribute connected
 neighbor 30.0.255.249 remote-as 130
 neighbor 40.0.255.254 remote-as 120
 no auto-summary

 

With this all the PCs can ping perfectly fine. I can even shut off any of the links between the routers and it works fine going through the other route. All but one. If I turn off (either by suspending the route in GNS3, where I made this, deleting the link alltogether or shutting the interface) the link between R1 and R2, there won't be a backup route to network 20.0.2.0/24 via ISP1 and 2. If I am not mistaken this should happen? 

 

ISP1 and ISP2 both know a route to network 20.0.2.0/24, but ISP1 seems to not advertise it to R1. Also, R2 does not receive a route from ISP2 to the network 20.0.1.0/24. Why would this be?

1 Accepted Solution

Accepted Solutions

Hello

You can negate this loop prevention by applying the below which then should advertise those prefixes.

R1/R2
neighbor <ISP> allowas-in


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

View solution in original post

4 Replies 4

if link between R1 -ISP1 is down or R2-ISP2 down you need next-hop-self in R1 & R2

R1:

router ospf 1
 router-id 2.2.2.2
 log-adjacency-changes
 redistribute connected subnets
 redistribute bgp 120 subnets
 network 20.0.0.0 0.0.0.255 area 0
router bgp 120
 no synchronization
 bgp log-neighbor-changes
 redistribute connected
 redistribute ospf 1
 neighbor 20.0.0.2 remote-as 120

neighbor 20.0.0.2 next-hop self 
 neighbor 30.0.255.253 remote-as 130
 no auto-summary

 

R2:

router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes

 redistribute bgp 120 subnets

 redistribute connected subnets
 network 20.0.0.0 0.0.0.255 area 0
router bgp 120
 no synchronization
 bgp log-neighbor-changes
 redistribute connected
 redistribute ospf 1
 neighbor 20.0.0.1 remote-as 120

neighbor 20.0.0.1 next-hop-self 
 neighbor 40.0.255.253 remote-as 140
 no auto-summary

 

why R1 and R2 not see 20.0.0.0 form ISP1 and ISP2 because if loop prevent because the path is 120 then R1 and R2 know that it is own ASN and refuse this route to prevent loop.

Hello


@DutchEllie wrote:

but ISP1 seems to not advertise it to R1. Also, R2 does not receive a route from ISP2 to the network 20.0.1.0/24. Why would this be?


This is expected, because you have disabled the ospf/bgp link between R1-R2 so 20.0.X.0/24 networks will be advertised to the isp rtrs however due to bgp loop prevention these prefixes will NOT be advertised into R1/R2 because the these bgp prefixes will have a as-path sequence that includes R1/R2 own ASN (120) thus they wont be allowed into the ASN120 bgp domain.


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Ah yes of course! Totally forgot about that!! What would be the recommended solution in this case to get it working anyway? I assume a gateway of last resort would be used here, but I am not sure.

Hello

You can negate this loop prevention by applying the below which then should advertise those prefixes.

R1/R2
neighbor <ISP> allowas-in


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul
Review Cisco Networking for a $25 gift card