You have two sites joined by a routed (Layer 3) network, and you’d like a LAN segment — a Layer 2, with its broadcasts and its MACs — to cross that network as if the two sites were on the same switch. That’s the problem VXLAN solves: it takes an Ethernet frame and ships it inside a UDP packet, so an L2 travels over any L3. On RouterOS 7 it’s there and it’s clean. In this howto we build it on three CHR 7.25 and watch it at the packet level: the whole encapsulated frame, a host reachable only via the overlay, the MTU cost, how to build a multipoint hub that gathers several tunnels — and why the spokes, by default, don’t talk to each other — and, to close, an honest comparison with EoIP and VPLS.

Step 1: an L2 inside an L3
VXLAN (Virtual eXtensible LAN, RFC 7348) does one thing, but it does it well: it encapsulates an Ethernet frame inside UDP (port 4789). The three terms you need:
- VTEP (VXLAN Tunnel EndPoint): the router that wraps and unwraps the frames — here, the two MikroTik at the ends.
- VNI (VXLAN Network Identifier): the segment’s label, 24 bits → over 16 million separable networks (against the 4096 of classic VLANs).
- Underlay and overlay: the IP network that carries (underlay) and the virtual LAN that rides on top (overlay).
The key point: the underlay doesn’t care what it carries. To it they are UDP packets like any other, routable over as many hops as you want. The L2 intelligence (who sits where, which MACs) lives in the VTEPs.
Step 2: configure it (bare minimum)
Two routers v1 and v2 separated by an IP network (underlay 10.60.0.0/30). On each: a vxlan interface, the remote VTEP, and a bridge that joins the vxlan to the rest of the segment. On v1 the overlay segment’s IP sits on the bridge (it also acts as a nearby host):
/interface vxlan add name=vxlan1 vni=100 /interface vxlan vteps add interface=vxlan1 remote-ip=10.60.0.2 /interface bridge add name=br100 /interface bridge port add bridge=br100 interface=vxlan1 /ip address add address=10.50.0.1/24 interface=br100
On v2, the mirror image, but the bridge stays pure L2: no IP, and I also add the physical port that reaches the far host h2, so the overlay segment reaches all the way to it:
/interface vxlan add name=vxlan1 vni=100 /interface vxlan vteps add interface=vxlan1 remote-ip=10.60.0.1 /interface bridge add name=br100 /interface bridge port add bridge=br100 interface=vxlan1 /interface bridge port add bridge=br100 interface=lan2
Three details that save time. First: no local-address — RouterOS picks the source IP itself from the route toward the remote-ip. Second: the segment address goes on the bridge, never on the vxlan. Third: the port is the default 4789 (standard), not the 8472 of old Linux implementations. The far host h2 only has an IP in the same overlay subnet, 10.50.0.2/24, and no L3 route toward v1.
Step 3: proof on the wire — the frame inside UDP
From v1 I ping h2 (10.50.0.2), which lives behind v2. It works, 4 out of 4:
/ping 10.50.0.2 count=4
SEQ HOST SIZE TTL TIME
0 10.50.0.2 56 64 842us
3 10.50.0.2 56 64 781us
sent=4 received=4 packet-loss=0%
But the good part is on the underlay. Putting the sniffer on the cable between v1 and v2, a single packet shows the whole nesting — an Ethernet frame inside UDP:
# OUTER: frame between the two VTEPs, UDP to port 4789, VNI 100 label
52:54:00:50:02:01 > 52:54:00:50:01:01, ethertype IPv4, length 120:
10.60.0.2.56454 > 10.60.0.1.4789: VXLAN, flags [I] (0x08), vni 100
# INNER: the REAL Ethernet frame of the overlay segment, with its MACs and its IP
52:54:00:50:03:01 > 16:0c:45:79:fa:b9, ethertype IPv4, length 70:
10.50.0.2 > 10.50.0.1: ICMP echo reply, id 39936, seq 0
Outside are the MACs and IPs of the underlay (the two routers) plus UDP 4789 and the vni 100 label; inside is the whole Ethernet frame of the overlay — the MACs of h2 and of v1‘s bridge, and the ICMP between 10.50.0.x. It is literally an L2 wrapped in an L3.
And that h2 is reachable only thanks to the overlay is confirmed by v1‘s MAC table: h2‘s address was learned on vxlan1, not on a physical port.
/interface bridge host print where !local # MAC-ADDRESS ON-INTERFACE BRIDGE REMOTE-IP 0 D 52:54:00:50:03:01 vxlan1 br100 10.60.0.2 ← h2, beyond the tunnel
Without the vxlan, v1 has no path to h2: no route, MAC unknown. With the vxlan, it’s as if they were on the same switch.
Step 4: the MTU bill (50 bytes, measured)
Wrapping costs. VXLAN adds 50 bytes to every frame: 20 of IP header, 8 of UDP, 8 of VXLAN header, 14 of the outer Ethernet frame. It’s not theory, you can measure it: a ping with a 1400-byte inner payload produces on the underlay a 1450-byte UDP packet (1400 + 50).
# inner 1400 → outer UDP length 1450 : the 50 bytes of overhead, counted IP ... 10.60.0.1.42270 > 10.60.0.2.4789: UDP, length 1450
Practical consequence: if the underlay has the standard MTU of 1500, the largest overlay frame that passes without fragmenting is ~1450. Push a 1500-byte frame and the outer one becomes 1550 > 1500 and the packet fragments on the underlay (the sniffer shows the fragments, “50 bytes missing”): it works, but fragmentation hurts performance. The two correct fixes: raise the underlay MTU to ≥1550 (jumbo frames end-to-end), or clamp the TCP MSS on the overlay. It’s the number-one trap of every overlay: plan the MTU before going to production.
Step 5: why datacenters love it — the entropy that balances
Look at the captures again: the source UDP port changes with every flow (42270, 35924, 53853…), while the destination stays 4789. It’s no accident: the VTEP deliberately injects entropy. So when the underlay has multiple equal-cost paths (ECMP), it can spread the flows across different roads by looking at the UDP five-tuple — something a single-flow tunnel can’t allow. It’s one of the reasons VXLAN is the standard of modern overlays: it scales and balances over the underlying network effortlessly.
Step 6: VXLAN travels in clear text
An honest warning: in the captures above the inner frame is perfectly readable. VXLAN encrypts nothing — it’s an encapsulation, not a VPN. If the underlay isn’t trusted (the Internet, a carrier), it must go inside an encrypted tunnel: IPsec or WireGuard. The VXLAN-over-WireGuard combination works (L2 extended and encrypted), and we’ll cover it separately. On the LAN of a trusted datacenter, instead, VXLAN in clear text is the norm.
Step 7: multipoint — a hub that gathers several tunnels
So far two VTEPs, point-to-point. But VXLAN is born multipoint: a “hub” router can gather several tunnels on the same interface and bridge them together. Here lies the most important difference with EoIP — and a surprise about isolation worth knowing before you go to production.
Let’s turn v2 into a hub with two spokes, v1 and h2. The key: a single vxlan1 interface with two VTEPs, one per spoke.
# on the hub v2: ONE vxlan, TWO vteps /interface vxlan add name=vxlan1 vni=100 /interface vxlan vteps add interface=vxlan1 remote-ip=10.60.0.1 ;# spoke v1 /interface vxlan vteps add interface=vxlan1 remote-ip=10.60.0.6 ;# spoke h2 /interface bridge add name=br100 protocol-mode=none /interface bridge port add bridge=br100 interface=vxlan1
The hub learns both spokes’ MACs on the same vxlan1, each with its own remote VTEP — this is ingress replication: a broadcast is duplicated toward every listed VTEP.
/interface bridge host print where !local # MAC-ADDRESS ON-INTERFACE REMOTE-IP 0 D 16:0C:…:FA:B9 vxlan1 10.60.0.1 ← v1 1 D CA:B8:…:CD:72 vxlan1 10.60.0.6 ← h2
The hub reaches both spokes, 0% loss. But here’s the surprise, proven at the packet level: the two spokes do NOT talk to each other through the hub.
# v1 (10.50.0.1) → h2 (10.50.0.3), via the hub /ping 10.50.0.3 count=3 sent=3 received=0 packet-loss=100%
Why? With the sniffer on the wire toward h2, while v1 looks for h2, v1‘s ARP never arrives: on the cable only the hub’s own broadcasts show up (10.50.0.2).
# during v1→h2 only the hub's traffic passes, never v1's ARP (who-has 10.50.0.3): 10.60.0.5.49601 > 10.60.0.6.4789: VXLAN vni 100 | 10.50.0.2 ... (hub's MNDP) # a frame received from one VTEP is NOT sent out to another VTEP of the same interface
This is the VTEP split-horizon, a fundamental VXLAN rule (RFC 7348): a frame received from a VTEP is never forwarded to another VTEP on the same interface. It prevents loops, and it assumes the VTEPs are in a full mesh. VXLAN’s native model, in short, is not hub-and-spoke: it’s full-mesh — every VTEP talks directly to every other.
Want spoke-to-spoke traffic? Build the full mesh: on each spoke add the VTEP toward the other (plus an underlay route to reach it). Once that’s done, v1 and h2 talk directly, without going through the hub:
# on v1 the vtep toward h2 (and mirror on h2); now traffic goes DIRECT on the underlay: /interface vxlan vteps add interface=vxlan1 remote-ip=10.60.0.6 10.60.0.1.51905 > 10.60.0.6.4789: VXLAN vni 100 | 10.50.0.1 > 10.50.0.3: ICMP echo request 10.60.0.6.59496 > 10.60.0.1.4789: VXLAN vni 100 | 10.50.0.3 > 10.50.0.1: ICMP echo reply sent=4 received=4 packet-loss=0% ← v1↔h2 direct, not via the hub
EoIP goes multipoint the opposite way
EoIP is point-to-point by nature, but you make it multipoint in a different, more “manual” way: you light up N EoIP tunnels on the hub — one per spoke — and put them all as ports of the same bridge.
# on the hub: two EoIP tunnels = two bridge ports /interface eoip add name=eoip-v1 remote-address=10.60.0.1 tunnel-id=1 /interface eoip add name=eoip-h2 remote-address=10.60.0.6 tunnel-id=2 /interface bridge port add bridge=breoip interface=eoip-v1 /interface bridge port add bridge=breoip interface=eoip-h2
The substantial difference: here each spoke is a separate bridge port, not a VTEP shared on a single interface. And a bridge, between two different ports, forwards without issue. Proven result: with EoIP spoke-to-spoke via the hub works (0% loss), without any full mesh.
Isolating the spokes: two opposite answers
And here the question “can I isolate them?” splits in two.
- EoIP: by default the spokes talk. For an isolated hub-and-spoke (each one sees only the hub, not the others) you use the bridge split-horizon: the same
horizonvalue on the spoke ports. Proven — withhorizon=1on both,v1→h2goes to 100% loss, but hub↔spoke stays at 0%. Clean isolation./interface bridge port set [find interface=eoip-v1] horizon=1 /interface bridge port set [find interface=eoip-h2] horizon=1 # v1 → h2 : sent=3 received=0 packet-loss=100% (isolated) # hub → v1 and → h2 : packet-loss=0% (the hub still sees them)
- VXLAN: the problem often doesn’t arise — the spokes are already isolated by construction by the VTEP split-horizon, as long as you don’t build the full mesh. And beware: on VXLAN the bridge
horizondoesn’t help separate them, because the VTEPs share a single port (vxlan1) and horizon acts between ports, not between VTEPs of the same port. To truly isolate them you separate the VNIs (one segment per spoke) or use bridge filters.
In one line: EoIP gives you “natural” hub-and-spoke (and you isolate it with horizon); VXLAN gives you “natural” full-mesh (and spoke-to-spoke isolation is the default, to be undone only with the full mesh). We trust a future RouterOS will bring more explicit per-VTEP isolation controls to VXLAN too; for now the golden rule stays one: design the topology first.
Step 8: VXLAN, EoIP or VPLS?
It’s not the only way to carry an L2 around. On MikroTik you have three, and the choice depends on where you need to pass.
- EoIP — MikroTik’s proprietary Ethernet tunnel. It wraps the frame in GRE (IP protocol 47). The sniffer shows it clearly:
GREv1, Flags [key present]between the two routers. Dead simple between two MikroTik, but it’s point-to-point and MikroTik-only. - VPLS — the carrier standard: pseudowire over MPLS. Very low overhead (a few 4-byte labels) and multipoint, but it requires an MPLS core with LDP: you don’t just light it up on any IP network.
- VXLAN — the modern multi-vendor standard: runs over any routed IP network, is multipoint, scales to 16 million segments and balances over ECMP.
EoIP VPLS VXLAN encapsulation GRE (IP 47) MPLS pseudowire UDP 4789 (RFC 7348) overhead ~42 bytes ~4-8 B/label 50 bytes (measured) native topology point-to-point multipoint full mesh of VTEPs hub with N sites N tunnels bridged pseudowire mp 1 iface + N VTEPs spoke ↔ spoke yes yes no → needs full mesh isolate the spokes bridge horizon split-horizon VSI separate VNIs segment scale tunnel-id VC-id VNI 24-bit = 16 M load balancing single flow depends on MPLS UDP entropy → ECMP interoperability MikroTik-only standard multi-vendor encryption no (→IPsec/WG) no no (→IPsec/WG) what it needs two MikroTik MPLS core just routed IP
In practice: EoIP if you just need to join two MikroTik on the fly; VPLS if you have (or are) a carrier with MPLS; VXLAN if you want the open standard that runs over any IP network and scales — the right choice for a modern multi-site or datacenter overlay.
Frequently asked questions
Does VXLAN encrypt the traffic?
No. It only encapsulates: in the sniffer the inner frame reads in clear text. On an untrusted underlay it must go inside IPsec or WireGuard.
Do I have to configure multicast?
In the example, no: we used static VTEPs (explicit remote-ip), which is the simplest and most deterministic way for a few sites. Multicast/EVPN is for when the VTEPs are many and you want them to discover each other on their own.
Does a hub with two VXLAN tunnels make the spokes talk to each other?
No, not on its own: the VTEP split-horizon prevents a frame received from one VTEP from leaving toward another VTEP of the same interface. The hub reaches every spoke, but the spokes don’t reach each other. To make them talk you need the crossed VTEPs (full mesh). With EoIP, being separate bridge ports, they talk by default.
Should I disable STP on the VXLAN bridge?
On a multipoint hub, yes: set protocol-mode=none on the bridge carrying the vxlan. Otherwise the RSTP BPDUs travel inside the overlay and the hub, seeing them arrive from several spokes on the single vxlan1 port, may put it in discarding and forward nothing. It’s exactly the stumble we hit in the lab before turning STP off.
With many sites, can I automate the full mesh?
Partly, and here the truth must be told. Beyond one-by-one static VTEPs there are two roads. The first is multicast mode: you give the vxlan a group (a multicast address) and the underlay interface, and the VTEPs discover each other in flood-and-learn, without listing them by hand — but you need routed multicast (PIM) in the underlay, which you have in a datacenter or campus, almost never over the Internet. The second is provisioning automation (scripts, API, Ansible/Terraform) that pushes the VTEP lists: it works anywhere, but it’s configuration management, not a dynamic protocol. What’s missing is the control plane that does this for a living, BGP EVPN — it distributes VTEPs and MAC/IP addresses and builds the full mesh on its own: RouterOS does not implement it (7.25). Curiously, for VPLS the BGP auto-discovery (the l2vpn family) is there instead. We trust MikroTik will soon bring EVPN to VXLAN too — it would be the right answer for networks with many sites.
Is VXLAN done in hardware or in the CPU?
It depends on the device. On a router or a small switch the encap/decap happens in the CPU (as on the CHR in this lab). On some switches with more recent chips, from RouterOS 7.18, the VXLAN data plane is offloaded to the chip — encap/decap at line rate — but with important constraints: static VLAN↔VNI mapping, no ECMP for the VTEPs, no VTEP over bonds/bridges/VLAN/VRF, no IPv6 overlay, no routing between different VNIs, and no multicast mode (so offload and multicast auto-discovery are mutually exclusive). In practice: in a datacenter with the right silicon VXLAN flies in the chip; elsewhere it runs in the CPU — and for a small overlay the CPU is more than enough.
How many hops can it cross?
As many as you want: for the underlay they’re normally routable UDP packets. VXLAN doesn’t “see” the routers in between, it only sees the other VTEP’s IP.
Are VLAN and VXLAN the same thing?
No. A VLAN is a 12-bit tag inside a frame on an L2 network. VXLAN encapsulates the whole frame in UDP to carry it over an L3 network, and the identifier (VNI) is 24 bits: many more segments, and no L2 adjacency constraint.
Tested in the lab with three CHR RouterOS 7.25 (stable): two VTEPs (v1, v2) separated by a point-to-point /30 IP underlay and a host (h2) behind the second VTEP, driven from the serial console with a tcpdump sniffer on the underlay segment. VXLAN with vni=100, static VTEPs (remote-ip), bridge with the overlay segment’s IP on the bridge; the far host at 10.50.0.2/24, reachable from v1 only through the overlay. Underlay capture: UDP 4789 encapsulation with the vni 100 label and, inside, the complete overlay Ethernet frame (MACs and ICMP between 10.50.0.x); the far host’s MAC is learned on the vxlan1 interface. Measured overhead: inner payload 1400 → outer packet 1450 (50 bytes: IP 20 + UDP 8 + VXLAN 8 + Ethernet 14); beyond the underlay MTU the outer packet fragments. Source UDP port varies per flow (entropy for ECMP balancing). Multipoint scenario validated on the same trio: v2 as a hub with two VTEPs on the same vxlan1 (ingress replication, spoke MACs learned with their remote-ip); hub↔spoke 0% loss, but spoke-to-spoke via the hub at 100% loss due to the VTEP split-horizon (confirmed in the sniffer: one spoke’s ARP is never relayed to the other) → restored with crossed VTEPs (full mesh), direct spoke-to-spoke traffic 0% loss. Comparison with EoIP multipoint (two EoIP tunnels as ports of the same bridge on the hub): spoke-to-spoke 0% loss by default, isolable with the same horizon on the spoke ports (spoke-to-spoke → 100% loss, hub↔spoke → 0%). On the hub’s VXLAN bridge protocol-mode=none (with RSTP active the BPDUs travel in the overlay and block the hub’s port). For the comparison, EoIP also captured as GRE (IP protocol 47, GREv1 with key); VPLS described (requires an MPLS core, not reproduced in this lab). VXLAN does not encrypt: the inner frame is in clear text. Generic device; addresses and MACs are from the lab.



