EVPN
CLI reference:/routing/bgp/evpn/routing/bgp/evpn/esi
Ethernet Virtual Private Network (EVPN) extends Layer 2 networks between sites or racks over a routed IP network. BGP is the control plane: the routers exchange the MAC addresses of the hosts behind them and the addresses of their tunnel endpoints in BGP updates, instead of learning them from flooded traffic. RouterOS carries the Ethernet frames in VXLAN.
RFC 7432 defines EVPN with BGP as the control plane for an MPLS data plane. RFC 8365 adds other data planes, VXLAN among them, and describes EVPN as a Network Virtualization Overlay (NVO).
A RouterOS EVPN router (a leaf) does the following:
- Advertises the MAC addresses its bridge learns on local ports, and installs the MAC addresses that other leaves advertise in the bridge host table.
- Advertises its VXLAN tunnel endpoint (VTEP) for each VNI, and adds the VTEPs of the other leaves to the VXLAN interface as dynamic entries. Broadcast, unknown unicast and multicast frames go to these VTEPs by ingress replication.
- Advertises an Ethernet segment for a host that connects to two leaves, with an Ethernet segment identifier (ESI) on an LACP bond, and elects a designated forwarder per VLAN.
How EVPN works
The terms used on this page:
- NVO (Network Virtualization Overlay): a network that delivers Layer 2 and Layer 3 VPN services over an IP underlay.
- NVE (Network Virtualization Edge): the provider edge (PE) router of an NVO that encapsulates and decapsulates the VPN traffic. With VXLAN, the NVE is the VTEP (VXLAN tunnel endpoint).
- VNI: the VXLAN network identifier of a Layer 2 segment.
- EVI: an EVPN instance. In RouterOS, an entry in
/routing/bgp/evpnwith its VNIs. - RD: the route distinguisher, a 64-bit value that makes the routes of each leaf and instance unique.
- RT: the route target, an extended BGP community that decides which instance imports a route.
- MAC-VRF: the table of MAC addresses of one EVPN instance on a PE (VTEP).
- BUM: broadcast, unknown unicast and multicast traffic, the multi-destination traffic of a Layer 2 segment.
- Ingress replication: the ingress VTEP sends one copy of each BUM frame to every VTEP of the VNI. EVPN finds these VTEPs from the inclusive multicast (IMET) routes.
- ESI: the Ethernet segment identifier, the name of a link or link aggregation that connects a host to more than one leaf.
EVPN routes use the BGP address family AFI 25 (L2VPN) and SAFI 70 (EVPN). The next hop of an EVPN route is the IP address of the VTEP that advertises it. EVPN defines five route types:
- Type 1, Ethernet auto-discovery (
ad): announces the reachability of a multihomed Ethernet segment. RFC 7432 defines two kinds: one route per Ethernet segment, which lets a remote leaf withdraw all MAC addresses of the segment with one route when a leaf loses its link (mass withdrawal), and one route per EVPN instance, which lets a remote leaf reach the MAC addresses of the segment through the other leaves attached to it as well (aliasing). - Type 2, MAC/IP advertisement (
macip): advertises a MAC address, or a MAC address with its IP address, learned in an EVPN instance. - Type 3, inclusive multicast Ethernet tag (
imet): advertises that a VTEP is a member of a Layer 2 segment, so the other VTEPs find it. - Type 4, Ethernet segment (
es): finds the VTEPs that are attached to the same Ethernet segment, for multihoming (active-active or active-standby forwarding). - Type 5, IP prefix: advertises an IP prefix into the EVPN domain, for Layer 3 VPN services.
The encapsulation extended community of a route names the data plane: 8 is VXLAN, 9 NVGRE, 10 MPLS and 11 MPLS over GRE. RouterOS uses VXLAN and sends routes with the encapsulation community 8.
RFC 9135 describes two ways to route between subnets with EVPN: symmetric and asymmetric integrated routing and bridging (IRB). With symmetric IRB, both the ingress and the egress VTEP route and bridge, and routed traffic between VTEPs uses an IP-VRF with its own Layer 3 VNI. With asymmetric IRB, the ingress VTEP routes and bridges, and the egress VTEP only bridges. The examples on this page are Layer 2 (bridged) services.
Configure a Layer 2 EVPN overlay
The example connects two hosts in VLAN 10 through two leaves and a spine. The leaves map VLAN 10 to VNI 1010.
| Router | AS | Loopback | Links |
|---|---|---|---|
| Spine | 65000 | 192.0.2.10 | ether2 172.16.1.1/30 to Leaf1, ether3 172.16.2.1/30 to Leaf2 |
| Leaf1 | 65001 | 192.0.2.1 | ether2 172.16.1.2/30 to the spine, ether3 to Host1 |
| Leaf2 | 65002 | 192.0.2.2 | ether2 172.16.2.2/30 to the spine, ether3 to Host2 |
Host1 has the address 192.168.10.11/24 and Host2 192.168.10.12/24, both untagged on the leaf ports.
Underlay configuration
The underlay routes the loopback addresses that the BGP sessions and the VXLAN tunnels use. It can be eBGP, OSPF, IS-IS or static routes. The example uses OSPF.
Spine:
/ip/address
add address=192.0.2.10 interface=lo
add address=172.16.1.1/30 interface=ether2
add address=172.16.2.1/30 interface=ether3
/routing/ospf/instance
add name=evpn-underlay router-id=192.0.2.10
/routing/ospf/area
add name=evpn-underlay-bb instance=evpn-underlay
/routing/ospf/interface-template
add area=evpn-underlay-bb networks=172.16.0.0/16
add area=evpn-underlay-bb interfaces=lo passive
Leaf1:
/ip/address
add address=192.0.2.1 interface=lo
add address=172.16.1.2/30 interface=ether2
/routing/ospf/instance
add name=evpn-underlay router-id=192.0.2.1
/routing/ospf/area
add name=evpn-underlay-bb instance=evpn-underlay
/routing/ospf/interface-template
add area=evpn-underlay-bb networks=172.16.0.0/16
add area=evpn-underlay-bb interfaces=lo passive
Leaf2:
/ip/address
add address=192.0.2.2 interface=lo
add address=172.16.2.2/30 interface=ether2
/routing/ospf/instance
add name=evpn-underlay router-id=192.0.2.2
/routing/ospf/area
add name=evpn-underlay-bb instance=evpn-underlay
/routing/ospf/interface-template
add area=evpn-underlay-bb networks=172.16.0.0/16
add area=evpn-underlay-bb interfaces=lo passive
Check on Leaf1 that the loopbacks of the other routers are reachable:
[admin@MikroTik] > /ip/route/print where dst-address in 192.0.2.0/24
Flags: D - DYNAMIC; A - ACTIVE; c - CONNECT, o - OSPF
Columns: DST-ADDRESS, GATEWAY, ROUTING-TABLE, DISTANCE
DST-ADDRESS GATEWAY ROUTING-TABLE DISTANCE
DAc 192.0.2.1/32 lo main 0
DAo 192.0.2.2/32 172.16.1.1%ether2 main 110
DAo 192.0.2.10/32 172.16.1.1%ether2 main 110
BGP EVPN overlay
The overlay is multihop eBGP between the loopback addresses, with the EVPN address family only (see BGP and peering sessions).
On the spine, a template holds the common settings, and one connection listens on the whole loopback range. The spine accepts a new leaf from that range without a configuration change, whatever AS number the leaf uses.
Set nexthop-choice to propagate on an eBGP
spine. Otherwise the spine sets itself as the next hop of the routes it passes on, and the leaves send the VXLAN
traffic for remote MAC addresses to the spine, which has no VTEP and drops it. A spine of another vendor needs its
setting that keeps the next hop of the EVPN routes unchanged. With an iBGP overlay the spine is a
route reflector and keeps the next hop (see the route reflector section).
Spine:
/routing/bgp/instance
add name=evpn-overlay as=65000 router-id=192.0.2.10
/routing/bgp/template
add name=evpn-leafs afi=evpn multihop=yes nexthop-choice=propagate
/routing/bgp/connection
add name=evpn-leafs instance=evpn-overlay templates=evpn-leafs \
local.address=192.0.2.10 .role=ebgp remote.address=192.0.2.0/24
Leaf1:
/routing/bgp/instance
add name=evpn-overlay as=65001 router-id=192.0.2.1
/routing/bgp/connection
add name=to-spine instance=evpn-overlay afi=evpn multihop=yes \
local.address=192.0.2.1 .role=ebgp \
remote.address=192.0.2.10 .as=65000
Leaf2:
/routing/bgp/instance
add name=evpn-overlay as=65002 router-id=192.0.2.2
/routing/bgp/connection
add name=to-spine instance=evpn-overlay afi=evpn multihop=yes \
local.address=192.0.2.2 .role=ebgp \
remote.address=192.0.2.10 .as=65000
Set router-id in the BGP instance: the automatic route distinguishers are made from it. Check the
session on Leaf1:
[admin@MikroTik] > /routing/bgp/session/print
Flags: E - ESTABLISHED
0 E name="to-spine-1" instance=evpn-overlay remote.address=192.0.2.10
.as=65000 .id=192.0.2.10 .capabilities=mp,rr,enhe,gr,as4 .afi=evpn
.messages=1 .bytes=19 .eor="" local.address=192.0.2.1 .as=65001
.id=192.0.2.1 .cluster-id=192.0.2.1 .capabilities=mp,rr,enhe,gr,as4
.afi=evpn .messages=1 .bytes=19 .eor="" output.procid=20 input.procid=20
ebgp multihop=yes hold-time=3m keepalive-time=1m uptime=10s630ms
last-started=2026-12-02 08:27:16 prefix-count=0
VXLAN and EVPN configuration
Each leaf has a VLAN-aware bridge with the host port in VLAN 10 and a VXLAN interface for VNI 1010. bridge and
bridge-pvid add the VXLAN interface to the bridge as an untagged member of VLAN 10. The local-address is the
loopback address, the same address the BGP session uses.
Set learning=no on VXLAN interfaces that EVPN controls: the MAC addresses behind the other leaves come from EVPN
routes. The /routing/bgp/evpn entry links the BGP instance to the
VNI. EVPN controls the VXLAN interface with the same VNI. A VXLAN interface whose VNI is in no EVPN entry gets no
VTEPs from EVPN.
Leaf1:
/interface/bridge
add name=bridge1 vlan-filtering=yes
/interface/bridge/port
add bridge=bridge1 interface=ether3 pvid=10
/interface/vxlan
add name=vxlan1010 vni=1010 local-address=192.0.2.1 learning=no \
bridge=bridge1 bridge-pvid=10
/routing/bgp/evpn
add name=evpn1010 instance=evpn-overlay vni=1010
Leaf2:
/interface/bridge
add name=bridge1 vlan-filtering=yes
/interface/bridge/port
add bridge=bridge1 interface=ether3 pvid=10
/interface/vxlan
add name=vxlan1010 vni=1010 local-address=192.0.2.2 learning=no \
bridge=bridge1 bridge-pvid=10
/routing/bgp/evpn
add name=evpn1010 instance=evpn-overlay vni=1010
With one EVPN entry per VNI, you need not set a route distinguisher or route targets: RouterOS sets them (see the next section).
Check the overlay
Each leaf advertises an imet route for its VTEP. Locally originated EVPN routes have the e flag. Routes from BGP
have the b flag:
[admin@MikroTik] > /routing/route/print where afi=evpn
Flags: A - ACTIVE; b - BGP, e - EVPN
Columns: DST-ADDRESS, GATEWAY, AFI, DISTANCE, SCOPE, TARGET-SCOPE
DST-ADDRESS GATEWAY AFI DIS SCOPE TA
e [192.0.2.1:7]imet:0|192.0.2.1 192.0.2.1 evpn 200 40 10
Ab [192.0.2.2:7]macip:0|A2:66:B1:A3:C6:51 192.0.2.2 evpn 20 40 30
Ab [192.0.2.2:7]imet:0|192.0.2.2 192.0.2.2 evpn 20 40 30
The VTEP of the other leaf is a dynamic entry of the VXLAN interface:
[admin@MikroTik] > /interface/vxlan/vteps/print where dynamic
Flags: D - DYNAMIC
Columns: INTERFACE, REMOTE-IP
# INTERFACE REMOTE-IP
0 D vxlan1010 192.0.2.2
Ping Host2 from Host1:
[admin@MikroTik] > /ping 192.168.10.12 count=3
SEQ HOST SIZE TTL TIME STATUS
0 192.168.10.12 56 64 1ms948us
1 192.168.10.12 56 64 1ms690us
2 192.168.10.12 56 64 1ms978us
sent=3 received=3 packet-loss=0% min-rtt=1ms690us avg-rtt=1ms872us
max-rtt=1ms978us
Each leaf advertises the MAC address it learned on the host port in a macip route. On Leaf1, the MAC address of
Host2 is in the bridge host table with the E (external) flag, learned from EVPN:
[admin@MikroTik] > /interface/bridge/host/print where bridge=bridge1
Flags: D - DYNAMIC; L - LOCAL; E - EXTERNAL
Columns: MAC-ADDRESS, VID, ON-INTERFACE, BRIDGE
# MAC-ADDRESS VID ON-INTERFACE BRIDGE
0 DL 92:E8:17:7B:46:CC bridge1 bridge1
1 DL C6:D7:3E:5B:DC:3D vxlan1010 bridge1
2 DL 92:E8:17:7B:46:CC 1 bridge1 bridge1
3 D 62:D8:BC:CD:96:A9 10 ether3 bridge1
4 DL 92:E8:17:7B:46:CC 10 ether3 bridge1
5 D E A2:66:B1:A3:C6:51 10 vxlan1010 bridge1
6 DL C6:D7:3E:5B:DC:3D 10 vxlan1010 bridge1
[admin@MikroTik] > /routing/route/print where afi=evpn
Flags: A - ACTIVE; b - BGP, e - EVPN
Columns: DST-ADDRESS, GATEWAY, AFI, DISTANCE, SCOPE, TARGET-SCOPE
DST-ADDRESS GATEWAY AFI DIS SCOPE TA
e [192.0.2.1:7]macip:0|62:D8:BC:CD:96:A9 192.0.2.1 evpn 200 40 10
e [192.0.2.1:7]imet:0|192.0.2.1 192.0.2.1 evpn 200 40 10
Ab [192.0.2.2:7]macip:0|A2:66:B1:A3:C6:51 192.0.2.2 evpn 20 40 30
Ab [192.0.2.2:7]imet:0|192.0.2.2 192.0.2.2 evpn 20 40 30
Route distinguishers and route targets
When rd and the route targets of an EVPN entry are not set, RouterOS sets them:
- Route distinguisher:
<BGP router ID>:<n>, wherenis the internal ID of the EVPN entry, as/routing/bgp/evpn/print show-idsshows it. - Export route target:
<local AS>:<VNI>. - Import: routes with any route target of the form
<AS>:<VNI>, from any AS. The leaves of the example are in different AS numbers and still import each other's routes. A route target with an IP address, such as192.0.2.2:1010, is not imported automatically.
The details of a route from Leaf2 show the route target, the VNI as label, and the VTEP as .pmsi:
[admin@MikroTik] > /routing/route/print detail where afi=evpn and bgp
Flags: A - ACTIVE; b - BGP
Ab afi=evpn contribution=active
dst-address=[192.0.2.2:7]macip:0|A2:66:B1:A3:C6:51 label=1010
gateway=192.0.2.2 immediate-gw=172.16.1.1%ether2 distance=20 scope=40
target-scope=30 belongs-to="bgp-EVPN-192.0.2.10" bgp.session=to-spine-1
.as-path="65000,65002" .ext-communities=rt:65002:1010,encap:8 .origin=igp
.esi="00:00:00:00:00:00:00:00:00:00"
Ab afi=evpn contribution=active dst-address=[192.0.2.2:7]imet:0|192.0.2.2
gateway=192.0.2.2 immediate-gw=172.16.1.1%ether2 distance=20 scope=40
target-scope=30 belongs-to="bgp-EVPN-192.0.2.10" bgp.session=to-spine-1
.as-path="65000,65002" .ext-communities=rt:65002:1010,encap:8
.pmsi="ingr-repl-192.0.2.2" .origin=igp
Because the automatic import ignores the AS number, a leaf also imports the routes of another network that uses the
same VNI and reaches it over the same BGP sessions. Set the route targets yourself when the automatic import does not
fit, for example in that case, or when another vendor's leaf uses different values. A route whose route targets do not match import.route-targets is not imported: the VTEP of that
leaf and its MAC addresses do not appear. On both leaves:
/routing/bgp/evpn
set [find name=evpn1010] import.route-targets=65000:1010 \
.route-targets=65000:1010
[admin@MikroTik] > /routing/bgp/evpn/print
0 name="evpn1010" instance=evpn-overlay vni=1010
import.route-targets=65000:1010 export.route-targets=65000:1010
[admin@MikroTik] > /interface/vxlan/vteps/print where dynamic
Flags: D - DYNAMIC
Columns: INTERFACE, REMOTE-IP
# INTERFACE REMOTE-IP
1 D vxlan1010 192.0.2.2
Carry several VLANs
Map each VLAN to its own VNI and VXLAN interface. The example adds VLAN 20 as VNI 1020, tagged on the host ports of both leaves (Host1 has 192.168.20.11/24 and Host2 192.168.20.12/24 on VLAN 20).
Leaf1:
/interface/bridge/vlan
add bridge=bridge1 vlan-ids=20 tagged=ether3
/interface/vxlan
add name=vxlan1020 vni=1020 local-address=192.0.2.1 learning=no \
bridge=bridge1 bridge-pvid=20
/routing/bgp/evpn
add name=evpn1020 instance=evpn-overlay vni=1020
Leaf2:
/interface/bridge/vlan
add bridge=bridge1 vlan-ids=20 tagged=ether3
/interface/vxlan
add name=vxlan1020 vni=1020 local-address=192.0.2.2 learning=no \
bridge=bridge1 bridge-pvid=20
/routing/bgp/evpn
add name=evpn1020 instance=evpn-overlay vni=1020
[admin@MikroTik] > /ping 192.168.20.12 count=3
SEQ HOST SIZE TTL TIME STATUS
0 192.168.20.12 56 64 1ms777us
1 192.168.20.12 56 64 1ms781us
2 192.168.20.12 56 64 1ms975us
sent=3 received=3 packet-loss=0% min-rtt=1ms777us avg-rtt=1ms844us
max-rtt=1ms975us
Each EVPN entry has its own automatic route distinguisher:
[admin@MikroTik] > /routing/route/print where afi=evpn
Flags: A - ACTIVE; b - BGP, e - EVPN
Columns: DST-ADDRESS, GATEWAY, AFI, DISTANCE, SCOPE, TARGET-SCOPE
DST-ADDRESS GATEWAY AFI DIS SCOPE TA
e [192.0.2.1:7]macip:0|62:D8:BC:CD:96:A9 192.0.2.1 evpn 200 40 10
e [192.0.2.1:7]imet:0|192.0.2.1 192.0.2.1 evpn 200 40 10
e [192.0.2.1:8]macip:0|62:D8:BC:CD:96:A9 192.0.2.1 evpn 200 40 10
e [192.0.2.1:8]imet:0|192.0.2.1 192.0.2.1 evpn 200 40 10
Ab [192.0.2.2:7]macip:0|A2:66:B1:A3:C6:51 192.0.2.2 evpn 20 40 30
Ab [192.0.2.2:7]imet:0|192.0.2.2 192.0.2.2 evpn 20 40 30
Ab [192.0.2.2:8]macip:0|A2:66:B1:A3:C6:51 192.0.2.2 evpn 20 40 30
Ab [192.0.2.2:8]imet:0|192.0.2.2 192.0.2.2 evpn 20 40 30
One EVPN entry can also carry a range of VNIs (a VLAN-aware bundle). A range needs an explicit rd, and RouterOS
sets no route targets for it, so set them too. Without rd, the entry shows the comment
rd must be specified for bundled vlans. Leaf1 (on Leaf2, use rd=192.0.2.2:100):
/routing/bgp/evpn
remove [find name=evpn1020]
set [find name=evpn1010] vni=1010-1020 rd=192.0.2.1:100 \
import.route-targets=65000:100 .route-targets=65000:100
[admin@MikroTik] > /interface/vxlan/vteps/print where dynamic
Flags: D - DYNAMIC
Columns: INTERFACE, REMOTE-IP
# INTERFACE REMOTE-IP
0 D vxlan1010 192.0.2.2
1 D vxlan1020 192.0.2.2
[admin@MikroTik] > /ping 192.168.20.12 count=3
SEQ HOST SIZE TTL TIME STATUS
0 192.168.20.12 56 64 1ms731us
1 192.168.20.12 56 64 1ms822us
2 192.168.20.12 56 64 1ms864us
sent=3 received=3 packet-loss=0% min-rtt=1ms731us avg-rtt=1ms805us
max-rtt=1ms864us
In a bundle the routes carry the VNI in the Ethernet tag field (macip:1010, imet:1020):
[admin@MikroTik] > /routing/route/print where afi=evpn
Flags: A - ACTIVE; b - BGP, e - EVPN
Columns: DST-ADDRESS, GATEWAY, AFI, DISTANCE, SCOPE, TARGET-SCOPE
DST-ADDRESS GATEWAY AFI DIS SC TA
e [192.0.2.1:100]macip:1010|62:D8:BC:CD:96:A9 192.0.2.1 evpn 200 40 10
e [192.0.2.1:100]macip:1020|62:D8:BC:CD:96:A9 192.0.2.1 evpn 200 40 10
e [192.0.2.1:100]imet:1010|192.0.2.1 192.0.2.1 evpn 200 40 10
e [192.0.2.1:100]imet:1020|192.0.2.1 192.0.2.1 evpn 200 40 10
Ab [192.0.2.2:100]macip:1010|A2:66:B1:A3:C6:51 192.0.2.2 evpn 20 40 30
Ab [192.0.2.2:100]macip:1020|A2:66:B1:A3:C6:51 192.0.2.2 evpn 20 40 30
Ab [192.0.2.2:100]imet:1010|192.0.2.2 192.0.2.2 evpn 20 40 30
Ab [192.0.2.2:100]imet:1020|192.0.2.2 192.0.2.2 evpn 20 40 30
Multihome a host with an Ethernet segment
A host can connect to two leaves with one LACP link aggregation, one link to each leaf (EVPN multihoming, also
called ESI-LAG or EVPN-LAG). Each leaf puts its link in an 802.3ad
bond with the same esi. Give both bonds the same
lacp-system-id as well, so that both leaves use the same LACP system ID towards the host. RouterOS accepts esi
only on bonds in 802.3ad mode.
On both leaves, with ether4 connected to the host:
/interface/bonding
add name=bond1 slaves=ether4 mode=802.3ad \
lacp-system-id=02:00:00:33:33:33 esi=00:00:00:00:00:00:03:33:33:33
/interface/bridge/port
add bridge=bridge1 interface=bond1 pvid=10
The leaves find each other from the Ethernet segment routes and elect a designated forwarder (DF) for each VLAN of
the segment. The DF of a VLAN is the leaf at position
<VLAN ID> mod <number of leaves> in the list of the segment's leaves ordered by VTEP address (counted from 0): with
two leaves, the leaf with the lower address is the DF for even VLAN IDs, the other leaf for odd ones. The
/routing/bgp/evpn/esi menu shows the segment, the other leaf and the
role per VLAN.
Leaf1:
[admin@MikroTik] > /routing/bgp/evpn/esi/print
0 esi=00:00:00:00:00:00:03:33:33:33 bond=bond1 peers=192.0.2.2
bds=vlan-10/vxlan1010/df
Leaf2:
[admin@MikroTik] > /routing/bgp/evpn/esi/print
0 esi=00:00:00:00:00:00:03:33:33:33 bond=bond1 peers=192.0.2.1
bds=vlan-10/vxlan1010/non-df
Each leaf advertises an Ethernet segment route (es), a per-segment auto-discovery route (ad with the tag
4294967295) and per-instance auto-discovery routes (ad with the Ethernet tag: 0, or each VNI of a bundle as
here):
[admin@MikroTik] > /routing/route/print where afi=evpn and dst-address~"]es:|]ad:"
Flags: A - ACTIVE; b - BGP, e - EVPN
Columns: DST-ADDRESS, GATEWAY, AFI
DST-ADDRESS GATEWAY AFI
e [192.0.2.1:0]ad:4294967295|00:00:00:00:00:00:03:33:33:33 192.0.2.1 evpn
e [192.0.2.1:0]es:00:00:00:00:00:00:03:33:33:33|192.0.2.1 192.0.2.1 evpn
e [192.0.2.1:100]ad:1010|00:00:00:00:00:00:03:33:33:33 192.0.2.1 evpn
e [192.0.2.1:100]ad:1020|00:00:00:00:00:00:03:33:33:33 192.0.2.1 evpn
Ab [192.0.2.2:0]ad:4294967295|00:00:00:00:00:00:03:33:33:33 192.0.2.2 evpn
Ab [192.0.2.2:0]es:00:00:00:00:00:00:03:33:33:33|192.0.2.2 192.0.2.2 evpn
Ab [192.0.2.2:100]ad:1010|00:00:00:00:00:00:03:33:33:33 192.0.2.2 evpn
Ab [192.0.2.2:100]ad:1020|00:00:00:00:00:00:03:33:33:33 192.0.2.2 evpn
The es route carries the ES-import route target, made from bytes 2 to 7 of the ESI
(es-import:00:00:00:00:00:03 for the ESI of the example). The per-segment ad route carries the route targets of
all EVPN entries of the segment and the ESI label community es-label:all:0 (all-active). The per-instance ad
routes carry the VNI as label.
When the bond of a leaf goes down, that leaf withdraws its es and ad routes. The other leaf then has no peers
for the segment and becomes the DF for all its VLANs. When the bond comes back, the leaves elect the DFs again.
The host side is an 802.3ad bond of the two links. On a RouterOS host, untagged in VLAN 10 as the leaf bonds
are:
/interface/bonding
add name=bond1 slaves=ether2,ether3 mode=802.3ad
/ip/address
add address=192.168.10.13/24 interface=bond1
The outputs in this section show the control plane of the segment: the es and ad routes, the DF per VLAN and
the change of the DF roles when a bond goes down. They do not show traffic over the bonds.
Use a route reflector instead of eBGP
The overlay can also be iBGP: all routers in one AS, the spine a route reflector. A route reflector keeps the next
hop of the routes it reflects, so nexthop-choice=propagate is not needed. To change the example, on the spine:
/routing/bgp/template
set [find name=evpn-leafs] nexthop-choice=default
/routing/bgp/connection
set [find name=evpn-leafs] local.role=ibgp-rr
On both leaves:
/routing/bgp/instance
set [find name=evpn-overlay] as=65000
/routing/bgp/connection
set [find name=to-spine] local.role=ibgp
The sessions on the spine, about 10 seconds after the change. The session to Leaf2 shows prefix-count=0 at that
moment:
[admin@MikroTik] > /routing/bgp/session/print
Flags: E - ESTABLISHED
0 E name="evpn-leafs-1" instance=evpn-overlay remote.address=192.0.2.1
.as=65000 .id=192.0.2.1 .capabilities=mp,rr,enhe,gr,as4 .afi=evpn
.messages=8 .bytes=831 .eor="" local.role=ibgp-rr .address=192.0.2.10
.as=65000 .id=192.0.2.10 .cluster-id=192.0.2.10
.capabilities=mp,rr,enhe,gr,as4 .afi=evpn .messages=6 .bytes=697 .eor=""
output.procid=20 input.procid=20 ibgp multihop=yes hold-time=3m
keepalive-time=1m uptime=9s840ms last-started=2026-12-02 08:29:41
last-stopped=2026-12-02 08:29:41 prefix-count=8
1 E name="evpn-leafs-2" instance=evpn-overlay remote.address=192.0.2.2
.as=65000 .id=192.0.2.2 .capabilities=mp,rr,enhe,gr,as4 .afi=evpn
.messages=8 .bytes=831 .eor="" local.role=ibgp-rr .address=192.0.2.10
.as=65000 .id=192.0.2.10 .cluster-id=192.0.2.10
.capabilities=mp,rr,enhe,gr,as4 .afi=evpn .messages=6 .bytes=697 .eor=""
output.procid=21 input.procid=21 ibgp multihop=yes hold-time=3m
keepalive-time=1m uptime=9s350ms last-started=2026-12-02 08:29:42
last-stopped=2026-12-02 08:29:41 prefix-count=0
A few seconds later, Leaf1 has the routes from Leaf2, which keep Leaf2's VTEP as the gateway:
[admin@MikroTik] > /routing/route/print where afi=evpn and bgp
Flags: A - ACTIVE; b - BGP
Columns: DST-ADDRESS, GATEWAY, AFI
DST-ADDRESS GATEWAY AFI
Ab [192.0.2.2:0]ad:4294967295|00:00:00:00:00:00:03:33:33:33 192.0.2.2 evpn
Ab [192.0.2.2:0]es:00:00:00:00:00:00:03:33:33:33|192.0.2.2 192.0.2.2 evpn
Ab [192.0.2.2:100]ad:1010|00:00:00:00:00:00:03:33:33:33 192.0.2.2 evpn
Ab [192.0.2.2:100]ad:1020|00:00:00:00:00:00:03:33:33:33 192.0.2.2 evpn
Ab [192.0.2.2:100]macip:1010|A2:66:B1:A3:C6:51 192.0.2.2 evpn
Ab [192.0.2.2:100]macip:1020|A2:66:B1:A3:C6:51 192.0.2.2 evpn
Ab [192.0.2.2:100]imet:1010|192.0.2.2 192.0.2.2 evpn
Ab [192.0.2.2:100]imet:1020|192.0.2.2 192.0.2.2 evpn
Interoperate with Arista EOS
This example connects an Arista EOS leaf (eos_leaf) and a RouterOS leaf (ros_leaf_3) through a RouterOS spine (ros_spine), with its own addresses and AS numbers. The configurations and the outputs in this section come from an earlier interoperability test with Arista EOS.

