Configuring HotSpot on MikroTik (RouterOS)

I will describe the steps that need to be performed to configure HotSpot in Mikrotik.

1) If several networks will be used on Mikrotik, for example, local and separately HotSpot, then first of all we will create a new bridge in the “Bridge” menu, for example Bridge_hotspot, then in “Bridge” – “Ports” we will select the desired port and transfer it from bridge-local on Bridge_hotspot. Assign the IP address for Bridge_hotspot in the “IP” – “Addresses” menu.

2) In “IP” – “Pool” add a new range of addresses that will be distributed to customers in HotSpot.
In “IP” – “DHCP Server” – “DHCP” we will create a new DHCP server for each of them for Bridge_hotspot.
In “IP” – “DHCP Server” – “Networks” add a new network.

3) Open the “IP” – “Hotspot” and create it by specifying the Bridge_hotspot interface and select the address range created in the “IP” – “Pool”.
“IP” – “Hotspot” – “Server Profiles” edit the standard profile to fit your needs, you can also limit the data transfer rate with the parameter “Rate Limit (rx/tx)”. In “Login By” you can only check the “HTTP CHAP” and “Trial” checkboxes, then users will be able to connect to the access point without a password for the time specified in the “Trial Uptime Limit”, after which they will again be transferred to the MikroTik HTML page, on which you need to press the input again and you can continue to use the Internet. I set 1d 00:00:00 in the Trial Uptime Limit field so that the login ad page is automatically displayed once a day (without viewing it and pressing the login button on it, the Internet will not work).

To change the entry page in the “Files” menu, find the file /hotspot/login.html, download it and edit it in a text or HTML editor to your needs, then upload it back using FTP.
I’ll give an example of HTML code with a simple login link:

<html>
<head>
<title>HotSpot - Free Internet</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="-1" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"/>
 
<style type="text/css">
body {color: #727272; font-size: 14px; font-family: verdana;}
</style>
 
</head>
<body>
<a style="color: #FF8080"href="$(link-login-only)?dst=$(link-orig-esc)&username=T-$(mac-esc)">Получить бесплатный доступ к интернету</a>
</body>
</html>

In the menu “IP” – “Hotspot” – “Walled Garden”, where “src. Address” you can specify which IP addresses will always be allowed to access without visiting the login page.
To go to the MikroTik settings from the local network after setting up HotSpot, you will need to open “Winbox” – “Neighbors”. If from a WAN, then read this article – Configuring Remote Access on Mikrotik Routers.

Done.

Leave a comment

Leave a Reply