Hi everyone, in this post I want to show you how to set up a MikroTik hotspot in Winbox from scratch. A MikroTik hotspot makes every connected device log in through a web page before it can use the internet. This feature is a good fit for cafes, small shops, boarding houses, schools, or offices that want guests to use their own accounts.
The lab uses the MikroTik CHR RouterOS 7.25.2 from this series, with one Linux Mint computer as the guest. I walk through Hotspot Setup from start until the login page appears in the browser, then show how to keep the hotspot from asking guests to log in all the time. The DHCP and DNS concepts the hotspot relies on are covered in the articles on the DHCP server and the MikroTik DNS server.
Prepare a Dedicated Hotspot Port
Remove the port from the bridge

/interface bridge port remove [find interface=ether3]
/interface ethernet set ether3 comment="hotspot"
/interface bridge port printI use ether3 only for guests, while ether2 stays on the admin network and WinBox. Do not put the hotspot on the interface you use to manage the router. Once the hotspot is active, every device on that interface has to log in first, including the admin computer, and your WinBox access can drop. If you want the hotspot on a bridge, choose the bridge interface itself, not a member port of the bridge.
Running Hotspot Setup
Open IP Hotspot

Click IP, then Hotspot. In the Actions panel on the right, click Hotspot Setup.
Choose the interface

The wizard fills in ether1 as the initial choice. Change it to ether3 and click Next. Be careful at this step, because choosing ether1, which is connected to the internet, makes the router demand a login for WAN traffic.
Hotspot network address

The wizard suggests 10.5.50.1/24 as the router IP on the hotspot network. Leave Masquerade Network checked so hotspot clients can reach the internet, then click Next.
Address pool

The pool 10.5.50.2-10.5.50.254 is used by the DHCP server to hand out IPs to guests. Click Next.
SSL certificate

Leave it at none. The login page will use plain HTTP. An SSL certificate is only needed if you want the login page to use HTTPS with a real domain. Click Next.
SMTP server

Leave it at 0.0.0.0. This setting only redirects customer email to a specific SMTP server. Click Next.
DNS server

The wizard fills in DNS from the router’s current settings. I changed the first DNS to 1.1.1.1 and kept 8.8.8.8. Keep in mind that this step also changes the router’s DNS servers under IP DNS. Click Next.
DNS name

Enter a DNS Name that will appear in the address bar of the login page, for example login.hotspot.lab. A name in the address bar looks cleaner than an IP, and guests can open that name at any time to check their status or log out. Click Next.
Local hotspot user

The wizard creates one hotspot user. I renamed it to tamu1. For the lab, the password is left empty so it is easy to test. For real use, set a password. Click Next until the wizard finishes.
The hotspot server is created

The Servers tab now shows hotspot1 with interface ether3, address pool hs-pool-4, and profile hsprof1. Addresses Per MAC is set to 2.
What the wizard created

/ip address print where interface=ether3
/ip dhcp-server print
/ip firewall nat print where !dynamicThe wizard created the IP 10.5.50.1/24 on ether3, DHCP server dhcp2 for ether3, and a NAT masquerade rule for 10.5.50.0/24. It also added dynamic firewall and NAT rules that redirect guests who have not logged in to the login page, plus a hotspot folder with the login page files in the Files menu.
Testing the Login from a Guest Computer
The login page appears automatically

The guest computer gets the IP 10.5.50.2 from the hotspot DHCP right away. When I open http://neverssl.com in Firefox, the browser is redirected to http://login.hotspot.lab/login. Firefox also shows the notice You must log in to this network because it detects a captive portal. Enter Username tamu1 and click Connect.
Logged in successfully

The You are logged in page appears and the browser is sent on to the site you opened earlier. Firefox blocks the status pop up window, so you can ignore that notice.
Check active users

In WinBox, the Active tab shows tamu1 with IP 10.5.50.2, along with its uptime and speed. To disconnect a guest, select that row and click Remove.
My experience: I almost missed two things in the wizard. First, the interface choice was prefilled with ether1, which is the internet port. Second, the DNS step was prefilled with 192.168.1.1, which turned out to replace the router’s DNS server if left as is. The wizard is fast, but you need to read every step instead of just pressing Next. To test the login page, I deliberately opened an HTTP address like neverssl.com, because the MikroTik documentation explains that HTTPS pages cannot be redirected smoothly without a valid certificate.
Keeping the Hotspot from Asking for Login All the Time
The most common complaint from hotspot users is having to log in over and over. MikroTik stores a cookie in the browser after login, so the next login happens automatically.
First login and the cookie

/ip hotspot active print detail
/ip hotspot cookie print
/ip hotspot active remove [find user=tamu1]The first login is recorded as login-by http-chap, meaning it went through the form. At the same time the router stores a cookie for tamu1 valid for 2d23h, roughly 3 days as per the default. Then I disconnected the tamu1 session to simulate a guest who got disconnected.
Open a site again

On the guest computer I opened neverssl.com again. Without filling in the form, You are logged in appears right away.
Login by cookie and a longer lifetime

/ip hotspot profile set hsprof1 http-cookie-lifetime=7d
/ip hotspot profile print where name=hsprof1The new session is recorded as login-by cookie. I also extended http-cookie-lifetime to 7 days, which RouterOS displays as 1w. In WinBox, change it on the Server Profiles tab: open hsprof1, go to the Login tab, and edit the HTTP Cookie Lifetime field.
Other settings that affect how often guests are asked to log in:
Server Profile http-cookie-lifetime : how long the cookie stays valid in the browser
User Profile session-timeout : maximum length of one session, 0 means unlimited
User Profile idle-timeout : disconnect if there is no traffic for this long
User Profile keepalive-timeout : disconnect if the device stops responding
Login By mac-cookie : automatic login based on MAC, not tied to the browserA cookie only works in the same browser. If a guest clears cookies, uses private mode, or the phone randomizes its MAC address, the guest will be asked to log in again.
Common Problems and How to Fix Them
The login page does not appear
Open an HTTP address, not HTTPS. Make sure the client uses DNS from the router, not a manually set DNS, and check that the hotspot DHCP is handing out IPs. Typing the hotspot DNS name directly in the browser also opens the login page.
Clients do not get an IP
Check that there is a DHCP server on the hotspot interface and that there are not two DHCP servers on the same interface. The pool must be in the same subnet as the hotspot local address.
WinBox disconnects after creating the hotspot
The hotspot was installed on the interface the admin uses. Connect by MAC address from the Neighbors tab through another port, then move the hotspot to the correct interface. Alternatively, add the admin device to IP Bindings with type bypassed.
Logged in but no internet
Check the NAT masquerade rule for the hotspot network and the router’s default route. Try pinging 8.8.8.8 from the router.
The user profile rate limit does not work
The hotspot rate limit uses dynamic Simple Queues, so a FastTrack rule can make traffic skip them. Check the FastTrack rule as covered in the Simple Queue article.
At this point the MikroTik hotspot is running from zero until guests can log in without having to log in again and again. In the next article we will create MikroTik hotspot vouchers so guests can buy access with a code. If you have ever customized the look of the hotspot login page, share your tips in the comments.












