12-09-2020 06:14 AM - edited 12-09-2020 06:16 AM
Hello, I am trying to connect a few routers via BGP and OSPF, my network topology is as follows:
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?
Solved! Go to Solution.
12-09-2020 03:25 PM
Hello
You can negate this loop prevention by applying the below which then should advertise those prefixes.
R1/R2
neighbor <ISP> allowas-in
12-09-2020 10:57 AM - edited 12-09-2020 11:06 AM
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.
12-09-2020 03:03 PM - edited 12-09-2020 03:04 PM
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.
12-09-2020 03:19 PM
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.
12-09-2020 03:25 PM
Hello
You can negate this loop prevention by applying the below which then should advertise those prefixes.
R1/R2
neighbor <ISP> allowas-in
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