We have a typical design with Nexus 7K Border-Leaf and a pair of NSX Edge Gateways enabled for Equal-Cost Multi-Path, and finally the Logical Router which is also enabled for ECMP.
The issue I needed to resolve recently at a customer was to remove 0.0.0.0/0 from the OSPF routing table of the Border Leaf Cisco Nexus 7706’s. This was being redistributed improperly by the NSX Edge Services Gateway (ESG).
You see even if we do not enable default originate we still get the 0.0.0.0/0 because we told the ESG’s to redistribute static and connected. In the NSX Edge when we select redistribute static the default route is advertised to the N7Ks and the DLR.
Note: Redistribute Static is required to properly enable ECMP as we need all Edge devices to provide a default route to the Distributed Logical Router (LDR).
We attempted several methods before we found the golden ticket. table-map
A table map is a unique feature of NX-OS that allows the network administrator to filter routes or selectively modify the distance of the routes before the routes are sent to routing information base (RIB). The table map uses the route map to select routes based on a wide variety of parameters: metrics, level, type, next hop, outgoing interface, etc.
We used the following set of commands to setup filtering:
ip prefix-list nsx-routes seq 10 permit 10.0.100.0/24
ip prefix-list nsx-routes seq 20 permit 10.0.101.0/24
ip prefix-list nsx-routes seq 30 permit 10.0.102.0/24
ip prefix-list nsx-routes seq 40 permit 10.0.99.240/28
route-map ospf-in permit 10
match ip address prefix-list nsx-routes
router ospf 1
table-map ospf-in filter
Now we check the on the Nexus and voila we have it!