VXLAN Overlay Networks
VXLAN (Virtual Extensible LAN) overlay networks encapsulate layer-2 Ethernet frames within layer-3 UDP packets (port 4789), allowing VMs on different physical hypervisor hosts to communicate across flat virtual network segments.
Prerequisites
Section titled “Prerequisites”# Load VXLAN kernel modulemodprobe vxlan
# Verify supportip link add vxlan0 type vxlan id 100 dev eth0 dstport 4789ip link delete vxlan0Create VXLAN Network
Section titled “Create VXLAN Network”Using pvcli
Section titled “Using pvcli”pvcli network create \ --name vxlan-net \ --type vxlan \ --vni 1000 \ --local-ip 10.0.1.10 \ --remote-ips 10.0.1.11,10.0.1.12Using ip command
Section titled “Using ip command”# Create VXLAN interfaceip link add vxlan1000 type vxlan \ id 1000 \ dev eth0 \ local 10.0.1.10 \ remote 10.0.1.11 \ dstport 4789 \ nolearning
# Bring up interfaceip link set vxlan1000 upConfiguration
Section titled “Configuration”pivirtd Configuration
Section titled “pivirtd Configuration”network: vxlans: - name: "vxlan1000" vni: 1000 local_ip: "10.0.1.10" remote_ips: - "10.0.1.11" - "10.0.1.12" port: 4789 ttl: 64 learning: falseVM Network Interface
Section titled “VM Network Interface”spec: nics: - name: eth0 network: vxlan1000 model: virtio ipam: mode: static address: "10.10.1.10/24"Multi-Host Setup
Section titled “Multi-Host Setup”Node 1 (10.0.1.10)
Section titled “Node 1 (10.0.1.10)”network: vxlans: - name: "vxlan1000" vni: 1000 local_ip: "10.0.1.10" remote_ips: - "10.0.1.11" - "10.0.1.12"Node 2 (10.0.1.11)
Section titled “Node 2 (10.0.1.11)”network: vxlans: - name: "vxlan1000" vni: 1000 local_ip: "10.0.1.11" remote_ips: - "10.0.1.10" - "10.0.1.12"Node 3 (10.0.1.12)
Section titled “Node 3 (10.0.1.12)”network: vxlans: - name: "vxlan1000" vni: 1000 local_ip: "10.0.1.12" remote_ips: - "10.0.1.10" - "10.0.1.11"Firewall Configuration
Section titled “Firewall Configuration”# Allow VXLAN traffic (UDP 4789)nft add rule inet filter input udp dport 4789 accept
# Or with iptablesiptables -A INPUT -p udp --dport 4789 -j ACCEPTMonitoring
Section titled “Monitoring”Check VXLAN Interface
Section titled “Check VXLAN Interface”# List VXLAN interfacesip -d link show type vxlan
# Check VXLAN FDBbridge fdb show dev vxlan1000Check Connectivity
Section titled “Check Connectivity”# From VM on node 1ping 10.10.1.11 # VM on node 2ping 10.10.1.12 # VM on node 3Troubleshooting
Section titled “Troubleshooting”VXLAN Not Working
Section titled “VXLAN Not Working”# Check VXLAN interfaceip -d link show vxlan1000
# Check UDP connectivitync -zv 10.0.1.11 4789
# Check firewallnft list ruleset | grep 4789VMs Can’t Communicate
Section titled “VMs Can’t Communicate”# Check VXLAN FDBbridge fdb show dev vxlan1000
# Check VM network configpvcli vm get web-01 -o json | jq '.spec.nics'
# Check IP configuration# Inside VMip addr show eth0ip route show