This article explains the behaviour with respect to route selection in NSX when a given prefix is learnt from a BGP peer and the same prefix is configured as static route (higher admin distance) and redistributed into BGP.
The outcome of route selection is determined by the sequence of events.
Step 1: BGP receives the route advertisement from peer 10.254.80.254.
Step 2: BGP adds this route in RIB.
Step 3: Static route is added with admin distance 250 and redistributed into BGP.
Step 4: Best path selection takes place in RIB.
Best path selection in RIB is based on administrative distance. Route with lesser admin distance is preferred.
Since administrative distance of static route in this scenario is more than BGP, BGP route is selected and installed in datapath.
Edge(tier0_vrf_sr[7])> get route | find 192.168.0.1/32b > * 192.168.0.1/32 [20/0] via 10.254.80.254, uplink-339, 00:12:03 |
Edge(tier0_vrf_sr[7])> get bgp | find 192.168.0.1/32> 192.168.0.1/32 10.254.80.254 0 100 0 420 ? |
Step 1: Static route is added with admin distance 250 and redistributed into BGP.
Step 2: This route is added into BGP table.
Step 3: BGP receives the route advertisement from peer 10.254.80.254.
Step 4: Best path selection takes place in BGP.
Best path selection in BGP is based on BGP path selection algorithm.
Best route selection is handled by BGP. BGP does not consider AD as one of the parameters during route selection. However BGP considers WEIGHT. Since WEIGHT of redistributed route is 32768 which is more than received route, the static route is preferred in BGP. No route add is sent from BGP to RIB. Static route is installed in datapath
Edge(tier0_vrf_sr[7])> get route | find 192.168.0.1/32t0s> * 192.168.0.1/32 [250/0] via 10.254.80.254, uplink-339, 00:17:31 |
Edge(tier0_vrf_sr[7])> get bgp | find 192.168.0.1/32 192.168.0.1/32 10.254.80.254 0 100 0 420 ? > 192.168.0.1/32 10.254.80.254 0 100 32768 ? |
VMware NSX-T 3.x
VMware NSX 4.x
The product is working as designed and inline with industry standards.
An inbound route-map can be used to set a higher weight to the routes received by BGP peer than the static route, i.e. more than 32678(default value) or any value set explicitly for the static route.
BGP RIB will have both routes, but now BGPd will select the BGP route because of higher weight, then will send BGP route to RIB.
RIB then has static route(with explicitly configured higher admin distance) and BGP. So, RIB now selects BGP route over static route because of lower admin distance value. It programs FIB with BGP route as the best path.