VMware NSX

Networking and security inside the hypervisor

NSX moves switching, routing and firewalling into the ESXi kernel, so the physical network only carries IP between hosts. This page explains how it is built, how traffic really flows through it, and how I prove which layer holds a fault.

  • Geneve
  • Tier-0 and Tier-1
  • Edge nodes
  • BGP to the fabric
  • Distributed firewall
  • Micro segmentation
  • Traceflow
  • VCF
Two ESXi hosts with NSX and an Edge Two ESXi hosts each run virtual machines with a distributed firewall at every virtual NIC and a distributed router in the kernel. A Geneve tunnel joins their tunnel endpoints across the physical network. An Edge node runs the Tier-0 service router and peers with the top of rack switches using BGP. ESXI HOST 1 ESXI HOST 2 Web App DB Web 2 Distributed router Distributed router TEP TEP Geneve, UDP 6081 Physical network: IP only, MTU 1700 or more Edge · Tier-0
Live view · switching, routing and firewalling in every host
Why NSX

A firewall on every virtual machine, not just at the edge

In a classic data centre the firewall sits at the perimeter, and servers in the same VLAN can reach each other freely. NSX puts switching, routing and a stateful firewall into the hypervisor kernel, so every virtual NIC (network interface card) has its own checkpoint and the physical network only carries IP between hosts.

Perimeter only security compared with a distributed firewall With a perimeter firewall only, traffic from the internet is checked, but a compromised web server can reach the database in the same VLAN without any check. With the NSX distributed firewall, every virtual NIC enforces policy, so the web server can reach the app tier on its allowed port and nothing else, and the attempt to reach the database is dropped at the source. Perimeter firewallnorth to south only ONE SEGMENT, NO CHECKS INSIDE POLICY AT EVERY VIRTUAL NIC Web10.30.1.10 App10.30.1.20 Database10.30.1.30 8443 A compromised web server reaches the database Dropped at the web server's own virtual NIC

Swipe sideways to see the whole diagram.

Perimeter only. The firewall checks traffic coming in from outside, but the three tiers share a segment. Once an attacker controls the web server, nothing stops it reaching the database directly.

Distributed firewall. NSX enforces a stateful firewall at every virtual NIC, inside the same subnet. Web reaches App on port 8443, and the attempt to reach the database is dropped before the packet leaves the web server's host.

Animation

Speed

A new segment, gateway or rule is a software change through the NSX Manager or its API (application programming interface). The physical switches do not change.

Policy that follows the workload

Rules are written against groups and tags, and the firewall state moves with a virtual machine during vMotion.

The trade off

There is a new layer to troubleshoot, and changes depend on healthy managers. Forwarding carries on with the last known state if the managers fail, so I plan for both.

Architecture

Four planes, one desired state

NSX separates deciding from forwarding. The management plane holds what I asked for. The central control plane works out what each host needs to know. A local agent on every host programs the kernel, and the data plane forwards packets.

How NSX turns a change into forwarding state An administrator or the API sends a change to the NSX Manager cluster of three nodes. The management plane stores it as desired state. The central control plane, which runs in the same appliances, computes MAC, ARP and tunnel endpoint tables, routes and firewall rules, and pushes them only to the hosts that need them. A local control plane agent on each host and Edge programs the kernel. If two managers fail, the data plane keeps forwarding with the last state, but no changes can be made. Admin or APIREST, Terraform NSX MANAGER CLUSTER Manager 1managementand control Manager 2managementand control Manager 3managementand control Host 1 agentlocal control Host 2 agentlocal control Edge agentlocal control Data plane: ESXi kernel modules and the Edge datapathforwards with the state it was givenkeeps forwarding with the last state only to hosts that need it no quorum: no changes

Swipe sideways to see the whole diagram.

Step 1
  1. I make a change in the UI (user interface), the REST (representational state transfer) API or Terraform. The management plane checks it and stores it as desired state in a database replicated across three Manager appliances.

  2. The central control plane, inside the same appliances since NSX-T 2.4, works out MAC, ARP (Address Resolution Protocol) and tunnel endpoint tables, routes and firewall rules. It pushes them only to the hosts and Edges that need each segment or rule.

  3. An agent on each host and Edge receives its share and programs the kernel or the Edge datapath. It also reports what it learns, such as a new virtual machine's MAC and IP address.

  4. Packets are switched, routed and firewalled in the ESXi kernel, and in the Edge's DPDK (Data Plane Development Kit) datapath for traffic leaving the overlay. No packet passes through the Managers.

  5. With one Manager down the cluster still has quorum and works. With two down there is no quorum: no changes, and new virtual machines or host reboots suffer. The data plane keeps forwarding with the last state.

Manager cluster

Three appliances, never one in production, spread across hosts and datastores with anti affinity rules. A cluster virtual IP in one subnet, or an external load balancer, gives a single address. Storage latency is a common cause of trouble, so their datastores must be fast and monitored.

Compute managers

NSX is independent of vCenter but registers it as a compute manager for inventory, Edge deployment and the distributed switch. If that link breaks, host preparation and dynamic groups go stale, but forwarding continues.

Policy and manager modes

The policy API is declarative and is the main UI and API today. The older manager API is imperative and hidden by default. The CLI (command line interface) still shows older names, such as logical switch for segment and logical router for gateway.

NameWhat it wasWhat changed
NSX-VVXLAN (Virtual Extensible LAN) overlay tied to one vCenter, with Edge services gateways and separate controller VMsEnd of general support in January 2022. Migration Coordinator moves estates to the newer product.
NSX-T 2.x and 3.xGeneve overlay independent of vCenter, Tier-0 and Tier-1 gateways, control plane inside the Managers from 2.4Version 3 added VDS (vSphere Distributed Switch) 7 as a host switch, virtual routing and forwarding (VRF) Lite and EVPN (Ethernet virtual private network) on the Tier-0, and OSPF (Open Shortest Path First) from 3.1.1.
VMware NSX 4The same product renamed from version 4.0 in 2022N-VDS removed on ESXi hosts, which must use VDS 7 or later. Edges keep their own switch.
NSX 9Released with VMware Cloud Foundation (VCF) 9 in 2025Bundled with VCF. Security features such as the distributed firewall are sold separately as vDefend.
Transport

