Site icon System Zone

MikroTik Hotspot Configuration with ECMP Load Balancing

MikroTik Hotspot is one of the most popular services in MikroTik RouterOS and day be day the demand of Hotspot service is increasing. MikroTik Hotspot can be used in any Airport, Hotel, Restaurant, Campus, Camp, Office or any ISP network. It is also possible to establish a WiFi Broadband Network with the MikroTik Hotspot service. How to configure MikroTik Hotspot was discussed in one of my previous articles. Although MikroTik Hotspot configuration is not so difficult but sometimes we face difficulties to configure MikroTik Hotspot with load balancing. So, in this article we are going to see how to configure MikroTik Hotspot Server with ECMP load balancing and link redundancy technique.

ECMP Load Balancing and Link Redundancy Configuration

ECMP is a so easy but stable load balancing and link redundancy technique in MikroTik RouterOS. ECMP can be configured for both equal or unequal bandwidth link. For this article configuration, we assume that we have equal bandwidth uplink connections which are named as ISP1 and ISP2. We have also a LAN interface (either bridge or physical interface) named as LAN where Hotspot will be configured.

So, at first we will assign IP address on ISP1, ISP2 and LAN interfaces. Issue the following commands to assign IP addresses on these interfaces. Don’t forget to replace IP information according to your network.

/ip address
add address=192.168.10.10/24 interface=ISP1 network=192.168.10.0
add address=172.22.2.2/24 interface=ISP2 network=172.22.2.0
add address=10.10.0.1/23 interface=LAN network=10.10.0.0

Now we will assign DNS IP so that our Router can communicate to public domain. Issue the following command to assign DNS IP addresses.

/ip dns
set servers=8.8.8.8,8.8.4.4

We will now configure NAT so that Hotspot users can get internet access. Issue the following command to configure firewall NAT.

/ip firewall nat
add action=masquerade chain=srcnat out-interface=ISP1
add action=masquerade chain=srcnat out-interface=ISP2

We will now configure route according to ECMP load balancing technique. Issue the following commands to configure route for ECMP load balancing.

/ip route
add check-gateway=ping distance=1 gateway=172.22.2.1,192.168.10.1

ECMP load balancing and link redundancy configuration is now complete. But we have a little issue here. If we want to access MikroTik Router from public area, the connection will be failed because any connection that was established from ISP1 interface can be routed over ISP2 interface.

To overcome this issue, we need to tell if any connection established from ISP1 should be routed over ISP1 interface and vice versa. For this, we will create some mangle rules to mark connection and routing. Issue the commands to mark ISP1 and ISP2 connections and routing.

/ip firewall mangle add action=mark-connection chain=input in-interface=ISP1 new-connection-mark=isp1_conn passthrough=no add action=mark-connection chain=input in-interface=ISP2 new-connection-mark=isp2_conn passthrough=no add action=mark-routing chain=output connection-mark=isp1_conn new-routing-mark=to_isp1 passthrough=no add action=mark-routing chain=output connection-mark=isp2_conn new-routing-mark=to_isp2 passthrough=no

Now run the following commands to route these marked packets properly through ISP1 and ISP2 interfaces.

/ip route add check-gateway=ping distance=1 gateway=192.168.10.1 routing-mark=to_isp1 add check-gateway=ping distance=1 gateway=172.22.2.1 routing-mark=to_isp2

ECMP load balancing and link redundancy configuration has been completed. We will now configure MikroTik Hotspot that will use this ECMP load balancing.

Hotspot Configuration with ECMP Load Balancing Network

MikroTik Hotspot can easily be configured with Winbox. So, we will now configure MikroTik Hotspot using Winbox. Login to MikroTik Router with Winbox software and follow the following steps to configure Hotspot with Winbox.

Hotspot Server with ECMP load balancing and link redundancy is now ready. You can now create Hotspot user profile and user and can use Hotspot service smoothly.

MikroTik Hotspot Server

How to configure MikroTik Hotspot with ECMP load balancing has been discussed in this article. I hope, you will now be able to configure MikroTik Hotspot with ECMP load balancing. However, if you face any confusion, feel free to discuss in comment or contact me from Contact page. I will try my best to stay with you.

Exit mobile version