- 203.0.255.0/24 is the loopback range.
- Subnets from 172.16.0.0/16 connect the leaves and the spine.
- Subnets from 192.168.0.0/16 are the host VLANs.
In the configurations and outputs of this example, host_1 (192.168.10.132, untagged) is behind ros_leaf_3, and host_3 (192.168.10.129, VLAN 10 tagged) is behind eos_leaf. The figure shows the two hosts the other way round.
Underlay
The underlay is OSPF, as in the RouterOS example.
ros_spine:
/ip/address
add address=203.0.255.138 interface=lo
add address=172.16.1.1/30 interface=ether3
add address=172.16.2.1/30 interface=ether4
add address=172.16.3.1/30 interface=ether5
add address=172.16.4.1/30 interface=ether6
add address=172.16.5.1/30 interface=ether7
/routing/ospf/instance
add name=evpn_underlay
/routing/ospf/area
add disabled=no instance=evpn_underlay name=evpn-underlay-bb
/routing/ospf/interface-template
add area=evpn-underlay-bb disabled=no networks=172.16.0.0/16
add area=evpn-underlay-bb disabled=no interfaces=lo passive
ros_leaf_3:
/ip/address
add address=203.0.255.133 interface=lo
add address=172.16.3.2/30 interface=ether10
/routing/ospf/instance
add name=evpn_underlay
/routing/ospf/area
add disabled=no instance=evpn_underlay name=evpn-underlay-bb
/routing/ospf/interface-template
add area=evpn-underlay-bb disabled=no networks=172.16.0.0/16
add area=evpn-underlay-bb disabled=no interfaces=lo passive
eos_leaf:
interface Ethernet1
no switchport
ip address 172.16.5.2/30
!
interface Loopback0
ip address 203.0.255.128/32
!
ip routing
!
router ospf 100
router-id 203.0.255.128
redistribute connected
network 172.16.5.0/30 area 0.0.0.0
!
BGP EVPN overlay with EOS
The spine uses the default template here, with nexthop-choice=propagate, and one connection for the whole
loopback range.
ros_spine:
/routing/bgp/instance
add as=65000 name=bgp--1
/routing/bgp/template
set default afi=evpn multihop=yes nexthop-choice=propagate
/routing/bgp/connection
add instance=bgp--1 local.address=203.0.255.138 .role=ebgp \
name=evpn_leafs remote.address=203.0.255.0/24 templates=default
ros_leaf_3:
/routing/bgp/instance
add as=65003 disabled=no name=bgp--1
/routing/bgp/connection
add afi=evpn instance=bgp--1 local.address=203.0.255.133 \
.role=ebgp multihop=yes name=to_spine remote.address=203.0.255.138
eos_leaf:
service routing protocols model multi-agent
!
router bgp 65005
neighbor SPINE_EVPN peer group
neighbor SPINE_EVPN remote-as 65000
neighbor SPINE_EVPN update-source Loopback0
neighbor SPINE_EVPN ebgp-multihop 10
neighbor SPINE_EVPN send-community extended
neighbor 203.0.255.138 peer group SPINE_EVPN
!
address-family evpn
neighbor SPINE_EVPN activate
!
The sessions on eos_leaf and ros_leaf_3:
localhost#show bgp summary
BGP summary information for VRF default
Router identifier 203.0.255.128, local AS number 65005
Neighbor AS Session State AFI/SAFI AFI/SAFI State NLRI Rcd NLRI Acc
------------- ----------- ------------- ----------------------- -------------- ---------- ----------
203.0.255.138 65000 Established IPv4 Unicast Advertised 0 0
203.0.255.138 65000 Established L2VPN EVPN Negotiated 6 6
[admin@ros_leaf_3] /routing/bgp/session> print
Flags: E - established
0 E name="to_spine-1" instance=bgp-instance-1
remote.address=203.0.255.138 .as=65000 .id=203.0.255.138 .capabilities=mp,rr,gr,as4 .afi=evpn .messages=7 .bytes=682 .eor=""
local.address=203.0.255.133 .as=65003 .id=203.0.255.133 .cluster-id=203.0.255.133 .capabilities=mp,rr,gr,as4 .afi=evpn .messages=7
.bytes=698 .eor=""
output.procid=20
input.procid=20 ebgp
multihop=yes hold-time=3m keepalive-time=1m uptime=1s620ms last-started=2025-05-29 11:01:38 prefix-count=0
VLAN and VXLAN with EOS
The EOS leaf uses the route target 1010:1010 for VNI 1010. The automatic import of the RouterOS leaf accepts it
(it has the form <AS>:<VNI>), but the automatic export route target of ros_leaf_3 is 65003:1010, which the EOS leaf
does not import. Set export.route-targets to the EOS value. ros_leaf_3 sets both route targets to 1010:1010.
ros_leaf_3, with host_1 untagged on ether11:
/interface/bridge
add name=bridge1 pvid=10 vlan-filtering=yes
/interface/vxlan
add bridge=bridge1 bridge-pvid=10 learning=no \
local-address=203.0.255.133 mac-address=C2:16:F6:B2:CC:D3 \
name=vxlan1 vni=1010
/interface/bridge/port
add bridge=bridge1 interface=ether11 pvid=10
/ip/address
add address=192.168.10.133/24 interface=bridge1
/routing/bgp/evpn
add disabled=no .route-targets=1010:1010 \
import.route-targets=1010:1010 instance=bgp--1 \
name=bgp-evpn-1 vni=1010
eos_leaf, with VLAN 10 tagged to host_3:
vlan 10
!
interface Ethernet2
switchport trunk allowed vlan 10
switchport mode trunk
!
interface Vlan10
ip address 192.168.10.128/24
!
interface Vxlan1
vxlan source-interface Loopback0
vxlan vlan 10 vni 1010
!
router bgp 65005
vlan 10
rd 203.0.255.128:1010
route-target both 1010:1010
redistribute learned
host_1:
/ip/address
add address=192.168.10.132/24 interface=ether2
host_3:
/interface/vlan
add interface=ether2 name=vlan10 vlan-id=10
/ip/address
add address=192.168.10.129/24 interface=vlan10
Check the EOS interoperation
The IMET routes and the VTEP on ros_leaf_3:
[admin@ros_leaf_3] /routing/route> print where dst-address~"imet"
Flags: A - ACTIVE; b - BGP, e - EVPN
Columns: DST-ADDRESS, GATEWAY, AFI, DISTANCE, SCOPE, TARGET-SCOPE, IMMEDIATE-GW
DST-ADDRESS GATEWAY AFI DISTANCE SCOPE TARGET-SCOPE IMMEDIATE-GW
Ab [203.0.255.128:1010]imet:0|203.0.255.128 203.0.255.128 evpn 20 40 30 172.16.3.1%ether10
e [203.0.255.133:256]imet:0|203.0.255.133 203.0.255.133 evpn 200 40 10
[admin@ros_leaf_3] /interface/vxlan/vteps> print
Flags: D - DYNAMIC
Columns: INTERFACE, REMOTE-IP
# INTERFACE REMOTE-IP
0 D vxlan1 203.0.255.128
The IMET routes and the flood list on eos_leaf. The header of the first output shows the router ID 203.0.255.135 and the AS number 65501 of an earlier configuration of the leaf, the other outputs show 203.0.255.128 and 65005:
localhost#show bgp evpn route-type imet
BGP routing table information for VRF default
Router identifier 203.0.255.135, local AS number 65501
Route status codes: * - valid, > - active, S - Stale, E - ECMP head, e - ECMP
c - Contributing to ECMP, % - Pending BGP convergence
Origin codes: i - IGP, e - EGP, ? - incomplete
AS Path Attributes: Or-ID - Originator ID, C-LST - Cluster List, LL Nexthop - Link Local Nexthop
Network Next Hop Metric LocPref Weight Path
* > RD: 203.0.255.128:1010 imet 203.0.255.128
- - - 0 i
* > RD: 203.0.255.133:256 imet 203.0.255.133
203.0.255.133 - 100 0 65000 65003 i
localhost#show interfaces vxlan1
Vxlan1 is up, line protocol is up (connected)
Hardware is Vxlan
Source interface is Loopback0 and is active with 203.0.255.128
Listening on UDP port 4789
Replication/Flood Mode is headend with Flood List Source: EVPN
Remote MAC learning via EVPN
VNI mapping to VLANs
Static VLAN to VNI mapping is
[10, 1010]
Note: All Dynamic VLANs used by VCS are internal VLANs.
Use 'show vxlan vni' for details.
Static VRF to VNI mapping is not configured
Headend replication flood vtep list is:
10 203.0.255.133
Shared Router MAC is 0000.0000.0000
localhost#show vxlan flood vtep vlan 10
VXLAN Flood VTEP Table
--------------------------------------------------------------------------------
VLANS Ip Address
----------------------------- ------------------------------------------------
10 203.0.255.133
Ping host_3 from host_1. The interface prints show the MAC addresses of host_1 and host_3:
[admin@host_1] /interface> print
...
1 R ether2 ether 1500 0C:50:85:84:00:01
[admin@host_1] /ip/address> /ping 192.168.10.129
SEQ HOST SIZE TTL TIME STATUS
0 192.168.10.129 56 64 17ms26us
1 192.168.10.129 56 64 13ms119us
2 192.168.10.129 56 64 17ms192us
[admin@host_3] /interface> print
...
1 R ether2 ether 1500 0C:74:39:88:00:01
On ros_leaf_3, eos_leaf (203.0.255.128) sent macip routes for the MAC address of host_3, one with its IP address.
ros_leaf_3 advertises the MAC address of host_1:
[admin@ros_leaf_3] /routing/route> print where dst-address~"macip"
Flags: A - ACTIVE; b - BGP, e - EVPN
Columns: DST-ADDRESS, GATEWAY, AFI, DISTANCE, SCOPE, TARGET-SCOPE, IMMEDIATE-GW
DST-ADDRESS GATEWAY AFI DISTANCE SCOPE TARGET-SCOPE IMMEDIATE-GW
Ab [203.0.255.128:1010]macip:0|0C:74:39:88:00:01 203.0.255.128 evpn 20 40 30 172.16.3.1%ether10
e [203.0.255.133:256]macip:0|0C:50:85:84:00:01 203.0.255.133 evpn 200 40 10
Ab [203.0.255.128:1010]macip:0|0C:74:39:88:00:01|192.168.10.129 203.0.255.128 evpn 20 40 30 172.16.3.1%ether10
On EOS, the remote MAC addresses are in the VXLAN address table, and the MAC address table has the local ones as well:
localhost#show bgp evpn route-type mac-ip detail
BGP routing table information for VRF default
Router identifier 203.0.255.128, local AS number 65005
BGP routing table entry for mac-ip 0c50.8584.0001, Route Distinguisher: 203.0.255.133:256
Paths: 1 available
65000 65003
203.0.255.133 from 203.0.255.138 (203.0.255.138)
Origin IGP, metric -, localpref 100, weight 0, tag 0, valid, external, best
Extended Community: Route-Target-AS:1010:1010 TunnelEncap:tunnelTypeVxlan
VNI: 0 ESI: 0000:0000:0000:0000:0000
BGP routing table entry for mac-ip 0c74.3988.0001, Route Distinguisher: 203.0.255.128:1010
Paths: 1 available
Local
- from - (0.0.0.0)
Origin IGP, metric -, localpref -, weight 0, tag 0, valid, local, best
Extended Community: Route-Target-AS:1010:1010 TunnelEncap:tunnelTypeVxlan
VNI: 1010 ESI: 0000:0000:0000:0000:0000
BGP routing table entry for mac-ip 0c74.3988.0001 192.168.10.129, Route Distinguisher: 203.0.255.128:1010
Paths: 1 available
Local
- from - (0.0.0.0)
Origin IGP, metric -, localpref -, weight 0, tag 0, valid, local, best
Extended Community: Route-Target-AS:1010:1010 TunnelEncap:tunnelTypeVxlan
VNI: 1010 ESI: 0000:0000:0000:0000:0000
localhost#show vxlan address-table vlan 10
Vxlan Mac Address Table
----------------------------------------------------------------------
VLAN Mac Address Type Prt VTEP Moves Last Move
---- ----------- ---- --- ---- ----- ---------
10 0c50.8584.0001 EVPN Vx1 203.0.255.133 1 1:30:49 ago
Total Remote Mac Addresses for this criterion: 1
localhost#show mac address-table vlan 10
Mac Address Table
------------------------------------------------------------------
Vlan Mac Address Type Ports Moves Last Move
---- ----------- ---- ----- ----- ---------
10 0c50.8584.0001 DYNAMIC Vx1 1 1:31:17 ago
10 0c74.3988.0001 DYNAMIC Et2 1 1 day, 23:45:18 ago
Total Mac Addresses for this criterion: 2
Multicast Mac Address Table
------------------------------------------------------------------
Vlan Mac Address Type Ports
---- ----------- ---- -----
Total Mac Addresses for this criterion: 0
ESI-LAG with Arista EOS leaves
In this extension of the topology, host_2 is a RouterOS router with an LACP bond to two Arista leaves (eos_leaf_2 and eos_leaf_4), an all-active multihomed setup.

