VLANs scale to 4094. That’s not enough for large datacenters with thousands of tenants. VLAN tags are local to Layer 2 domains. Extending VLANs across L3 boundaries requires complex tricks.
VXLAN (Virtual Extensible LAN) encapsulates Ethernet frames in UDP. 24-bit VNI supports 16 million segments. Runs over any IP network. Decouples overlay from underlay.
VXLAN enables scalable Layer 2 networks over any IP infrastructure.
VXLAN Concepts
How VXLAN Works
[Host A]──[VTEP1]═══ IP Network ═══[VTEP2]──[Host B] │ │ Encapsulate in UDP Decapsulate (add VXLAN header) (remove header)VXLAN Header
Outer Ethernet │ Outer IP │ Outer UDP │ VXLAN │ Inner Ethernet │ Inner IP │ Payload │ │ dst 4789 │ VNI │ │ │Key Terms
| Term | Description |
|---|---|
| VNI | VXLAN Network Identifier (24-bit, up to 16M) |
| VTEP | VXLAN Tunnel Endpoint |
| NVE | Network Virtualization Edge |
| BUM | Broadcast, Unknown unicast, Multicast |
Basic VXLAN Configuration
Static VXLAN (Point-to-Point)
configure
# Create VXLAN interfaceset interfaces vxlan vxlan100 vni 100set interfaces vxlan vxlan100 source-address 10.0.0.1set interfaces vxlan vxlan100 remote 10.0.0.2set interfaces vxlan vxlan100 port 4789
# Bridge VXLAN with local interfaceset interfaces bridge br100 member interface vxlan100set interfaces bridge br100 member interface eth1
commitRemote Side
configure
# Mirror configuration, swap source/remoteset interfaces vxlan vxlan100 vni 100set interfaces vxlan vxlan100 source-address 10.0.0.2set interfaces vxlan vxlan100 remote 10.0.0.1set interfaces vxlan vxlan100 port 4789
set interfaces bridge br100 member interface vxlan100set interfaces bridge br100 member interface eth1
commitMulticast VXLAN
For multi-point VXLAN using multicast for BUM traffic:
configure
# VXLAN with multicast groupset interfaces vxlan vxlan100 vni 100set interfaces vxlan vxlan100 source-address 10.0.0.1set interfaces vxlan vxlan100 group 239.1.1.100set interfaces vxlan vxlan100 port 4789
# Bridge configurationset interfaces bridge br100 member interface vxlan100set interfaces bridge br100 member interface eth1
commitMulticast Requirements
# Underlay must support multicast routing# Enable PIM on underlay interfacesset protocols pim interface eth0
# Or use static IGMP membershipHead-End Replication (Unicast Mode)
No multicast required — VTEP replicates BUM to all remote VTEPs:
configure
# VXLAN with multiple remote VTEPsset interfaces vxlan vxlan100 vni 100set interfaces vxlan vxlan100 source-address 10.0.0.1set interfaces vxlan vxlan100 remote 10.0.0.2set interfaces vxlan vxlan100 remote 10.0.0.3set interfaces vxlan vxlan100 remote 10.0.0.4set interfaces vxlan vxlan100 port 4789
# BUM traffic is replicated to all remotes
commitScaling Consideration
Multicast: Efficient BUM delivery, requires multicast underlayUnicast: Simple, but BUM traffic multiplied by VTEP count
Small scale (few VTEPs): Unicast fineLarge scale: Multicast or EVPN control planeVXLAN with EVPN
Best practice for production: EVPN control plane handles:
- MAC learning (no data plane flooding)
- Remote VTEP discovery (no manual configuration)
- BUM optimization
configure
# VXLAN interfaceset interfaces vxlan vxlan100 vni 100set interfaces vxlan vxlan100 source-address 10.0.0.1set interfaces vxlan vxlan100 parameters nolearning
# nolearning: Disable data plane MAC learning (EVPN handles it)
# BGP EVPN configurationset protocols bgp address-family l2vpn-evpn advertise-all-vni
commitMTU Considerations
VXLAN Overhead
Outer Ethernet: 14 bytesOuter IP: 20 bytesOuter UDP: 8 bytesVXLAN header: 8 bytesTotal: 50 bytes
Standard 1500 MTU - 50 = 1450 inner MTUConfigure MTU
configure
# Option 1: Increase underlay MTUset interfaces ethernet eth0 mtu 1550
# Option 2: Reduce overlay MTUset interfaces bridge br100 mtu 1450
commitJumbo Frames
# Better option: Use jumbo frames on underlayset interfaces ethernet eth0 mtu 9000
# VXLAN inner MTU: 9000 - 50 = 8950# Standard 1500 MTU traffic fits easilyVXLAN Gateway
L2 Gateway (Bridging Only)
# VXLAN bridges to local VLANset interfaces bridge br100 member interface vxlan100set interfaces bridge br100 member interface eth1.100
# Local VLAN 100 traffic bridged to VXLAN 100L3 Gateway (Routing)
configure
# Add IP to bridge for routingset interfaces bridge br100 address 192.168.100.1/24
# VMs/hosts in VXLAN use this as gateway# Router handles inter-VXLAN routing
commitVXLAN Routing Between VNIs
configure
# Two VXLANsset interfaces vxlan vxlan100 vni 100set interfaces vxlan vxlan200 vni 200
# Two bridges with IPsset interfaces bridge br100 member interface vxlan100set interfaces bridge br100 address 192.168.100.1/24
set interfaces bridge br200 member interface vxlan200set interfaces bridge br200 address 192.168.200.1/24
# Router routes between 192.168.100.0/24 and 192.168.200.0/24
commitViewing VXLAN State
Check Interface
# Show VXLAN interfaceshow interfaces vxlan
# Show VXLAN detailsshow interfaces vxlan vxlan100
# Show bridge MAC tableshow bridge fdb interface br100Check Forwarding Database
# View learned MACsbridge fdb show dev vxlan100
# Output:# aa:bb:cc:dd:ee:ff dev vxlan100 dst 10.0.0.2 self permanent# 11:22:33:44:55:66 dev vxlan100 master br100Troubleshooting VXLAN
Tunnel Not Working
# Check VXLAN interface is upshow interfaces vxlan vxlan100
# Verify underlay connectivityping 10.0.0.2 # Remote VTEP
# Check UDP port 4789 is not filterednc -vzu 10.0.0.2 4789
# Capture VXLAN trafficsudo tcpdump -i eth0 udp port 4789No MAC Learning
# Check bridge FDBbridge fdb show dev vxlan100
# If empty, check:# - ARP traffic flowing# - VXLAN interface in bridge# - nolearning not set (unless using EVPN)
# Generate traffic to trigger learningarping -I br100 192.168.100.100MTU Issues
# Symptoms: Small packets work, large fail
# Test with large pingping -s 1400 192.168.100.100
# If fails, check MTUip link show vxlan100ip link show br100
# Verify underlay MTU is sufficientping -s 1500 -M do 10.0.0.2Security Considerations
VXLAN Has No Encryption
Traffic visible to underlay network:- Inner Ethernet frames- All payload content
For sensitive data:- Encrypt at application layer- Use IPsec on underlay- Consider alternative (WireGuard overlay)Firewall VXLAN Traffic
# Allow VXLAN only from known VTEPsset firewall ipv4 name UNDERLAY-IN rule 100 action acceptset firewall ipv4 name UNDERLAY-IN rule 100 protocol udpset firewall ipv4 name UNDERLAY-IN rule 100 destination port 4789set firewall ipv4 name UNDERLAY-IN rule 100 source group network-group VTEPSVXLAN Design Patterns
Datacenter Fabric
[Spine1] [Spine2] │ │ ────────┼────────────┼──────── │ │ │ │ │ [Leaf1] [Leaf2] [Leaf3] ...
Underlay: IP routing (OSPF/BGP) on spine-leafOverlay: VXLAN between leavesControl: EVPN for MAC learningDCI (Datacenter Interconnect)
[DC1]══════VXLAN══════[DC2] over WAN
Extended L2 between datacentersWatch out for: Latency, BUM flooding, split-brainThe Lesson
VXLAN enables scalable Layer 2 networks over any IP infrastructure.
VXLAN advantages:
- 16 million segments (vs 4K VLANs)
- Works over any IP network
- Decouples overlay from underlay
- Foundation for modern DC fabrics
VXLAN considerations:
- 50-byte overhead (needs MTU planning)
- BUM handling (multicast, unicast, or EVPN)
- No encryption (plan accordingly)
- Control plane important at scale
For small deployments: Static VXLAN with head-end replication works. For scale: EVPN control plane is the answer.
VXLAN is infrastructure. The real magic is in the control plane (EVPN) and how you design the overlay-underlay interaction.