Transport zones decide which hosts see which networks

A transport node is a prepared ESXi host or an Edge. Each one has tunnel endpoints (TEPs) on a dedicated VLAN. A transport zone is the set of transport nodes that can carry a group of segments: overlay zones for Geneve segments, and VLAN zones for segments tagged on the physical network.

Overlay and VLAN transport zones Three hosts and an Edge each have TEPs. In the overlay zone, Geneve tunnels with BFD join every TEP, so overlay segments appear on every member. In the VLAN zone, the Edge's uplink segments are tagged straight onto the top of rack switches. A host left out of the overlay zone never sees the overlay segments, so a virtual machine placed there has no network. OVERLAY TRANSPORT ZONE VLAN TRANSPORT ZONE Host 1vmk10 TEP Host 2vmk10 TEP Host 3vmk10 TEPnot in the zone EdgeTEP and uplinks Geneve and BFD between every TEP ToR AVLAN 2001 ToR BVLAN 2002 uplink segments, one VLAN per switch New VM: no network Segments appear on every member VLAN segments: Edge uplinks and VLAN workloads "The network is not there on this host"

Swipe sideways to see the whole diagram.

Overlay zone. Every member has TEPs, and NSX builds Geneve tunnels between them with BFD (bidirectional forwarding detection) to track their state. Overlay segments exist on every member, without any change to the physical switches.

VLAN zone. Segments here are tagged straight onto the physical network. They carry Edge uplinks to the top of rack (ToR) switches, one VLAN per switch, and for workloads that must stay on a VLAN but still get the distributed firewall.

Host left out. A host missing from the transport zone, usually configured by hand rather than from the cluster's profile, never receives the overlay segments. A virtual machine placed there has no network, which is why I prepare hosts only from transport node profiles.

Animation

Host preparation, in order

  1. VDS 7 or later in vCenter, with its MTU (maximum transmission unit) at 1,600 or more.
  2. An uplink profile: teaming policy, the TEP transport VLAN and named teaming for Edge uplinks.
  3. A transport node profile for the cluster: host switch, transport zones, uplink profile, TEP addresses from a pool or DHCP (Dynamic Host Configuration Protocol), and the vmnic mapping.
  4. Apply it to the cluster, then check every host shows Success and every tunnel is up.

TEP addressing

Hosts get TEPs as vmk10 and vmk11 on their own TCP/IP (Transmission Control Protocol and Internet Protocol) stack, called vxlan, with its own gateway. A common design gives each rack its own TEP subnet with a gateway in the IP pool, so TEP traffic is routed between racks. Duplicate TEP addresses, an exhausted pool and the wrong transport VLAN are the most common faults.

What NSX needs from the physical networkHow it is checked
TEP VLAN trunked to every host and Edge uplinkshow interface trunk on the switches, and the uplink profile VLAN
MTU of at least 1,600 on every hop. VMware recommends 9,000 on the physical network, with the tunnel endpoint MTU at its 1,700 defaultvmkping ++netstack=vxlan -I vmk10 -d -s 1572 to every remote TEP (1,672 for 1,700)
Routing between per rack TEP subnetsshow ip route for each TEP subnet, and the gateway in the IP pool
Edge TEPs placed correctly when Edge VMs run on prepared hosts. They can share the host TEP VLAN only if the Edge TEP port group is NSX backed. Otherwise they need their own VLAN, routed to the host TEPs.Tunnel status between Edges and hosts, not only between hosts. A wrong placement leaves host to host tunnels up and raises the Edge tunnels down alarm.
Edge uplink VLANs to the switches, with BGP (Border Gateway Protocol) or OSPF and BFDget bgp neighbor summary on the Edge and show bgp ipv4 unicast summary on the switches
Geneve on UDP (User Datagram Protocol) 6081 and BFD allowed between TEP subnetsIdeally no firewall in that path at all
NTP (Network Time Protocol) and DNS (Domain Name System), forward and reverse, for Managers, Edges, hosts and vCenterName lookups and time checks before installing
Geneve

The tunnel between hosts, and the MTU it needs

NSX carries overlay segments between TEPs in Geneve (Generic Network Virtualization Encapsulation) over UDP port 6081. Geneve is defined in Request for Comments (RFC) 8926. It looks like VXLAN, but its header can carry variable length options, which is why NSX asks for more MTU headroom.

How a host builds a Geneve packet The virtual machine's frame enters the host. The host adds an 8 byte Geneve header with the segment's 24 bit VNI and room for options, then a UDP header to port 6081 with a source port hashed from the inner headers. Then it adds an outer IP header from its TEP to the remote TEP, and an outer Ethernet header tagged with the TEP VLAN. The overhead is at least 50 bytes plus options, so NSX asks for an MTU of at least 1,600 and recommends 1,700. Outer Eth14 + 4 tag Outer IP20 bytes UDP 60818 bytes Geneve8 bytes Options0 to 252 Inner frame from the VM14 + up to 1500 Step 1 · The frame from the virtual machine VM A sends a normal Ethernet frame to VM B on the same segment, on another host. The host's MAC table, filled by the control plane, says VM B lives behind host 2's TEP. The distributed firewall has already checked the frame as it left VM A's virtual NIC. Step 2 · Geneve header and options Version, option length in 4 byte units, the O bit for control packets and the C bit for critical options. Protocol type 0x6558 means the payload is an Ethernet frame, then a 24 bit VNI for the segment. Options carry extra metadata. They are why the overhead is not fixed at 50 bytes. Step 3 · UDP header Destination port 6081. The source port is a hash of the inner headers. That gives the physical switches the entropy they need to spread flows across links. Any firewall between TEP subnets must allow UDP 6081 and BFD. Better still, there is none. Step 4 · Outer IP header From host 1's TEP to host 2's TEP, with the do not fragment bit set. TEPs in different racks route through their gateway on the vxlan TCP/IP stack. The physical network sees only TEP to TEP traffic. It never needs the tenant VLANs. Step 5 · Outer Ethernet and the MTU sum The frame is tagged with the TEP transport VLAN. The tag adds 4 bytes to the frame, not the IP MTU. 1,500 + 8 Geneve + 8 UDP + 20 IP + 14 inner Ethernet = 1,550 bytes, before options. So NSX needs at least 1,600 on every hop. VMware recommends 9,000 on the physical network. I prove it from each host with a full size, do not fragment ping between TEPs. Host 1TEP 172.20.1.11 Host 2TEP 172.20.2.12

