Which one should I use?

Two offices need connectivity. Are you joining distinct IP networks or do you truly need shared Ethernet? A routed tunnel keeps broadcasts local, while an Ethernet tunnel also extends switching and Layer 2 failures. This guide chooses the payload, outer IP family and then security. GRE, IPIP and EoIP alone provide encapsulation, not authenticated encryption.

GRE carries routed IPv4 and IPv6 traffic and is a useful choice for mixed IP networks or compatible equipment from different vendors.

IPIP is a simple IPv4-in-IPv4 routed tunnel. Use it for straightforward IPv4 connectivity when both endpoints support it.

EoIP transports Ethernet frames. Use it between MikroTik routers when you need a shared Layer 2 segment, broadcasts or VLAN frames; it is not interchangeable with standard GRE.

Inner payload and outer transport matrix

Header arithmetic excludes IP options, VLAN tags and additional IPsec overhead
RouterOS menu Inner payload / layer Outer family / protocol Minimum added bytes Use and limit
gre IPv4/IPv6; L3 IPv4 / GRE 47 24 above inner IP Mixed routed IP; no Ethernet bridging or encryption in this recipe
gre6 IPv4/IPv6; L3 IPv6 / GRE 47 44 without optional GRE fields IPv6-reachable peers; preserve ICMPv6 PMTUD
ipip IPv4; L3 IPv4 / protocol 4 20 above inner IPv4 Small IPv4-only encapsulation; no NAT port to forward
ipipv6 IPv4 or IPv6; L3 IPv6 / next-header 4 or 41 for the payload 40 without extension headers IPv6 underlay; check the selected build menu and payload support
eoip Ethernet; L2 including tagged frames IPv4 / GRE 47 42 above untagged inner IP RouterOS Ethernet extension; tunnel-id is identification, not authentication
eoipv6 Ethernet; L2 IPv6 / EtherIP 97: confirm with capture on target build Outer IPv6 + Ethernet + EtherIP; verify exact format Not ordinary GRE6; IPv6 CLI reference does not fully document the on-wire format
WireGuard IPv4/IPv6; L3 IPv4/IPv6 / UDP At least 60/80 plus padding Authenticated encrypted routing; no native Ethernet payload
Routed IP payload versus bridged Ethernet payload; outer IPv4/IPv6 remains a separate choice
Routed IP payload versus bridged Ethernet payload; outer IPv4/IPv6 remains a separate choice — Open the diagram to zoom.

IPv4 and IPv6: outside versus inside

Read the outer transport separately from the inner payload. Local-address and remote-address identify the outer path: gre uses IPv4 and gre6 uses IPv6, while both can carry IPv4 or IPv6. Eoip and eoipv6 carry Ethernet over IPv4 and IPv6 respectively. Ipip carries IPv4 inside IPv4; ipipv6 can carry IPv4 or IPv6 over IPv6. The 6to4 menu for IPv6 inside IPv4 is outside this guide.

Choose ONE example per lab. A and B must already reach each other over the chosen transport. Example endpoints are documentation addresses: A=192.0.2.10 and B=198.51.100.20, or A=2001:db8:1::10 and B=2001:db8:2::20. Replace them with real addresses assigned to your routers. Existing LANs are A=192.168.10.0/24 and B=192.168.20.0/24, with each MikroTik as its LAN gateway.

Export the current configuration and enable Safe Mode with Ctrl+X before changes. Direct tunnels need reachable endpoints; CGNAT or upstream NAT may prevent them from working without additional planning.

ROUTEROS
/export file=before-tunnels

Confirm reachability before creating a tunnel

ROUTEROS
/system resource print
/ip address print
/ipv6 address print
/ip route print detail
/ipv6 route print detail
/interface bridge port print
# Router A: replace documentation addresses first
/ping 198.51.100.20 src-address=192.0.2.10 count=5
/ping 2001:db8:2::20 src-address=2001:db8:1::10 count=5

Expected result: the chosen outer peer is reachable using the assigned source through the normal underlay route. Failure analysis: ensure the remote public prefix will not recursively route into the new tunnel; ordinary ping proves only ICMP reachability. CGNAT lacks a generic TCP/UDP port-forward solution for GRE/IPIP. Rollback: these inspection commands do not change state; keep a separate management path for later bridge edits.

Firewall, NAT and security