The port channel is the same on both EOS leaves:
interface Port-Channel3
switchport access vlan 10
switchport trunk allowed vlan 10
switchport mode trunk
!
evpn ethernet-segment
identifier 0000:0000:0000:0333:3333
route-target import 00:00:03:33:33:33
lacp system-id 0000.0333.3333
!
interface Ethernet2
channel-group 3 mode active
host_2, with an LACP bond and VLAN 10 tagged on it:
/interface/bonding
add mode=802.3ad name=bond1 slaves=ether2,ether3
/interface/vlan
add interface=bond1 mtu=1496 name=vlan10 vlan-id=10
/ip/address
add address=192.168.10.130/24 interface=vlan10
Both EOS leaves advertise Type 1 (ad) and Type 4 (es) routes for the segment. On ros_spine:
[admin@ros_spine] /routing/route> print where afi=evpn dst-address~"(ad|es)"
Flags: A - ACTIVE; b - BGP
Columns: DST-ADDRESS, GATEWAY, AFI, DISTANCE, SCOPE, TARGET-SCOPE
DST-ADDRESS GATEWAY AFI DISTANCE SCOPE TA
Ab [203.0.255.127:1]ad:4294967295|00:00:00:00:00:00:03:33:33:33 203.0.255.127 evpn 20 40 30
Ab [203.0.255.127:1]es:00:00:00:00:00:00:03:33:33:33|203.0.255.127 203.0.255.127 evpn 20 40 30
Ab [203.0.255.127:1010]ad:0|00:00:00:00:00:00:03:33:33:33 203.0.255.127 evpn 20 40 30
Ab [203.0.255.134:1]ad:4294967295|00:00:00:00:00:00:03:33:33:33 203.0.255.134 evpn 20 40 30
Ab [203.0.255.134:1]es:00:00:00:00:00:00:03:33:33:33|203.0.255.134 203.0.255.134 evpn 20 40 30
Ab [203.0.255.134:1010]ad:0|00:00:00:00:00:00:03:33:33:33 203.0.255.134 evpn 20 40 30
The EOS leaves elect 203.0.255.127 (eos_leaf_4) as the designated forwarder:
eos_leaf_2#show bgp evpn instance vlan 10
EVPN instance: VLAN 10
Route distinguisher: 203.0.255.134:1010
Route target import: Route-Target-AS:1010:1010
Route target export: Route-Target-AS:1010:1010
Service interface: VLAN-based
Local VXLAN IP address: 203.0.255.134
VXLAN: enabled
MPLS: disabled
Local ethernet segment:
ESI: 0000:0000:0000:0333:3333
Type: 0 (administratively configured)
Interface: Port-Channel3
Mode: all-active
State: up
ES-Import RT: 00:00:03:33:33:33
DF election algorithm: modulus
Designated forwarder: 203.0.255.127
Non-Designated forwarder: 203.0.255.134
When the link from host_2 to eos_leaf_4 is suspended, eos_leaf_4 withdraws its es and ad routes, eos_leaf_2
becomes the designated forwarder, and the traffic moves to the other LACP link:
eos_leaf_2#show bgp evpn instance vlan 10
EVPN instance: VLAN 10
Route distinguisher: 203.0.255.134:1010
Route target import: Route-Target-AS:1010:1010
Route target export: Route-Target-AS:1010:1010
Service interface: VLAN-based
Local VXLAN IP address: 203.0.255.134
VXLAN: enabled
MPLS: disabled
Local ethernet segment:
ESI: 0000:0000:0000:0333:3333
Type: 0 (administratively configured)
Interface: Port-Channel3
Mode: all-active
State: up
ES-Import RT: 00:00:03:33:33:33
DF election algorithm: modulus
Designated forwarder: 203.0.255.134
[admin@ros_spine] /routing/route> print interval=1 where dst-address~"ad|es"
Flags: A - ACTIVE; b - BGP
Columns: DST-ADDRESS, GATEWAY, AFI, DISTANCE, SCOPE, TARGET-SCOPE
DST-ADDRESS GATEWAY AFI DISTANCE SCOPE TA
Ab [203.0.255.134:1]ad:4294967295|00:00:00:00:00:00:03:33:33:33 203.0.255.134 evpn 20 40 30
Ab [203.0.255.134:1]es:00:00:00:00:00:00:03:33:33:33|203.0.255.134 203.0.255.134 evpn 20 40 30
Ab [203.0.255.134:1010]ad:0|00:00:00:00:00:00:03:33:33:33 203.0.255.134 evpn 20 40 30
[admin@host_2] /interface/bonding> /ping 192.168.10.132 interval=500ms
SEQ HOST SIZE TTL TIME STATUS
0 192.168.10.132 56 64 2ms90us
1 192.168.10.132 56 64 2ms172us
2 192.168.10.132 56 64 2ms503us
3 192.168.10.132 timeout
4 192.168.10.132 timeout
5 192.168.10.132 timeout
6 192.168.10.132 56 64 2ms191us
7 192.168.10.132 56 64 2ms31us
Technical details
EVPN routes in the routing table
RouterOS shows local and received EVPN routes in /routing/route with
afi=evpn. Local routes have the e (EVPN) flag and distance 200. Routes received over eBGP have distance 20, over
iBGP distance 200.
The dst-address of an EVPN route encodes the route:
[rd]type:x|y
^ ^ ^ ^
| | | +- type-specific data: MAC address, MAC and IP address, VTEP address, ESI
| | +--- Ethernet tag (0, or the VNI in a bundle), or the ESI of an es route
| +------- route type: ad, macip, imet, es
+----------- route distinguisher
VTEP discovery and MAC learning
- Each
imetroute carries the VTEP address in its PMSI attribute (.pmsi="ingr-repl-<address>"). RouterOS adds that address as a dynamic VTEP of the VXLAN interface with the route's VNI, and removes it when the route is withdrawn. - MAC addresses from
maciproutes go into the bridge host table with theEflag, on the VXLAN interface. - A leaf that has an IP address on a VLAN interface of the bridge also advertises
maciproutes with the IP address, for the hosts in its ARP table on that interface whose MAC address it learned on a local port. - Received
maciproutes with an IP address create no ARP entries, and the leaf does not answer ARP requests for these addresses: the broadcast ARP request of a host reaches the remote host through the overlay. - The
evpnlog topic shows the VTEPs that are added and removed, and the MAC addresses that are advertised and learned.
MTU
VXLAN adds an outer Ethernet, IP, UDP and VXLAN header to every frame (50 bytes over IPv4, see
RFC 7348). The EVPN VXLAN interface of the example has MTU 1500. With an
underlay MTU of 1500, ping packets of 1450 bytes with do-not-fragment pass between the hosts, packets of
1500 bytes do not. Raise the underlay MTU, or lower the host MTU, when the hosts send full-size frames.
All EVPN properties are in the /routing/bgp/evpn CLI reference.