Swipe sideways to see the whole diagram.

Step 1
  1. VM A sends a frame to VM B on another host. The host finds VM B behind host 2's TEP in the table the control plane gave it.

  2. 8 bytes with the segment's 24 bit VNI (virtual network identifier) and the protocol type for Ethernet, followed by optional metadata of variable length.

  3. 8 bytes of UDP to port 6081. The hashed source port spreads flows across the physical links.

  4. 20 bytes from TEP to TEP with the do not fragment bit set. The physical network only ever routes TEP addresses.

  5. 50 bytes plus options. NSX needs at least 1,600 bytes on every hop, VMware recommends 9,000 on the physical network, and the test is vmkping ++netstack=vxlan -I vmk10 -d -s 1572. If the underlay cannot carry more than 1,500, the NSX overlay is not supported. Fix the underlay, or use VLAN backed segments until it is fixed.

VXLANGeneve
StandardRFC 7348RFC 8926
UDP port47896081
HeaderFixed 8 bytes8 bytes plus options up to 252 bytes
Segment ID24 bit VNI24 bit VNI
Control planeFlood and learn, or BGP EVPNThe NSX central control plane
Underlay MTU1,550 minimum for 1,500 byte hosts1,600 minimum, 1,700 recommended
Where I meet itSwitch fabrics and Cisco ACI (Application Centric Infrastructure)NSX and some other hypervisor overlays

Copying broadcast traffic between hosts

Hierarchical two tier replication compared with head end replication Six hosts sit in three racks, each rack with its own TEP subnet. With head end replication, host 1 sends a separate copy to all five other hosts. With hierarchical two tier replication, the default, host 1 sends one copy to the other host in its own rack and one copy to a proxy TEP in each other rack. Each proxy copies it to the hosts in its own rack. RACK 1 · 172.20.1.0/24 RACK 2 · 172.20.2.0/24 RACK 3 · 172.20.3.0/24 Host 1 Host 2 Host 3proxy Host 4 Host 5proxy Host 6 Five copies leave host 1 Three copies leave host 1, proxies copy locally

Swipe sideways to see the whole diagram.

Hierarchical two tier. The sending host copies the frame to hosts in its own TEP subnet, and to one proxy TEP in each other subnet. Each proxy copies it to the hosts in its rack. It suits a design with a TEP subnet per rack and needs no multicast in the physical network.

Head end. The sending host makes one copy for every other host on the segment. It is simple but puts all the work on the sender's uplinks. With a single TEP subnet, both modes behave the same.

Animation
Segments

A Layer 2 network that lives in software

A segment, once called a logical switch, is a Layer 2 network. An overlay segment gets a VNI and travels in Geneve. A VLAN segment is tagged on the physical network. Either way it appears in vCenter as a port group, and every port gets the distributed firewall.

How hosts learn where virtual machines live VM A powers on in host 1 on segment Web. Host 1's agent reports its MAC, IP and TEP to the central control plane. The control plane updates the segment's MAC, ARP and TEP tables and pushes them only to host 2, which also has the segment, and not to host 3, which does not. When VM B on host 2 sends an ARP request for VM A, host 2 answers it locally from its ARP table. Central control planein the Managers Host 1segment Web Host 2segment Web Host 3no Web segment VM A VM B nothing sent Host 2 tables for segment Web MAC tableARP table TEP table waitingwaitingHost 2 VM A MAC via host 1 TEP 10.30.1.10 is VM A MAC Host 1, Host 2 ARP answered locally

Swipe sideways to see the whole diagram.

Step 1
  1. VM A powers on in host 1. The host learns its MAC address and, from ARP, DHCP or VMware Tools, its IP address. The local agent reports both, with host 1's TEP, to the central control plane.

  2. The control plane updates three tables for the segment: MAC to TEP, IP to MAC, and which TEPs carry the segment. It pushes them only to hosts that have the segment, so host 3 receives nothing.

  3. VM B on host 2 sends an ARP request for VM A. Host 2 answers from its ARP table, so the broadcast never crosses the network. Unknown entries fall back to replication.

IP and MAC discovery

The IP discovery profile learns addresses by ARP and neighbour discovery snooping, DHCP snooping or VMware Tools, and feeds both the ARP table and the firewall's address sets. MAC discovery allows MAC learning for nested hosts and appliances.

SpoofGuard

SpoofGuard binds a virtual NIC to its IP and MAC. A virtual machine given a new IP address cannot talk until the binding is approved, which is the first thing I check when a readdressed server goes silent.

Segment security

The segment security profile filters BPDUs, blocks rogue DHCP servers, guards router advertisements and rate limits broadcast traffic. The QoS profile marks or limits traffic per segment.

Gateways

Tier-0 for the provider, Tier-1 for each tenant

NSX routes in two tiers. A Tier-0 gateway connects to the physical network through Edges. Tier-1 gateways connect segments for each tenant or application. Each gateway has a distributed router (DR) in every host's kernel, and may have a service router (SR) on an Edge for anything stateful.

