10-15-2020 10:46 AM - edited 10-16-2020 01:09 AM
I have a lab scenario as follows:
2 x Nexus 9300 (one of them is a border gateway)
1 x external router running OSPF
Summary of issue: Want to only advertise the network prefixes to external OSPF peer and not the /32s evpn routes.
The border gateway is redistributing the fabric routes into OSPF. I have connectivity from external to internal to the fabric no problem. The issue I am having is the external OSPF router only has the /32 routes from the hosts on Nexus2 e.g. (10.0.0.1/32) Now this is fine and allows connectivity but really I want to only redistribute the networks into OSPF (not the /32s) The OSPF router does have the 192.168.0.0/24 route from border gateway (Nexus1) but I assume that is because it's picking up the subnet from the connected SVI/Anycast gateway config on the local switch.
If I look at the fabric routes I don't see a network for 10.0.0.0/24 (only the /32 routes) so that is why the route would not be getting redistributed into OSPF. How do I get the /24 route into the fabric routes?
E.g. I could add a network statement under the BGP config on Nexus2 (which works) but wondering if this is the correct way to do it?
vrf Tenant-1 address-family ipv4 unicast network 10.0.0.0/24 advertise l2vpn evpn
I thought the /24 route would be in the fabric routes because of the SVI/Anycast gateway config on Nexus2 for 192.168.0.1/24
My BGP to OSPF route-map config:
ip prefix-list permit-bgp-to-ospf seq 130 permit 0.0.0.0/0 route-map redistribute-bgp-ospf permit 10 match ip address permit-bgp-to-ospf match route-type internal router ospf 1 router-id 1.1.1.1 vrf Tenant-1 router-id 1.1.1.1 redistribute direct route-map redistribute-bgp-ospf redistribute bgp 65000 route-map redistribute-bgp-ospf
My main objective is to have a clean set of routes advertised out of the fabric to OSPF. With that in mind I have also been trying aggregate routes under the BGP config (to redistribute into OSPF) but the problem is an aggregate route will only advertise the aggregate if there is a component route active on the switch. So if you are passing traffic to 192.168.0.1 then the /32 route is in the fabric routes so it then gets redistributed into OSPF. The problem is when traffic is not passing the /32 route disappears from the fabric so the aggregate routes disappears also.
Any suggestions or help welcome.
Thanks
11-12-2020 05:48 AM
Try summarizing the routes in BGP. Then BGP should redistribute the /24 to OSPF as you desire:
On Border Router:
router bgp 6500
address-family ipv4 vrf Tenant-1
aggregate-address 10.0.0.0 255.255.255.0 summary-only
HTH,
Chuck McFadden
(please mark helpful posts as helpful)
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