None of these plain tunnels encrypts traffic. For sensitive internet traffic, use a properly configured IPsec protection or a secure transport such as WireGuard. A tunnel-id is not a password.

For IPv4 transport, allow IP protocol 47 (GRE and EoIP) or 4 (IPIP) in input, only from the peer address. These are protocol numbers, not TCP/UDP ports. For IPv6 transport, gre6 uses GRE (47); ipipv6 requires the relevant IPv4/IPv6 encapsulation protocols (4/41), and eoipv6 uses EtherIP (97). Restrict to the peer and selected tunnel. Keep IPv6 ICMP, including Packet Too Big, working.

Example for GRE over IPv4 on A; on B change the source to A. Move the accept rule above the applicable input drop using WinBox. Do not disable the firewall.

ROUTEROS
/ip firewall filter add chain=input action=accept protocol=gre src-address=198.51.100.20 comment="GRE from site B"

In a routed example, permit the required LAN traffic in both forward directions, checking IPv4 and IPv6 separately. Do not NAT between sites. If a broad masquerade also matches tunnel traffic, place an exact two-LAN srcnat action=accept exception before it. WAN-scoped masquerade normally needs no such tunnel-interface exception.

ROUTEROS
# Select only the outer protocol used by your lab; Router A examples
/ip firewall filter add chain=input action=accept in-interface-list=WAN src-address=198.51.100.20 dst-address=192.0.2.10 protocol=4 comment="TUN IPIP peer"
/ipv6 firewall filter add chain=input action=accept in-interface-list=WAN src-address=2001:db8:2::20/128 dst-address=2001:db8:1::10/128 protocol=gre comment="TUN GRE6 peer"
# ipipv6: enable protocol 4 for inner IPv4, 41 for inner IPv6 as required
/ipv6 firewall filter add chain=input action=accept in-interface-list=WAN src-address=2001:db8:2::20/128 dst-address=2001:db8:1::10/128 protocol=4 comment="TUN IPv4 in IPv6"
/ipv6 firewall filter add chain=input action=accept in-interface-list=WAN src-address=2001:db8:2::20/128 dst-address=2001:db8:1::10/128 protocol=41 comment="TUN IPv6 in IPv6"

On B, reverse source/destination peers. These input rules use existing WAN interfaces and may be installed before tunnel creation. Forward rules that name a tunnel interface belong after that interface exists; the routed-policy section supplies them. An EoIP bridge does not automatically pass frames through routed IP forward: use port/VLAN isolation or reviewed bridge filtering. Do not globally enable use-ip-firewall without assessing CPU and all bridge traffic.

The official eoipv6 CLI confirms the IPv6 endpoint menu, but does not specify every encapsulation byte or protocol number. EtherIP 97 is described by the interoperable implementation linked below; verify that next-header on your target RouterOS capture before enabling a narrow IPv6 input rule. Treat it as a lab verification gate, not a validated enterprise compatibility claim.

Set up gre

Router A:

ROUTEROS
/interface gre add name=gre-site local-address=192.0.2.10 remote-address=198.51.100.20 mtu=1400
/ip address add address=10.255.0.1/30 interface=gre-site
/ip route add dst-address=192.168.20.0/24 gateway=10.255.0.2

Router B:

ROUTEROS
/interface gre add name=gre-site local-address=198.51.100.20 remote-address=192.0.2.10 mtu=1400
/ip address add address=10.255.0.2/30 interface=gre-site
/ip route add dst-address=192.168.10.0/24 gateway=10.255.0.1

After configuring both ends, ping 10.255.0.2 from A and then test a real host on B's LAN. The first checks the transit segment; the second checks the user's routed/forwarded path. RouterOS saves these settings across reboot.

ROUTEROS
/ping 10.255.0.2 count=5

Purpose: Build only the selected gre pair with /30 transit addressing.

Expected result: A/B have 10.255.0.1/.2 and opposite remote-LAN routes.

Verification: Ping the tunnel peer, then actual LAN hosts both ways; inspect forward counters.

Failure analysis: Check outer protocol admission, address family and LAN return gateway.

Rollback: Disable gre-site; remove only its /30 and remote route per rollback.

Set up ipip

Router A:

ROUTEROS
/interface ipip add name=ipip-site local-address=192.0.2.10 remote-address=198.51.100.20 mtu=1400
/ip address add address=10.255.0.1/30 interface=ipip-site
/ip route add dst-address=192.168.20.0/24 gateway=10.255.0.2