Traffic through Tier-1 and Tier-0 gateways, with and without a Tier-1 service router The top of rack switches peer with the Tier-0 service router on the Edges. The Tier-0 distributed router links to the Tier-1 distributed router over a router link from 100.64.0.0/16. The Tier-1 connects the Web and App segments. Without a Tier-1 service router, traffic between segments is routed in the host and traffic to the outside goes Tier-1 DR, Tier-0 DR, Tier-0 SR. When NAT is added, the Tier-1 gets a service router on an Edge and every packet leaving the Tier-1 passes through it. Top of rack switches Tier-0 gateway SR on Edges DR in hosts Tier-1 gateway SR: NAT DR in hosts Segment Web10.30.1.0/24 Segment App10.30.2.0/24 router link 100.64.0.0/16 transit 169.254.0.0/24 Web to App: routed on the host Out: via the Tier-1 SR on an Edge

Swipe sideways to see the whole diagram.

Distributed only. The Tier-1 has no Edge cluster, so it is a DR in every host. Web to App is routed on the source host. Traffic to the outside goes Tier-1 DR, Tier-0 DR, then a Geneve tunnel to an Edge where the Tier-0 SR talks BGP to the switches.

With a service router. Adding NAT (network address translation), a gateway firewall, a VPN (virtual private network) or a load balancer gives the Tier-1 an active and standby SR on an Edge. Web to App still routes on the host, but everything leaving the Tier-1 now passes through that SR. Slowness that starts when NAT is enabled is often this extra hop.

Animation

Distributed router

The DR has an interface in every connected segment, with the same gateway IP and the same virtual MAC on every host, so a virtual machine keeps its gateway after vMotion. Routing between segments never leaves the source host.

Service router

The SR lives only on Edges and holds everything that needs a central point: uplinks, BGP and OSPF, NAT, the gateway firewall, VPN and load balancing. The DR and SR are joined by an internal transit link.

Internal address rangeDefaultWhere it appears
Tier-1 to Tier-0 router links100.64.0.0/16, a /31 per linkEdge get route output, host DR tables and traceroutes. It overlaps the RFC 6598 range used for carrier NAT and some cloud links, so I check before build.
Transit between SR and DR169.254.0.0/24Inside each gateway, between its SRs and its DR
Single tier: segments on the Tier-0Two tier: segments on Tier-1s
SimplicityFewer objectsOne more logical hop, still in the kernel
Blast radiusEvery change touches the Tier-0 and its BGPApplication changes stay on Tier-1s
Stateful servicesForce the Tier-0 into active and standbyRun on Tier-1 SRs while the Tier-0 stays active and active
TenancyWeakA natural boundary per tenant or application

Projects and virtual private clouds

From NSX 4.1, Projects give each tenant its own slice of NSX: its own administrators, Tier-1 gateways, segments, groups and distributed firewall rules, on a Tier-0 and Edge cluster the enterprise administrator may share between Projects. From NSX 4.1.1, a Project can hold virtual private clouds (VPCs), where an application team creates its own subnets, NAT and rules within quotas. NSX 9 in VCF 9 builds on the same model.

Edges and BGP

Where the overlay meets the physical network

An Edge node is a transport node that runs service routers. Tier-0 SRs peer with the top of rack switches, normally with eBGP and BFD. The choice between active and active or active and standby decides throughput, failover and which stateful services the gateway can run.

Tier-0 active and active compared with active and standby Two Edges each have an uplink to two top of rack switches on separate VLANs, giving four eBGP sessions with BFD. In active and active mode both Edges forward and the switches load share across them with equal cost paths, up to eight. In active and standby mode only one Edge forwards, which stateful services such as NAT and the gateway firewall need, and the standby takes over if the active fails. ToR AAS 65001 · VLAN 2001 ToR BAS 65001 · VLAN 2002 4 eBGP sessions with BFD Edge 1Tier-0 SR activeTier-0 SR active Edge 2Tier-0 SR activeTier-0 SR standby HostsTier-0 DR, ECMP Both Edges forward One forwards, state is safe

Swipe sideways to see the whole diagram.

Active and active. Every Edge forwards, and hosts and switches load share across up to eight paths. Losing an Edge removes one path. Classic releases allow only stateless reflexive NAT in this mode, and newer releases add a stateful option for some services, so I check the version.

Active and standby. One Edge forwards and the other waits, with its routes made less attractive. NAT, the gateway firewall and VPN need this mode in classic releases. Failover is brief, but half the capacity sits idle.

Animation
Edge sizevCPU and memoryTypical use
Small2 vCPU, 4 GBProof of concept only
Medium4 vCPU, 8 GBLight production and labs
Large8 vCPU, 32 GBMost production Tier-0 Edges
Extra Large16 vCPU, 64 GBHeavy services such as load balancing or VPN
Bare metalPhysical serverThe highest throughput and fastest failover

VM form factors as documented for NSX 4. The Edge datapath polls its cores with DPDK, so vCenter shows high CPU even when the Edge is quiet. get dataplane cpu stats shows the real load.

The gates a new segment's route passes before the network can reach it A new segment's subnet passes five gates. It must be connected to a Tier-1. The Tier-1 must advertise connected segments. The Tier-0 must redistribute Tier-1 connected routes into BGP. Prefix lists and route maps on the Tier-0 and on the switches must allow it. Finally the switches must send a route back, usually a default, so return traffic has a path. Segment10.30.5.0/24 Tier-1advertise Tier-0redistribute Filtersboth sides ToRBGP table connected connected segments Tier-1 connected prefix allowed default back return path: default route to the Tier-0 Gate 1: the segment is attached to a Tier-1 Gate 2: route advertisement on the Tier-1 Gate 3: redistribution into BGP on the Tier-0 Gate 4: route maps and prefix lists allow it Gate 5: a route back for the return traffic

Swipe sideways to see the whole diagram.

