Goal:
Keep the global route redistribution options enabled while selectively filter routes being advertised from NSX-T to Physical.
Setup Details
2 NSX-T ENs (5.5.5.2 and 5.5.5.3) in Active/Standby with eBGP configured to a Cumulus Border Leaf (5.5.5.1). Following are the routes being advertised by NSX to physical.
en1(tier0_sr)> get bgp neighbor 5.5.5.1 advertised-routes
Status flags: * - best, I - internal
Origin flags: I - IGP, E - EGP, ! - incomplete
Network Next Hop LocPrf MED AS Path
2.2.2.0/29 5.5.5.2 0 0 65300 !
2.2.2.8/29 5.5.5.2 0 0 65300 !
2.2.2.64/27 5.5.5.2 0 0 65300 !
2.3.0.0/24 5.5.5.2 0 0 65300 !
2.4.0.0/24 5.5.5.2 0 0 65300 !
23.23.23.10/32 5.5.5.2 0 0 65300 !
23.23.23.201/32 5.5.5.2 0 0 65300 !
23.23.23.202/32 5.5.5.2 0 0 65300 !
23.23.23.203/32 5.5.5.2 0 0 65300 !
23.23.23.204/32 5.5.5.2 0 0 65300 !
23.23.23.205/32 5.5.5.2 0 0 65300 !
23.23.23.206/32 5.5.5.2 0 0 65300 !
23.23.23.207/32 5.5.5.2 0 0 65300 !
23.23.23.208/32 5.5.5.2 0 0 65300 !
172.16.0.0/24 5.5.5.2 0 0 65300 !
172.16.1.0/24 5.5.5.2 0 0 65300 !
172.16.2.0/24 5.5.5.2 0 0 65300 !
172.16.3.0/24 5.5.5.2 0 0 65300 !
172.16.4.0/24 5.5.5.2 0 0 65300 !
2.2.2.x, 2.3.x.x and 2.4.x.x are networks on T1 router that were manually created. I want these to be advertised out
23.23.23.x are the LB, SNAT and DNAT IPs that I want to be advertised
172.16.x.x are my Kubernetes POD networks that I DO NOT want to be advertised.
In NSX IPAM, I have provided a block of 172.16.0.0/16 from which /24 subnets will be automatically provisioned for each Kubernetes Namespace.
I do not want to manually deny each subnet but cover the whole /16 to be not advertised out.
Solution
a. Enable the Global option at the T0
![](https://static.wixstatic.com/media/2ba767_3d5585ad6e6d4464a153fc0ad2207032~mv2.png/v1/fill/w_536,h_347,al_c,q_85,enc_auto/2ba767_3d5585ad6e6d4464a153fc0ad2207032~mv2.png)
b. Create IP Prefix lists.
You need one IP Prefix list for the 172.16.0.0/16 networks and one for ANY network
![](https://static.wixstatic.com/media/2ba767_75c2ee89c13b4dce9ff608c53dd5a5b9~mv2.png/v1/fill/w_381,h_261,al_c,q_85,enc_auto/2ba767_75c2ee89c13b4dce9ff608c53dd5a5b9~mv2.png)
![](https://static.wixstatic.com/media/2ba767_059043bca51a44c4895b7fcc386a3bce~mv2.png/v1/fill/w_524,h_253,al_c,q_85,enc_auto/2ba767_059043bca51a44c4895b7fcc386a3bce~mv2.png)
![](https://static.wixstatic.com/media/2ba767_dc11cf7756204c7ab2beaddd883904d9~mv2.png/v1/fill/w_526,h_260,al_c,q_85,enc_auto/2ba767_dc11cf7756204c7ab2beaddd883904d9~mv2.png)
c. Create a Route Map with the deny Prefix list first followed by the ANY Permit
![](https://static.wixstatic.com/media/2ba767_e774e7ff614f40dc98a91f869ff3a8c5~mv2.png/v1/fill/w_640,h_331,al_c,q_85,enc_auto/2ba767_e774e7ff614f40dc98a91f869ff3a8c5~mv2.png)
d. Last step is to go to the BGP Neighbor → Edit → Address Families and apply the Route Map on the Out Route Map
![](https://static.wixstatic.com/media/2ba767_f5d4ba0b4a304e88a1e52b6ff8c471e8~mv2.png/v1/fill/w_640,h_231,al_c,q_85,enc_auto/2ba767_f5d4ba0b4a304e88a1e52b6ff8c471e8~mv2.png)
Lets look at the routes being advertised again:
en1(tier0_sr)> get bgp neighbor 5.5.5.1 advertised-routes
Status flags: * - best, I - internal
Origin flags: I - IGP, E - EGP, ! - incomplete
Network Next Hop LocPrf MED AS Path
2.2.2.0/29 5.5.5.2 0 0 65300 !
2.2.2.8/29 5.5.5.2 0 0 65300 !
2.2.2.64/27 5.5.5.2 0 0 65300 !
2.3.0.0/24 5.5.5.2 0 0 65300 !
2.4.0.0/24 5.5.5.2 0 0 65300 !
23.23.23.10/32 5.5.5.2 0 0 65300 !
23.23.23.201/32 5.5.5.2 0 0 65300 !
23.23.23.202/32 5.5.5.2 0 0 65300 !
23.23.23.203/32 5.5.5.2 0 0 65300 !
23.23.23.204/32 5.5.5.2 0 0 65300 !
23.23.23.205/32 5.5.5.2 0 0 65300 !
23.23.23.206/32 5.5.5.2 0 0 65300 !
23.23.23.207/32 5.5.5.2 0 0 65300 !
23.23.23.208/32 5.5.5.2 0 0 65300 !
Added Step with Route Aggregation
As you can see above that 23.23.23.x is advertising /32s. The routing table can be further optimized by sending a summary for this route.
Navigate to the BGP Config and hit the Global Edit Button
![](https://static.wixstatic.com/media/2ba767_53cab2ddaa974be6abb857205e0f3d52~mv2.png/v1/fill/w_428,h_389,al_c,q_85,enc_auto/2ba767_53cab2ddaa974be6abb857205e0f3d52~mv2.png)
Add the Prefix that you want to advertise with Summary Only set to Yes
![](https://static.wixstatic.com/media/2ba767_b7d33aabcc11498f8830a9ae08ce8399~mv2.png/v1/fill/w_441,h_383,al_c,q_85,enc_auto/2ba767_b7d33aabcc11498f8830a9ae08ce8399~mv2.png)
en1> vrf 11
en1(tier0_sr)> get bgp neighbor 5.5.5.1 advertised-routes
Status flags: * - best, I - internal
Origin flags: I - IGP, E - EGP, ! - incomplete
Network Next Hop LocPrf MED AS Path
2.2.2.0/29 5.5.5.2 0 0 65300 !
2.2.2.8/29 5.5.5.2 0 0 65300 !
2.2.2.64/27 5.5.5.2 0 0 65300 !
2.3.0.0/24 5.5.5.2 0 0 65300 !
2.4.0.0/24 5.5.5.2 0 0 65300 !
23.23.23.0/24 5.5.5.2 0 0 65300 !
As you can see that now only 23.23.23.0/24 is being advertised out.
VMware Blogs: https://blogs.vmware.com/customer-experience-and-success/feeds/hammad-alam
Comentarios