Router B:

ROUTEROS
/interface ipip add name=ipip-site local-address=198.51.100.20 remote-address=192.0.2.10 mtu=1400
/ip address add address=10.255.0.2/30 interface=ipip-site
/ip route add dst-address=192.168.10.0/24 gateway=10.255.0.1

After configuring both ends, ping 10.255.0.2 from A and then test a real host on B's LAN. The first checks the transit segment; the second checks the user's routed/forwarded path. RouterOS saves these settings across reboot.

ROUTEROS
/ping 10.255.0.2 count=5

Purpose: Build only the selected ipip pair with /30 transit addressing.

Expected result: A/B have 10.255.0.1/.2 and opposite remote-LAN routes.

Verification: Ping the tunnel peer, then actual LAN hosts both ways; inspect forward counters.

Failure analysis: Check outer protocol admission, address family and LAN return gateway.

Rollback: Disable ipip-site; remove only its /30 and remote route per rollback.

Set up gre6

Router A:

ROUTEROS
/interface gre6 add name=gre6-site local-address=2001:db8:1::10 remote-address=2001:db8:2::20 mtu=1400
/ip address add address=10.255.0.1/30 interface=gre6-site
/ip route add dst-address=192.168.20.0/24 gateway=10.255.0.2

Router B:

ROUTEROS
/interface gre6 add name=gre6-site local-address=2001:db8:2::20 remote-address=2001:db8:1::10 mtu=1400
/ip address add address=10.255.0.2/30 interface=gre6-site
/ip route add dst-address=192.168.10.0/24 gateway=10.255.0.1

After configuring both ends, ping 10.255.0.2 from A and then test a real host on B's LAN. The first checks the transit segment; the second checks the user's routed/forwarded path. RouterOS saves these settings across reboot.

ROUTEROS
/ping 10.255.0.2 count=5

Purpose: Build only the selected gre6 pair with /30 transit addressing.

Expected result: A/B have 10.255.0.1/.2 and opposite remote-LAN routes.

Verification: Ping the tunnel peer, then actual LAN hosts both ways; inspect forward counters.

Failure analysis: Check outer protocol admission, address family and LAN return gateway.

Rollback: Disable gre6-site; remove only its /30 and remote route per rollback.

Set up ipipv6

Router A:

ROUTEROS
/interface ipipv6 add name=ipipv6-site local-address=2001:db8:1::10 remote-address=2001:db8:2::20 mtu=1400
/ip address add address=10.255.0.1/30 interface=ipipv6-site
/ip route add dst-address=192.168.20.0/24 gateway=10.255.0.2

Router B:

ROUTEROS
/interface ipipv6 add name=ipipv6-site local-address=2001:db8:2::20 remote-address=2001:db8:1::10 mtu=1400
/ip address add address=10.255.0.2/30 interface=ipipv6-site
/ip route add dst-address=192.168.10.0/24 gateway=10.255.0.1

After configuring both ends, ping 10.255.0.2 from A and then test a real host on B's LAN. The first checks the transit segment; the second checks the user's routed/forwarded path. RouterOS saves these settings across reboot.

ROUTEROS
/ping 10.255.0.2 count=5

Purpose: Build only the selected ipipv6 pair with /30 transit addressing.

Expected result: A/B have 10.255.0.1/.2 and opposite remote-LAN routes.

Verification: Ping the tunnel peer, then actual LAN hosts both ways; inspect forward counters.

Failure analysis: Check outer protocol admission, address family and LAN return gateway.

Rollback: Disable ipipv6-site; remove only its /30 and remote route per rollback.

Authorize LAN forwarding after the tunnel exists

For the selected routed example, run the following on its named router before testing LAN hosts. The example uses gre-site; replace it with ipip-site, gre6-site or ipipv6-site when that is the interface you created. Place the new accepts before matching forward drops, retain established/related reply handling and keep WAN masquerade scoped away from inter-site traffic.

ROUTEROS
# Router A
/ip firewall filter add chain=forward action=accept out-interface=gre-site src-address=192.168.10.0/24 dst-address=192.168.20.0/24 comment="TUN A outbound"
/ip firewall filter add chain=forward action=accept in-interface=gre-site src-address=192.168.20.0/24 dst-address=192.168.10.0/24 comment="TUN B inbound"
# Router B
/ip firewall filter add chain=forward action=accept out-interface=gre-site src-address=192.168.20.0/24 dst-address=192.168.10.0/24 comment="TUN B outbound"
/ip firewall filter add chain=forward action=accept in-interface=gre-site src-address=192.168.10.0/24 dst-address=192.168.20.0/24 comment="TUN A inbound"