Step 1
  1. The segment must be connected to a Tier-1 gateway, and that Tier-1 linked to the Tier-0. A segment with no gateway has nowhere to route.

  2. The Tier-1 advertises only what is ticked: all connected segments and service ports, NAT IPs, load balancer addresses, static routes and others, each one separately.

  3. The Tier-0 redistributes Tier-1 connected routes into BGP, optionally through a route map. I check with get route on the Tier-0 SR, where the subnet shows as t1c.

  4. The Tier-0 sends only NSX prefixes, and the switches accept only NSX ranges. get bgp neighbor 192.0.2.1 advertised-routes on the Edge and show bgp ipv4 unicast 10.30.5.0/24 on the switch prove each side.

  5. The switches send a default route, or the routes NSX needs, back to the Tier-0. Without it, traffic reaches the virtual machine and the reply has nowhere to go.

BGP to the switches

eBGP from each Edge to both switches: two Edges and two switches make four sessions. A private AS (autonomous system) for the Tier-0, such as 65100, different from the switches. BFD on every session, because NSX's default BGP timers are 60 seconds keepalive and 180 seconds hold. Multipath on both sides. Prefix lists both ways. If two sites reuse one AS, the Tier-0 neighbour has an allowas-in option so it accepts routes that already carry its own AS.

Edge clusters and failure

Edges sit in an Edge cluster, grouped into failure domains, typically one per rack, so the active and standby Tier-1 SRs never share a rack. An Edge is declared down when BFD to its peers is lost over both the management and TEP networks. A Tier-0 SR also fails over when all of its BGP sessions are down.

OSPF or static

The Tier-0 also supports OSPF from NSX-T 3.1.1, and static routes with BFD tracking the next hops. I prefer BGP for its filtering and load sharing, but I pick what the operations team can support at 3am.

VRF Lite, EVPN and Federation

A parent Tier-0 can hold VRF gateways, each with its own routing table and BGP sessions over tagged interfaces. The Tier-0 can also speak EVPN to a data centre gateway. Federation stretches policy and segments across sites through a Global Manager, with remote TEPs on the Edges.

NAT type on a gateway SRWhat it doesWatch for
SNAT (source NAT)Changes the source address of outbound trafficStateful, so active and standby in classic releases
DNAT (destination NAT)Publishes a service on a public or shared addressThe NAT address must be advertised and redistributed
ReflexiveStateless one to one translationSuits an active and active Tier-0
No SNAT and No DNATExemptions for traffic that must keep its addressRules apply in priority order, lowest number first

The distributed firewall sees a virtual machine's real address. On a gateway, each NAT rule's Firewall setting decides whether the gateway firewall matches the internal address, the external address, or is bypassed.

Distributed firewall

First match wins, category by category

The distributed firewall is a stateful firewall in the ESXi kernel, one instance per virtual NIC. Rules are written once in the NSX Manager and pushed to the hosts that need them. They are read in fixed categories, top to bottom, and the first match decides. This is micro segmentation: a policy boundary around every workload, not only around every subnet.

How the distributed firewall reads its categories Rules sit in six layers read from top to bottom: Ethernet, Emergency, Infrastructure, Environment, Application and the default rule. A DNS query from an app server matches an Infrastructure allow and stops there. A test server trying to reach production matches an Environment drop. Web to App on port 8443 matches an Application allow. Anything else reaches the default rule, which I set to drop with logging once the rules are proven. Ethernet · Layer 2, stateless Emergency · quarantine, break glass Infrastructure · DNS, NTP, AD, backup Environment · prod, test, PCI Application · per application tiers Default rule · drop and log, once set Layer 2 rules,read first Quarantine a hostin seconds App to DNS 53allowed, stops here Test to Proddropped here Web to App 8443allowed Anything elsedropped, logged Top to bottom across all categories: first match wins

Swipe sideways to see the whole diagram.

Step 1
  1. Layer 2 rules by MAC address and EtherType are read first and are always stateless.

  2. Rules that must win over everything else, such as quarantining a compromised host or a break glass allow during an incident.

  3. Shared services every workload needs: DNS, NTP, Active Directory, patching, backup and monitoring. An allow here is final, so a DNS query never reaches later categories.

  4. Broad separation between environments and zones, such as test from production or PCI (Payment Card Industry) from everything else.

  5. Per application rules between tiers, written against groups and tags rather than IP addresses, each policy ending in a logged deny.

  6. Out of the box it allows everything. I change it to drop with logging only after flows are learned and every application has its rules, under a planned change with a quick rollback.

Groups and tags

Rules use groups. Members can be static, such as virtual machines, segments, IP ranges or Active Directory groups, or dynamic, such as every virtual machine tagged app|payroll and tier|web. Renaming a virtual machine or removing a tag silently changes the firewall, so I control who can tag, automate it, and review effective members regularly.

Applied To

Applied To decides which virtual NICs receive a rule. Narrowing it saves memory and avoids accidental matches. Too narrow, such as only the source group, and the destination never sees the allow, so its own default deny drops the traffic. I apply rules to both ends, or to the application's group.

Context profiles

App ID matches the real Layer 7 application whatever the port. FQDN (fully qualified domain name) rules need a DNS snooping rule with the DNS context profile placed above them. Identity firewall rules match Active Directory groups, which suits virtual desktops. All of these cost host CPU and need the right licence.

Exclusion list and TCP strict

The exclusion list removes the firewall from a virtual machine entirely. Adding one "to test the firewall" must be a recorded emergency change, reversed afterwards. TCP strict drops TCP that did not start with a handshake, so I test it against long lived sessions first.

Distributed firewallGateway firewall
Where it runsESXi kernel, at every virtual NICOn a Tier-0 or Tier-1 SR on the Edges
TrafficEast to west, even inside one subnetNorth to south through that gateway
ScaleGrows with every host addedLimited by Edge capacity
Proof of a dropTraceflow shows the rule ID at a virtual NICTraceflow shows the drop at the SR

Moving to default deny

