Anycast Stateless Services with NSX-T, Implementation
Tags: bgp, datacenternetworking, ebgp, homelab
Published: 2020-03-08 00:47:11

---
title: Anycast Stateless Services with NSX-T, Implementation
published: true
date: 2019-10-26 23:01:00 UTC
tags: BGP,Datacenter Networking,eBGP,Home Lab
canonical_url: 
---

First off, let's cover what's been built so far:

[![](https://1.bp.blogspot.com/-NdlJCw36PJU/XbTKwh-Y1BI/AAAAAAAAA2U/-KGNAiyaNGYMi28ysjDfSI2NpNqEuuMTQCLcBGAsYHQ/s1600/Untitled%2BDiagram.png)](https://1.bp.blogspot.com/-NdlJCw36PJU/XbTKwh-Y1BI/AAAAAAAAA2U/-KGNAiyaNGYMi28ysjDfSI2NpNqEuuMTQCLcBGAsYHQ/s1600/Untitled%2BDiagram.png)
To set up an anycast vIP in NSX-T after standing up your base infrastructure (already depicted and configured), all you have to do is **stand up a load balanced vIP at multiple sites. NSX-T takes care of the rest. Here's how:**  
Create a new load balancing pool.  

[![](https://1.bp.blogspot.com/-yGFDI4j3i68/XbTNJBh6ieI/AAAAAAAAA2s/rXP4I9DLCrka9AwA1s3mqAa1ufHWstCxQCLcBGAsYHQ/s640/26oct19-2.PNG)](https://1.bp.blogspot.com/-yGFDI4j3i68/XbTNJBh6ieI/AAAAAAAAA2s/rXP4I9DLCrka9AwA1s3mqAa1ufHWstCxQCLcBGAsYHQ/s1600/26oct19-2.PNG)
  

[![](https://1.bp.blogspot.com/-RzjmQE6_d8g/XbTNJCUydVI/AAAAAAAAA2o/22m4j0rYgwQG_bw3aZqONdWZCbMG00YRgCLcBGAsYHQ/s640/26oct19-3.PNG)](https://1.bp.blogspot.com/-RzjmQE6_d8g/XbTNJCUydVI/AAAAAAAAA2o/22m4j0rYgwQG_bw3aZqONdWZCbMG00YRgCLcBGAsYHQ/s1600/26oct19-3.PNG)
Create a new load balancer:  

[![](https://1.bp.blogspot.com/-7kf5HxlPyXc/XbTL9VMVHnI/AAAAAAAAA2c/wTEBVlb5B24JkQq0IButHKES5rpqLPitwCLcBGAsYHQ/s1600/26oct19-1.PNG)](https://1.bp.blogspot.com/-7kf5HxlPyXc/XbTL9VMVHnI/AAAAAAAAA2c/wTEBVlb5B24JkQq0IButHKES5rpqLPitwCLcBGAsYHQ/s1600/26oct19-1.PNG)
Create a new virtual server:  

[![](https://1.bp.blogspot.com/-6br2rMxUsHo/XbTNJCS3z-I/AAAAAAAAA2w/iOSDC5IqeZ4INrXB-PxYt__Zt1Gm4IZ4gCEwYBhgL/s1600/26oct19-4.png)](https://1.bp.blogspot.com/-6br2rMxUsHo/XbTNJCS3z-I/AAAAAAAAA2w/iOSDC5IqeZ4INrXB-PxYt__Zt1Gm4IZ4gCEwYBhgL/s1600/26oct19-4.png)
If your Tier-1 gateways have the following configured, you should see a new /32 in your routing table:  

[![](https://1.bp.blogspot.com/-4psNxiRFr50/XbTN-qvTN5I/AAAAAAAAA28/_f9gMZskPvEjRTvbt8DO7pZeMpSCVmpmgCLcBGAsYHQ/s320/26oct19-5.PNG)](https://1.bp.blogspot.com/-4psNxiRFr50/XbTN-qvTN5I/AAAAAAAAA28/_f9gMZskPvEjRTvbt8DO7pZeMpSCVmpmgCLcBGAsYHQ/s1600/26oct19-5.PNG)
Repeat the process for creating a new load balancer and virtual server on your second Tier-1 interface, pinned to a completely separate Tier-0. If multipath is enabled, you should see entries like this in your routing table:  

  

[![](https://1.bp.blogspot.com/-b-4KPn1ExWM/XbTOd7WPIoI/AAAAAAAAA3I/myh8IYhB7rYLp7scBzZych6jrW5GuHVyACLcBGAsYHQ/s1600/26oct19-6.PNG)](https://1.bp.blogspot.com/-b-4KPn1ExWM/XbTOd7WPIoI/AAAAAAAAA3I/myh8IYhB7rYLp7scBzZych6jrW5GuHVyACLcBGAsYHQ/s1600/26oct19-6.PNG)
  
It really is that easy. This process can be repeated for load balancers, and (when eventually supported) multisite network segments.  
  
A few caveats:  
  

- State isn't carried through: if you're using a stateful service, use your routing protocols (AS-PATH is an easy one) to ensure that devices consistently forward to the same load balancer
- Anycast isn't load balancing: This is easy here, as NSX-T can do both. This won't protect your servers from overload unless you use one.
- Use the same server pool: It was (hopefully) apparent that I used the same pool everywhere. Try to keep regional configurations consistent, to ensure that new additions aren't missed for a pool. Server pools should be configured on a **per region or per transport zone basis.**

Some additional light reading on anycast implementations:

[Cloudflare's Anycast](https://www.cloudflare.com/learning/dns/what-is-anycast-dns/)

[Google Public DNS](https://developers.google.com/speed/public-dns/faq)

[F5 BIG-IP DNS](https://techdocs.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/bigip-dns-services-implementations-13-0-0/11.html)