Purpose: Authorize only the two LAN prefixes through the chosen routed interface.

Expected result: Actual LAN hosts can exchange the intended traffic in both directions.

Verification: Inspect /ip firewall filter print stats and host return gateways.

Failure analysis: An interface-name error means creation/order or selection is wrong; a zero counter indicates a different path/rule order.

Rollback: Disable only the four named TUN forward rules, then review routes before teardown.

Carry IPv6 inside the routed tunnel

On gre-site, gre6-site or ipipv6-site, add these addresses and routes. Replace gre6-site below with your selected interface. These ULA prefixes are lab networks; real LANs must already have IPv6 addressing and use their MikroTik as gateway. Do not apply this to ordinary ipip.

ROUTEROS
# Router A
/ipv6 address add address=fd42:100::1/64 interface=gre6-site advertise=no
/ipv6 route add dst-address=fd42:20::/64 gateway=fd42:100::2
# Router B
/ipv6 address add address=fd42:100::2/64 interface=gre6-site advertise=no
/ipv6 route add dst-address=fd42:10::/64 gateway=fd42:100::1
# Test from A
/ping fd42:100::2 count=5

For this optional IPv6 payload, apply the following after creating the selected IPv6-capable routed interface. Replace gre6-site with gre-site or ipipv6-site if selected. The scoped ICMPv6 input rule permits tunnel diagnostics and essential IPv6 control traffic; the forward rules limit LAN payload prefixes.

ROUTEROS
# Router A
/ipv6 firewall filter add chain=input action=accept in-interface=gre6-site protocol=icmpv6 comment="TUN IPv6 control"
/ipv6 firewall filter add chain=forward action=accept out-interface=gre6-site src-address=fd42:10::/64 dst-address=fd42:20::/64 comment="TUN IPv6 A outbound"
/ipv6 firewall filter add chain=forward action=accept in-interface=gre6-site src-address=fd42:20::/64 dst-address=fd42:10::/64 comment="TUN IPv6 B inbound"
# Router B
/ipv6 firewall filter add chain=input action=accept in-interface=gre6-site protocol=icmpv6 comment="TUN IPv6 control"
/ipv6 firewall filter add chain=forward action=accept out-interface=gre6-site src-address=fd42:20::/64 dst-address=fd42:10::/64 comment="TUN IPv6 B outbound"
/ipv6 firewall filter add chain=forward action=accept in-interface=gre6-site src-address=fd42:10::/64 dst-address=fd42:20::/64 comment="TUN IPv6 A inbound"

EoIP over IPv4 or IPv6

Use a dedicated spare ether5 on each router, connected only to a lab device. It must not belong to another bridge and must not be your management or WAN port. Both lab devices use the same subnet, for example 192.168.50.10/24 and 192.168.50.20/24. Keep only one DHCP server in the shared segment.

ROUTEROS
# Router A
/interface eoip add name=eoip-site local-address=192.0.2.10 remote-address=198.51.100.20 tunnel-id=100 mtu=1400 mac-address=02:00:00:00:01:01
# Router B
/interface eoip add name=eoip-site local-address=198.51.100.20 remote-address=192.0.2.10 tunnel-id=100 mtu=1400 mac-address=02:00:00:00:01:02

For IPv6 transport, use these INSTEAD of the previous two creation commands:

ROUTEROS
# Router A
/interface eoipv6 add name=eoip-site local-address=2001:db8:1::10 remote-address=2001:db8:2::20 tunnel-id=100 mtu=1400 mac-address=02:00:00:00:01:01
# Router B
/interface eoipv6 add name=eoip-site local-address=2001:db8:2::20 remote-address=2001:db8:1::10 tunnel-id=100 mtu=1400 mac-address=02:00:00:00:01:02

Then run the following on BOTH routers. Matching tunnel-id identifies the link; unique interface MAC addresses and RSTP help the bridge behave correctly. Test between the two lab devices. IPv4 and IPv6 Ethernet traffic can both cross the bridge.