I learn flows with logging, add infrastructure rules, then per application rules ending in a logged deny. I watch the logs, and only then change the default rule under a planned change. Inside the data centre I prefer reject for fast failure. At security boundaries, policy decides.

Distributed intrusion detection and prevention

An intrusion detection system (IDS) and intrusion prevention system (IPS) can run at each virtual NIC. I start in detect only, tune false positives, then move chosen signatures to prevent under change. Isolated networks need an offline path for signature updates.

Neither replaces the perimeter

The distributed firewall is a lock on every office. The gateway firewall is the door to the building. An accredited perimeter firewall still guards the boundary where policy requires one.

Packet walks

Follow the packet through the hosts

Most NSX faults become obvious once I know which path a packet should take. These walks cover the four cases that matter most: same host, across hosts, routed between segments, and out through the Edges.

East to west packet walks between virtual machines Host 1 runs VM A and VM C on the Web segment. Host 2 runs VM B on the Web segment and VM D on the App segment. VM A to VM C stays inside host 1. VM A to VM B leaves through host 1's TEP in a Geneve tunnel with the Web segment's VNI and arrives at host 2. VM A to VM D is routed by the distributed router on host 1, then tunnelled with the App segment's VNI, and host 2 only switches it. The reply is routed on host 2 and tunnelled back with the Web segment's VNI. The distributed firewall checks every packet as it leaves and enters each virtual NIC. ESXI HOST 1 ESXI HOST 2 VM AWeb .1.10 VM CWeb .1.11 VM BWeb .1.20 VM DApp .2.20 Tier-1 DR · host 1 Tier-1 DR · host 2 TEP TEP Physical switch Same host: no Geneve, no physical network Geneve with the Web segment's VNI Routed on host 1, Geneve with the App VNI Reply routed on host 2, Web VNI back

Swipe sideways to see the whole diagram.

Step 1
  1. The ARP request is answered from the host's table. The firewall checks the packet leaving VM A and entering VM C, and the host switches it between them. No physical NIC, no Geneve. If this works but the next case fails, the fault is in the tunnels or the underlay.

  2. Host 1 finds VM B behind host 2's TEP. It wraps the frame in Geneve with the Web segment's VNI and sends it TEP to TEP over the physical network. Host 2 removes the outer headers and delivers to VM B. A capture on the uplink shows UDP 6081 between the TEPs.

  3. VM A's gateway is the Tier-1 DR on its own host. The DR routes the packet into the App segment, lowers the TTL (time to live) and tunnels it with the App segment's VNI. Host 2 only switches it to VM D.

  4. VM D's reply is routed by the DR on host 2 and comes back with the Web segment's VNI. A capture filtered on one VNI shows only half of the conversation, which catches people out.

North to south packet walk through the Edges A virtual machine sends to an address outside. The firewall checks it at the virtual NIC, then the Tier-1 and Tier-0 distributed routers on the same host route it. The Tier-0 DR picks an Edge by equal cost multipath and tunnels the packet in Geneve to that Edge. The Tier-0 SR on the Edge routes it to the top of rack switches using a BGP route. The reply may come back through the other Edge, where the SR and both distributed routers route it before it is tunnelled to the host and checked on the way in. ESXI HOST VM · 10.30.1.10 Tier-1 DR Tier-0 DR TEP Edge 1Tier-0 SR Edge 2Tier-0 SR, DRs ToR switchesBGP, ECMP Outside Geneve ECMP chose Edge 1 Return chose Edge 2

Swipe sideways to see the whole diagram.

Step 1
  1. The firewall checks the packet at the virtual NIC. The Tier-1 DR and the Tier-0 DR, both in the host's kernel, route it across the 100.64 router link without leaving the host.

  2. The Tier-0 DR has equal cost routes to the SRs on every Edge. It picks one and tunnels the packet in Geneve from the host's TEP to that Edge's TEP.

  3. The Tier-0 SR on Edge 1 uses its BGP learned route and sends the packet out of its uplink VLAN to the top of rack switches.

  4. The switches load share too, so the reply may arrive at Edge 2. Its Tier-0 SR, Tier-0 DR and Tier-1 DR route it on the Edge, then tunnel it to the host, where the firewall checks it on the way in. Different Edges each way is normal, unless a stateful firewall sits above the switches.

Troubleshooting

Traceflow first, then prove the layer

Traceflow injects a test packet at a source virtual NIC and reports every point it was seen, forwarded, delivered or dropped, including the firewall rule ID. It tells me which layer to look at. Pick a symptom to see where the cause usually sits.

Where common NSX faults sit in the stack Five layers from the underlay at the bottom to the firewall at the top. Traffic that works on one host but not across hosts points at tunnels or the underlay. Large transfers that stall point at the underlay MTU. A new segment that cannot be reached points at gateways and routing. BGP down to the switches points at routing and the uplink VLANs. An application broken by a rule change points at the firewall. A host showing Partial Success points at host preparation and the control plane. Distributed firewall and groups Gateways, routing and BGP Control plane and host preparation Tunnels and TEPs Underlay, VLANs and MTU check order Symptom Usual cause VMs talk on one host butnot across hostsTEP VLAN not trunked, wrongtransport VLAN, no route betweenTEP subnets, duplicate TEP IP,or UDP 6081 blocked Pings work, file copies andSSH sessions stallA host port, port channel,peer link or routed link below1,600 bytes, often a new orreplaced device A new segment cannot bereached from the networkTier-1 advertisement or Tier-0redistribution not ticked, aprefix list blocking it, or noroute back to NSX BGP from the Tier-0 to theswitches is downUplink VLAN missing on thetrunk to the Edge's host, wrongAS, password or BFD timers,or TCP 179 filtered An application broke straightafter a firewall changeA deny above an allow, a groupthat lost members, Applied Totoo narrow, or a service portmissing A host shows Partial Successor preparation failedHost needs maintenance mode,DNS or certificates broken,wrong vmnic mapping, VDS tooold or TEP pool exhausted

