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.

  • From Winbox, go to IP > Hotspot menu item. Hotspot window will appear now.
  • Click on Servers tab and then click on Hotspot Setup button. Hotspot Setup window will appear now.
  • Choose LAN interface from Hotspot Interface drop-down menu. If you have bridge interface created before and want to setup Hotspot Server on bridge interface, choose the bridge interface from drop-down menu. Now click Next button.
  • By default LAN Gateway IP will be assigned on Local Address of Network input field. Masquerade Network checkbox must be unchecked. Click Next button.
  • Choose address pool for Hotspot Server from where IP address will be assigned to clients. Normally, it will show network IP range without gateway IP. We can change default range as we wish or can keep the default range. Click Next button.
  • If you have SSL certificate, you can import by choosing import other certificate option. But Select none as we do not have any SSL certificate now. Click Next button.
  • If you have SMTP server, you can put SMTP Server address in IP Address of SMTP Server input box. As we have no SMTP Server, keep it blank. Click Next button.
  • DNS servers that we have provided in basic configuration will automatically be assigned in DNS Servers input field. So, nothing to do just click Next button.
  • Now it is time to put DNS name and it is a mandatory field. DNS name will be used to get Hotspot login page. So, put a standard DNS name such as systemzone.mk or systemzone.net etc. and click Next button.
  • Now put a local Hotspot User. By default it is admin. We can keep this user or change as our wish. Also put password in Password field for the User. Click Next button.
  • Hotspot Server setup has been completed and you will get a successful message now.

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 with ECMP Load Balancing
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.

Why not a Cup of COFFEE if the solution?

mikrotik-hotspot-configuration-with-ecmp-load-balancing

ABU SAYEED

I am a system administrator and like to share knowledge that I am learning from my daily experience. I usually work on MikroTik, Redhat/CentOS Linux, Windows Server, physical server and storage, virtual technology and other system related topics. Follow Me: Facebook, Twitter and Linkedin.

Your name can also be listed here. Have an IT topic? Submit it here to become a System Zone author.

Leave a Reply

Your email address will not be published. Required fields are marked *

*