12-20-2022 08:58 PM - edited 12-20-2022 08:59 PM
Hey all,
I have this lab that I am working on to improve my BGP skills. The idea is that R7 is the "Internet" and R1 & R2 are failover edge routers. R5 has a loopback adapter of 25.25.25.1 and R6 has a loopback adapter of 35.35.35.1. The idea is to have routers R1-R6 be able to ping 7.7.7.7 as it is acting as the Internet. I also want to have R7 be able to ping the 25.25.25.1 & 35.35.35.1.
R7 is acting as the ISPs with an interface of 7.7.7.7 on it as well.
R1, R2 & R7 have a BGP neighborship, while R1-R6 have an OSPF neighborship.
The problem I am having is that I cannot ping 7.7.7.7 from R3-R6. I also cannot ping the 25.25.25.1 or 35.35.35.1 from R7.
I have default routes on both R1 & R2 pointing to R7.
For testing I put in a few static routes for the 25 & 35 routes going to R1 & R2. I was able to ping the 25 & 35 routes with the static routes in place, but when I removed the routes, I lost the ability to ping the 25 & 35 networks. That tells me my advertisments are not working correctly. I just do not know what I am missing or doing wrong.
Hopefully someone can point me in the right direction to get this working.
I have attached a screenshot of the router setup and the configs for each router.
Thanks!
Solved! Go to Solution.
12-21-2022
12:22 AM
- last edited on
12-28-2022
01:19 AM
by
Translator
Hi @deca24 ,
The issue is that R5 and R6 are advertising the lo1 interfaces as /32 subnets instead of /29. This is because the default network type for a loopback interface in OSPF is "loopback", which causes it to advertise the subnet as a /32.
To fix it, you can either change the default OSPF network type by configuring
ip ospf network point-to-point
on lo1 on both R5 and R6, which will cause OSPF to advertise the subnets as /29 or you can change the BGP network statements on R1 and R2 for the two prefixes as follow:
network 25.25.25.1 mask 255.255.255.255
network 35.35.35.1 mask 255.255.255.255
This second option would also require to modify the
outbound prefix-list (bgp-out).
PS: it is not a good idea for BGP to allow 25.25.25.1 and 35.35.35.1 back in from R7, as it could lead to unexpected behaviours.
Regards,
12-21-2022
12:22 AM
- last edited on
12-28-2022
01:19 AM
by
Translator
Hi @deca24 ,
The issue is that R5 and R6 are advertising the lo1 interfaces as /32 subnets instead of /29. This is because the default network type for a loopback interface in OSPF is "loopback", which causes it to advertise the subnet as a /32.
To fix it, you can either change the default OSPF network type by configuring
ip ospf network point-to-point
on lo1 on both R5 and R6, which will cause OSPF to advertise the subnets as /29 or you can change the BGP network statements on R1 and R2 for the two prefixes as follow:
network 25.25.25.1 mask 255.255.255.255
network 35.35.35.1 mask 255.255.255.255
This second option would also require to modify the
outbound prefix-list (bgp-out).
PS: it is not a good idea for BGP to allow 25.25.25.1 and 35.35.35.1 back in from R7, as it could lead to unexpected behaviours.
Regards,
12-21-2022 06:25 AM
Hi Harold,
So I guess due to having the default network type on the loopback, and advertising something different, BGP just does not advertise due to the different masks? Interesting, good to know.
On the flip side of that, what would cause the pings from R3-R6 to time out when the default routes point to R7 overall? I can ping the 7.7.7.7 from R1 and R2 but not from the other routers.
Thanks!
12-21-2022
08:31 PM
- last edited on
12-28-2022
01:09 AM
by
Translator
Hi @deca24 ,
> BGP just does not advertise due to the different masks?
That is correct. The BGP network statement needs to match the route in the RIB.
> I can ping the 7.7.7.7 from R1 and R2 but not from the other routers.
Make sure that you use the loopback interface that is advertised to R7 as the source address when you ping from R5 or R6. Otherwise traffic will get to R7, but R7 does not have a route to get back to the router originating the ping. R1 and R2 do not have that problem due to the fact that they are directly connected to R7. You do the following from R5 and R6.
ping 7.7.7.7 source lo1
R3 and R4 will not be able to ping R7, as you do not advertise any of the address connected to these routers to R7.
Regards,
12-21-2022
12:39 AM
- last edited on
12-28-2022
01:12 AM
by
Translator
can I see
show ip ospf database external
and
show ip bgp
in R1 and R2 ?
12-21-2022 05:59 AM
12-21-2022
06:33 AM
- last edited on
12-28-2022
01:13 AM
by
Translator
Hi @deca24 ,
Did you try just applying the following on R5 and R6 as suggested in my previous post. It should solve the issue.
int lo1
ip ospf network point-to-point
Regards,
12-21-2022
06:43 AM
- last edited on
12-28-2022
01:14 AM
by
Translator
Your config is OK, there is only one point ~
the subnet of link between R1-R7 you dont need to advertise it via BGP it direct connect. (this point for all BGP router)
what issue then?
the issue is you ping 7.7.7.7 without specify the source of ping, note that R7 not know all prefix in topology.
so the recommend
1- redistrubte ospf into BGP
or
2- use ping x.x.x.x source y.y.y.y
but you need to be sure that ip y.y.y.y is know by R7.
12-21-2022 07:02 AM - edited 12-21-2022 07:02 AM
Hi @MHM Cisco World ,
Pinging 7.7.7.7 from R5 and R6 will not work for the reason I mentioned in my previous post. The issue is the mismatch between the OSPF advertisement for 25.25.25.1 and 35.35.35.1, which are advertised as /32 because of the default OSPF network type on a loopback interface, and the network statement specifying a mask of 255.255.255.248. Changing the default network type to "point-to-point" on lo1 on R5 and R6 will cause the prefixes to be received as /29 on R1 and R2, which will then start advertising the two prefixes to R7.
Regards,
12-21-2022 07:07 AM
if he do redistribute ospf into BGP he dont need to advertise Lo anymore under BGP.
what I prefer is redistribute the OSPF into BGP and control which prefix we need R7 to know with prefix-list out.
12-21-2022 07:12 AM - edited 12-21-2022 07:15 AM
Hi @MHM Cisco World ,
There is many ways to fix an issue and the OSPF redistribution into BGP is one of them. But the fact that the original poster uses a network statement is not wrong and it is very popular in real life designs. This is why I am trying to explain why it doesn't currently work using the BGP network statement.
Regards,
12-21-2022 10:10 AM
Yes I know but as I mention before, I prefer redistribute ospf into bgp , why ?
because the network is not direct connect nor static, but R1 and R2 learn it via OSPF from other router, so it better to direct redistribute ospf into BGP.
12-21-2022 10:20 AM
Hi @MHM Cisco World ,
> because the network is not direct connect nor static, but R1 and R2 learn it via OSPF from other router, so > it better to direct redistribute ospf into BGP.
You can use the BGP network statement with OSPF learnt route as well.
Regards,
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