Swipe sideways to see the whole diagram.

Prove the tunnels. Tunnel status and BFD, then a full size TEP ping, then the switch trunks and VLANs.

Small works, big fails. A do not fragment TEP ping at 1,572 bytes of data fails while a small one works. Check every hop.

Follow the gates. Attached, advertised, redistributed, allowed, and a route back.

Both ends, then the path. Neighbour state on the Edge and the switch, then the uplink VLAN, ARP and filters.

Back out first. Roll back under emergency change, then use Traceflow and rule hits to find the cause.

Read the failing step. The node status names it, then check software, connectivity and the profile.

Animation

Same segment works on one host, not across hosts

  1. Tunnel status in the UI, then on the host nsxdp-cli bfd sessions list.
  2. TEP addresses and MTU: esxcfg-vmknic -l.
  3. Reach the remote TEP: vmkping ++netstack=vxlan -I vmk10 172.20.2.12, then add -d -s 1572.
  4. On the switches: show interface trunk, show vlan id 120 for the TEP VLAN, and show mac address-table vlan 120.
  5. Control plane: the host connected to the Managers with get managers and get controllers in nsxcli, and the segment's tables with get logical-switch 69633 mac-table and get logical-switch 69633 vtep-table, using the segment's VNI.
  6. If one host only: compare its switch ports, vmnic mapping and TEP addresses with a working host.

Fix: correct the VLAN, trunk, route, rule or MTU in the underlay. Prevention: hosts prepared only from profiles, and full size TEP pings in every acceptance test.

WhereCommand or toolWhat it tells me
NSX ManagerTraceflowEvery point a test packet was seen, delivered or dropped, with the rule ID
Edgeget logical-routers, then vrf 1Every Tier-0 and Tier-1 SR and DR on the Edge, then enter one
Edgeget route, get bgp neighbor summaryRoutes with their source, and BGP peers with prefix counts
Edgeget tunnel-ports, get edge-cluster statusTunnels to remote TEPs, and the health of each Edge
Edgeget high-availability status, get dataplane cpu statsWhich SR is active, and the real datapath load
ESXi hostesxcfg-vmknic -l, vmkping ++netstack=vxlanTEP addresses and MTU, and full size tunnel tests
ESXi hostnsxdp-cli bfd sessions list, esxcli network ip route ipv4 list -N vxlanBFD state to every remote TEP, and the TEP routes
ESXi hostpktcap-uw --dvfilter with PreDVFilter and PostDVFilterCaptures before and after the firewall, which proves a drop
nsxcli on a hostget firewall packetlog last 20, get logical-switch 69633 mac-table, get logical-switch 69633 arp-table and get logical-switch 69633 vtep-tableRecent firewall hits, and the MAC, ARP and TEP tables for a segment
nsxcli on a hostget managers, get controllers, get firewall statusThe host connected to the Managers, and the firewall enabled

Command names change between releases, and newer releases rename some Edge commands. I check the CLI reference for the version in front of me.

NSX, ACI and EVPN

The same idea, built in different places

NSX, Cisco ACI and a VXLAN EVPN fabric all separate the network people use from the network that carries it. NSX does it in the hypervisor, the other two in the switches. Knowing one makes the others easy to read.

VMware NSXCisco ACIVXLAN EVPN
Tunnel endpointsHosts and EdgesLeavesLeaves
EncapsulationGeneve, UDP 6081VXLAN basedVXLAN, UDP 4789
Control planeNSX central control planeAPIC (Application Policy Infrastructure Controller), COOP (Council of Oracle Protocol) and MP-BGP (Multiprotocol BGP)MP-BGP EVPN
Policy enforcementDistributed firewall at the virtual NICContracts on the leavesACLs or external firewalls
GatewayDistributed router in every hostPervasive gatewayAnycast gateway
Exit to the outsideTier-0 SR on the EdgesL3Out on border leavesBorder leaves
ManagementNSX Manager clusterAPIC clusterCLI, Nexus Dashboard
Cisco ACI conceptNearest NSX concept
APIC clusterNSX Manager cluster
Endpoint groupGroup
ContractFirewall rule with services
Bridge domain and subnetSegment with a gateway
VRFTier-1 or Tier-0, or a Tier-0 VRF
L3Out on border leavesTier-0 uplinks on Edges
Leaf VTEP (VXLAN tunnel endpoint)Host TEP on a vmkernel port

NSX on top of a fabric

NSX can run over ACI or a VXLAN EVPN fabric as its underlay. Then the fabric only sees Geneve between TEPs, so both layers need MTU headroom, and I decide in one recorded decision where virtual machine policy lives.

Licensing, with care

NSX networking comes with VMware Cloud Foundation. Security features such as the distributed firewall and IDS are sold as the vDefend add on, and the Avi load balancer is separate. Older estates may hold different entitlements, so I check before proposing a feature.

Controller based networks

NSX, SD-WAN (software defined WAN) and SD-Access share the same split between management, control and data planes. When the controller is unhealthy, changes stop but forwarding carries on. I troubleshoot them plane by plane.

The switch fabric side of this comparison is on the VXLAN EVPN and ACI page, and vSphere itself is on the servers and virtualisation page.

Engagement

How I would run an NSX programme, from flow capture to refresh

NSX is not in my production history. This is the method I would bring from Cisco ACI overlay work and VMware data centre estates. NSX touches three teams at once: virtualisation, network and security, so I would bring them together early and agree what each one owns before design starts.