ROUTEROS
/interface bridge add name=br-eoip protocol-mode=rstp
/interface bridge port add bridge=br-eoip interface=ether5
/interface bridge port add bridge=br-eoip interface=eoip-site

Set both test hosts to MTU 1400 too, or provision sufficient underlay capacity for full frames. Unique locally administered MAC addresses are assigned above; do not reuse them on another active tunnel. Expected result: ARP and host-to-host ping cross br-eoip. Verify /interface bridge host print after traffic. Failure analysis: check tunnel-id, spare-port membership and loops. Rollback: disable eoip-site first and detach only its bridge ports; keep management outside br-eoip.

Add encryption as a reviewed design

For IP-only access over an untrusted WAN, the WireGuard guide provides routed connectivity with encryption and peer authentication. If a GRE or EoIP peer requires IPsec, agree on the IKE version, certificate identities, proposals, selectors and lifetimes at both ends. Exempt protected traffic from broad NAT and FastTrack, then verify installed SAs and both LAN directions. The ipsec-secret convenience property creates dynamic IPsec configuration; review its actual generated policy and proposal before relying on it. A PSK pasted into one command is not a complete enterprise key-management plan.

ROUTEROS
/ip ipsec active-peers print
/ip ipsec installed-sa print
/ip ipsec policy print detail
/ip firewall nat print stats

Expected result: protected packets increment the intended SA counters and no plaintext tunnel packets leave WAN. Failure analysis: zero counters can mean selector mismatch; a running GRE flag does not prove encryption. Rollback: withdraw the new protected route and disable only the new IPsec objects using the change record, retaining an independent management path.

Encrypted routed access with WireGuard

If it does not work

Troubleshoot from the outside in: verify outer IP reachability, local/remote addresses, firewall counters and routes. The R flag alone does not establish service delivery. If the inner tunnel IP responds but a LAN host does not, inspect its gateway and firewall, return routes and forward policy rather than rebuilding the tunnel.

ROUTEROS
/interface print detail
/ip route print
/ipv6 route print
/ip firewall filter print stats
/ipv6 firewall filter print stats

Small packets may work while large transfers fail. The routed examples start at MTU 1400, not a universal optimum; measure the real path and keep IPv6 MTU at least 1280. EoIP adds Ethernet overhead; full 1500-byte frames need additional transport capacity or fragmentation handling. Do not blindly force MTU 1500 on a 1500-byte path, especially over IPv6.

For ordinary access between two offices, start with routing: IPIP for IPv4 only, GRE for a more flexible IP tunnel. Use EoIP when extending Layer 2 is an actual requirement. Commands were checked against official documentation, not executed on live routers.

Disable first, then remove the selected lab objects

Use only the menu for the tunnel you actually created. For a GRE lab, inspect the entries below before removal. Disabling the interface preserves configuration for diagnosis; removing a route can redirect traffic to a default WAN route, so keep access policy in place until routing is reviewed. Store an encrypted same-device backup plus an export off-device.

ROUTEROS
/interface gre disable [find where name=gre-site]
/ip route print detail where gateway=10.255.0.2
/ip address print where interface=gre-site
# Router A: remove only after the printed entries match this lab
/ip route remove [find where dst-address=192.168.20.0/24 gateway=10.255.0.2]
/ip address remove [find where interface=gre-site]
/interface gre remove [find where name=gre-site]

On B remove the route to 192.168.10.0/24 via 10.255.0.1. Remove lab IPv6 routes/addresses separately and only the exact TUN-commented firewall rules. For EoIP detach ether5 and eoip-site, remove br-eoip only when it has no other users, then restore the original host MTU. Verify original management, WAN routing and LAN connectivity after rollback.

Questions from deployment reviews

Is protocol 47 a UDP port?

No. It is an IP protocol number for GRE. Firewall protocol matching and NAT treatment differ from UDP VPNs.

Does gre6 mean IPv6-only payload?

No. Its endpoints use IPv6; RouterOS GRE can carry routed IPv4 and IPv6 payloads. Outer and inner address families are separate.

Official references

GRE — MikroTik

EoIP — MikroTik

IPIP — MikroTik

GRE6 — MikroTik

IPIPv6 — MikroTik

EoIPv6 — MikroTik

Primary interoperable EoIP/EoIPv6 implementation; verify target wire format

RouterOS IPsec policy and SA inspection

Share

Meet AJInfrastructure & DevOps
Loading…