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: 18.104.22.168/28
Mikrotik Router B IP Address: 22.214.171.124/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=126.96.36.199 remote-address=188.8.131.52 disabled=no ip address add address=192.168.201.1/30 interface=ipip1 disabled=no
interface ipip add name=ipip1 local-address=184.108.40.206 remote-address=220.127.116.11 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=18.104.22.168 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=22.214.171.124 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 126.96.36.199/24 that point to Router B, you have to add a route in the Router A as follow:
ip route add dst-address=188.8.131.52/24 gateway=192.168.201.2