How an engagement runs, from first conversation to lifecycle Seven stages from left to right: engage (stakeholders), requirements (FR and NFR), discovery (facts first), design (design docs), build and test (lab and pilot), support (handover), lifecycle (keep current). For each stage the panel shows who I work with and what comes out of it. After the lifecycle stage the loop returns to the start. Engagestakeholders RequirementsFR and NFR Discoveryfacts first Designdesign docs Buildlab and pilot Supporthandover Lifecyclekeep current Step 1 · EngageAgree who owns what before designWho I work withWhat comes outVirtualisation leadNetwork and security leadsApplication ownersGoals: segmentation, speed, mobilityScope: clusters, sites, tenantsOwnership of each NSX layerDecision log and owner matrix Step 2 · RequirementsSegments, gateways and rules, with numbersWho I work withWhat comes outSecurity and riskPlatform engineeringOperations and service deskSegment and gateway modelFirewall policy and zonesThroughput and failover targetsRequirements traced to tests Step 3 · DiscoveryMeasure flows before writing rulesWho I work withWhat comes outvCenter and host teamsNetwork teamApplication ownersCluster and host inventoryFlows between applicationsPhysical network readinessGaps against requirements Step 4 · DesignStandard patterns for every tenantWho I work withWhat comes outDesign authoritySecurity architectsVMware specialistsTransport zones and TEP designTier-0, Tier-1 and Edge designFirewall categories and groupsTest and rollback plans Step 5 · Build and testTraceflow every pilot flow firstWho I work withWhat comes outEngineers and partnerPilot application teamChange advisory boardHosts prepared from profilesFailover and MTU tests passedFirewall rules logging firstMigration wave plan Step 6 · SupportThree teams, one runbookWho I work withWhat comes outVirtualisation operationsNetwork operationsSecurity operationsRunbooks and Traceflow checksAlarms and syslog to the SIEMChange templates for rulesHypercare exit criteria Step 7 · LifecycleNSX, vSphere and VCF move togetherWho I work withWhat comes outBroadcom account teamDesign authorityFinance and licensingRelease and upgrade planInteroperability checksEnd of service plan, 11 October 2027Licence and entitlement review

Swipe sideways to see the whole diagram.

Step 1
  1. I would first agree why NSX is wanted: micro segmentation, faster network changes, tenant isolation or a private cloud platform. Then I would settle who owns the gateways, the firewall rules and the hosts, because that decides the support model.

  2. Functional requirements would cover segments, gateways, NAT, load balancing and firewall policy. Non functional ones would cover north to south throughput, Edge failover time, firewall rule scale and how fast a new application network is delivered. Each one is traced to a test.

  3. I would read the vSphere estate with RVTools, check the physical network for MTU, VLANs and routing, and collect real flows before any firewall rule is written. Application owners confirm which flows are expected and which are noise.

  4. The design would cover transport zones, TEP addressing, Edge clusters and failure domains, Tier-0 peering with the fabric, a Tier-1 per tenant pattern, and the firewall categories and tags. It is the same discipline as an ACI tenant, VRF and contract design, reviewed by the design authority.

  5. Hosts are prepared from transport node profiles, then tested: TEP pings with full size packets, Edge failover, BGP and BFD to the switches, and Traceflow for every pilot flow. Firewall rules start with logging before any default deny, and a partner with NSX delivery depth joins the build.

  6. Each team would get runbooks for its part, a shared triage flow that starts with Traceflow, alarms routed to the right queue, and templates for common rule and segment changes. Hypercare ends when the agreed exit criteria are met.

  7. NSX 4.x, vSphere 8 and VCF 5.2 reach end of service on 11 October 2027, so the move to VCF 9 needs a plan now. Upgrades follow the interoperability matrix and the upgrade order: Edges, then hosts, then the Managers. Licensing is reviewed at every renewal.

Functional requirements

What it must do.

  • Give each application its own segments and gateway, without changes to the physical switches.
  • Control traffic between virtual machines, including inside the same subnet.
  • Route between tenants and to the outside through Tier-0 gateways peered with the fabric.
  • Provide NAT, VPN and load balancing where an application needs them.
  • Keep policy attached to a virtual machine when it moves between hosts.
  • Deliver a new application network from a template or the API.

Non functional requirements

How well it must do it, with a number wherever one can be agreed.

Availability
No single Edge, host or Manager node failure stops traffic. Edge failover in a few seconds or less.
Performance
North to south throughput per Edge cluster agreed and tested, with headroom for growth.
MTU
At least 1,600 bytes on every underlay hop. VMware recommends 9,000 on the physical network, with the tunnel endpoint MTU at its 1,700 default, proved with full size TEP pings.
Security
Default deny between applications, logged denies, and firewall logs sent to the security information and event management (SIEM) system.
Scale
Rules, groups, segments and gateways within the published configuration maximums, with headroom.
Change
A new application network in hours, with peer review for every firewall change.
Recovery
Manager backups every day, tested restores, and a documented rebuild for each Edge.

These are typical starting targets for an NSX platform. Each organisation sets its own, and each one is traced to an acceptance test.

Projects

Where my overlay and VMware experience comes from

NSX is not in my production history, and I say so plainly. What I bring is overlay and policy based networking on Cisco ACI and Nexus, VMware data centres, and the habit of proving each layer with a packet walk.

Manx Telecom · 2016

Policy based overlay on Cisco ACI

Tier 3 data centre and managed infrastructure for over 300 customer sites on Cisco ACI and Nexus: a software defined, policy based overlay, the same idea NSX applies in the hypervisor.

Penguin Random House · 2013 to 2015

Enterprise data centre on VMware

Post merger infrastructure integration across a multi site estate and the enterprise data centre, on Cisco, Palo Alto and VMware.

JJ Food Wholesale · 2007 to 2011

Virtualisation across the group

Local area network (LAN), WAN, voice over IP (VoIP), virtualisation and security across the group, including the warehouse and depot systems linked to the group's enterprise resource planning (ERP) system.

Home lab

VMware ESXi at every site

One VMware ESXi host per site, with a separate vMotion network in London and New York, running virtual Palo Alto and Check Point firewalls, Cisco ISE and a virtual wireless controller alongside the physical routers and switches.

Backed by VMware Certified Professional, Data Centre Virtualisation, alongside CCNP Enterprise and the CCIE Routing and Switching written exam. See all credentials