MikroTik Hotspot Setup with a Custom Login Page (Step by Step)
Create a MikroTik Hotspot for a cafe, office or hostel: run the setup wizard, add users and speed limits, customize the login page and fix the problems users report most.
Problem
You want guests to log in before they can use the Wi-Fi or LAN, each with their own username, a time or speed limit, and a branded login page.
Symptoms (common after a first setup)
- The login page does not appear on phones.
- Users log in but have no internet.
- An edited login page loses its style or stops logging users in.
Likely causes
- HTTPS sites cannot be redirected, so the login page appears only for an
http://page or the phone's captive-portal check. - The client uses a hard-coded DNS server, or the hotspot DNS name does not resolve.
- Required variables or form fields were removed from
login.html.
Prerequisites
- A separate interface or bridge for guests, for example
bridge-guest, with no other DHCP server on it. - Internet already working on the router.
Solution (WinBox / CLI)
1. Run the setup wizard (IP > Hotspot > Hotspot Setup in WinBox):
/ip hotspot setupAnswer the prompts: hotspot interface bridge-guest, local address 10.10.10.1/24, masquerade yes, address pool 10.10.10.2-10.10.10.254, certificate none, SMTP 0.0.0.0, DNS servers (for example 8.8.8.8), a DNS name under a domain you own (for example wifi.yourcompany.com), and the first user.
2. Add speed and time limits with user profiles:
/ip hotspot user profile add name=2M rate-limit=2M/2M shared-users=1 session-timeout=1d
/ip hotspot user add name=guest01 password=Pass1234 profile=2M limit-uptime=1d3. Allow some sites without login (walled garden), for example your website or a payment page:
/ip hotspot walled-garden add dst-host=*.yourcompany.com4. Customize the login page.
- In WinBox, open Files. The wizard created a folder named
hotspot(on some devicesflash/hotspot). - Drag
login.htmlto your PC, change the text, colours and logo, and drag it back. Keep images in the same folder and use relative paths. - Keep the form and its variables, such as
$(link-login-only),$(link-orig)and theusernameandpasswordfields. Without them, login stops working. - For a separate design, copy the folder to
hotspot-customand point the server profile to it:
/ip hotspot profile set hsprof1 html-directory=hotspot-customVerification
/ip hotspot active print
/ip hotspot host printConnect a phone to the guest network. The login page should open by itself, and after login the user appears in active.
Common errors
- Login page does not open: open an
http://site such ashttp://neverssl.com, and check that guest DHCP gives the router as the DNS server. - Logged in but no internet: the masquerade rule for the hotspot network is missing, or a firewall rule drops the guest subnet.
- Users share one account: set
shared-users=1in the user profile. - Edited login.html stops working: a variable or the form action was removed. Restore the original file and edit again.
Rollback
/ip hotspot disable [find]Disabling the hotspot server returns the network to normal access without login. Remove it with /ip hotspot remove [find] when you no longer need it.
Watch the video (Bangla): Customize the MikroTik Hotspot login page
This topic is covered hands-on in MTCUME — MikroTik Certified User Management Engineer.
View MTCUME