In this article I want to show you how to create tunnel interface on Mikrotik. There are two types of tunneling supported by Mikrotik, IP-IP (IP over IP) tunnel and EoIP (Ethernet over IP) tunnel.
This article will show you how to create both tunneling. In this article we have to achieve the condition below.
Mikrotik Router A IP Address: 220.127.116.11/28
Mikrotik Router B IP Address: 18.104.22.168/27
Point to Point IP Address: 192.168.201.0/30
1. IP-IP (IP over IP) Tunnel
interface ipip add name=ipip1 local-address=22.214.171.124 remote-address=126.96.36.199 disabled=no ip address add address=192.168.201.1/30 interface=ipip1 disabled=no
interface ipip add name=ipip1 local-address=188.8.131.52 remote-address=184.108.40.206 disabled=no ip address add address=192.168.201.2/30 interface=ipip1 disabled=no
2. Ethernet over IP (EoIP) Tunnel
interface eoip add name=eoip-tunnel1 remote-address=220.127.116.11 tunnel-id=1 arp=enabled ip address add address=192.168.201.1/30 interface= eoip-tunnel1 disabled=no
interface eoip add name=eoip-tunnel1 remote-address=18.104.22.168 tunnel-id=1 arp=enabled ip address add address=192.168.201.2/30 interface= eoip-tunnel1 disabled=no
After the tunnel interface has been configured, you have to add route the network address that you want to allocate. For example if you want to add a network address of 22.214.171.124/24 that point to Router B, you have to add a route in the Router A as follow:
ip route add dst-address=126.96.36.199/24 gateway=192.168.201.2