Site icon System Zone

MikroTik EoIP Tunnel for Bridging LANs over the Internet

VPN (Virtual Private Network) is a technology that provides a secure tunnel across a public network. A private network user can send and receive data to any remote private network using VPN Tunnel as if his/her network device was directly connected to that private network.

MikroTik provides EoIP (Ethernet over IP) that is used to create a site to site VPN tunnel. EoIP tunneling is a MikroTik RouterOS protocol that creates an Ethernet tunnel between two MikroTik Routers on top of an IP connection. So, EoIP Tunnel can be used to communicate with remote LANs across public network using static routing configuration. EoIP Tunnel can also be used to bridge LANs over the Internet that means LAN IP can be assigned to a remote area network using EOIP Tunnel.

The goal of this article is to design an EoIP VPN tunnel that will be used to bridge LANs over the internet. So, in this article I will show how to create an EoIP VPN tunnel between two MikroTik Routers and how to use this VPN tunnel to bridge LANs for keeping in the same layer2 broadcast domain over the internet.

Network Diagram

To configure a site to site EoIP VPN Tunnel that will bridge LANs over the internet, I am following a network diagram like below image.

EoIP VPN for LAN Bridging

In this network, Head Office Router is connected to internet through ether1 interface having IP address 192.168.70.2/30. In your real network this IP address will be replaced with public IP address provided by your ISP. Head Office Router’s ether2 interface is connected to local network. After EoIP tunnel configuration, an EoIP tunnel interface will be created in Head Office Router. We will create a bridge interface where we will enable a DHCP server whose network will be 10.10.11.0/24 and we will add ether2 interface and EoIP tunnel interface into this bridge network so that Head Office LAN and Branch Office LAN can keep at the same broadcast domain and DHCP server can be accessible from the both LANs.

Similarly, Branch Office Router is connected to internet through ether1 interface having IP address 192.168.80.2/30. In your real network this IP address will also be replaced with public IP address. Branch Office Router’s ether2 interface is connected to local network. After EoIP tunnel configuration, an EoIP tunnel interface will also be created in Branch Office Router. We will create a bridge interface and add ether2 interface and EoIP tunnel interface into this bridge network so that Head Office LAN and Branch Office LAN can keep at the same broadcast domain and DHCP server can be accessible from Branch Office LAN.

EoIP Tunnel Configuration for Bridging LANs over the Internet

We will now start our EoIP Tunnel configuration that will bridge our Head Office LAN and Branch Office LAN. Complete EoIP Tunnel configuration according to above network diagram can be divided into two parts.

Part 1: Head Office Router Configuration for EoIP Tunnel

Head Office Router is our core router where DHCP Server will be enabled and Branch Office Router will access this DHCP Server across EoIP Tunnel. Head Office Router configuration for EoIP tunnel can be completed within the following four steps.

Step 1: Head Office RouterOS Basic Configuration

Basic RouterOS configuration includes assigning WAN IP, DNS IP and Route, NAT configuration. The following steps will guide you how to perform basic configuration in Head Office RouterOS.

Basic RouterOS configuration has been completed in Head Office Router. Now we will configure EoIP Tunnel in Head Office Router.

Step 2: EoIP Tunnel Configuration in Head Office Router

The following steps will show how to configure EoIP tunnel in your Head Office Router.

EoIP tunnel configuration in Head Office Router has been completed. Now we will configure bridge in Head Office Router.

Step 3: Bridge Configuration in Head Office Router

By default every interface of MikroTik Router keeps separate broadcast domain that means every port is layer3 port. But we want to keep EoIP tunnel interface and LAN interface at the same broadcast domain. So, we have to turn layer3 port to layer2 port. MikroTik Bridging feature helps to turn layer3 port as layer2 port logically. The following steps will guide you how to configure MikroTik Bridge to keep EoIP tunnel interface and LAN interface at the same broadcast domain.

Bridge configuration has been completed. As EoIP Tunnel interface and ether2 interface are layer2 port now, we cannot assign IP in these ports. But Bridge interface is now layer3 port. So, we will assign our LAN IP on this bridge interface.

Bridge configuration in Head Office Router has been completed. Now we will configure DHCP Server so that LAN workstations get IP address dynamically.

Step 4: DHCP Server Configuration in Head Office Router

In Head Office Router, we will configure DHCP Server so that Head Office LAN workstations as well as Branch Office LAN workstations get IP address dynamically from this DHCP Server. The following steps will show you how to configure DHCP Server in MikroTik RouterOS.

DHCP Server configuration in Head Office Router has been completed. We will now configure Branch Office Router so that Branch Office LAN workstation can get IP from this DHCP Server.

Part 2: Branch Office Router configuration for EoIP Tunnel

Branch Office Router will be used to create just EoIP Tunnel. There is no extra configuration without EoIP Tunnel related configuration. Complete EoIP Tunnel configuration in Branch Office Router can be divided into three steps.

Step 1: Branch Office Router Basic Configuration

Basic RouterOS configuration includes assigning WAN IP, LAN, DNS IP and Route, NAT configuration. But in Branch Office Router we will only assign WAN IP and Gateway IP. The following steps will show how to assign WAN IP and Gateway IP in Branch Office Router.

Basic RouterOS configuration in Branch Office Router has been completed. Now we configure EoIP Tunnel in Branch Office Router.

Step 2: EoIP Tunnel Configuration in Branch Office Router

The following steps will show how to configure EoIP tunnel in your Branch Office Router.

EoIP tunnel configuration in Branch Office Router has been completed. Now we will configure bridge in Branch Office Router so that LAN Interface and EoIP Tunnel Interface keep at the same broadcast domain.

Step 3: Bridge Configuration in Branch Office Router

The following steps will guide you how to configure MikroTik Bridge to keep EoIP tunnel interface and LAN interface at the same broadcast domain.

Bridge configuration in Branch Office Router has been completed. Now Branch Office Network and Head Office Network are in the same broadcast domain over the internet and both Office network will be capable to get IP address from Head Office DHCP Server.

Connect any workstation from Branch Office Router and if everything is OK, the workstation will get an IP address dynamically from DHCP Server and will be capable to access any workstation or server of Head Office Network.

MikroTik EoIP Tunnel Configuration for Bridging LANs over the Internet has been explained step by step in this article. I hope will now be able to configure EoIP Tunnel for bridging LAN over the Internet. However, if you face any problem to configure EoIP Tunnel, feel free to discuss in comment or contact with me from Contact page. I will try my best stay with you.

Exit mobile version