GuíasGuides · Sector 1Sector 1

WiFi de huéspedes en MikroTik: red aislada, Hotspot con portal cautivo, vales, límites por usuario y un huésped que no navegaGuest Wi-Fi on MikroTik: an isolated network, Hotspot with a captive portal, vouchers, per-user limits and a guest who can't browse

La red de huéspedes de un hotel o un restaurante en RouterOS 7: VLAN separada del TPV y del personal, cortafuegos hacia las redes privadas, ip hotspot setup, la página de acceso, usuarios y vales con perfiles y límites, el walled garden para la web del hotel, el DHCP y los registros, y el huésped que se conecta pero no ve el portal.A hotel or restaurant guest network on RouterOS 7: a VLAN apart from the POS and staff, a firewall towards private ranges, ip hotspot setup, the login page, users and vouchers with profiles and limits, the walled garden for the hotel website, DHCP and logs, and the guest who connects but never sees the portal.

Qué vas a conseguir

Una WiFi de huéspedes que se gestiona sola: aislada del TPV, de los datáfonos y de la red del personal, con una página de acceso del hotel, usuarios por habitación o vales para el restaurante, un límite de velocidad por persona y los registros para saber quién se conectó. Y un método para el ticket más repetido de recepción: "estoy conectado pero no me sale nada".

Antes de empezar

  • Un router MikroTik con RouterOS 7 y la red del local montada como en la guía de red y WiFi de un restaurante u hotel: un bridge con filtrado de VLAN y la VLAN 100 para clientes.
  • Puntos de acceso que lleven el SSID de huéspedes a esa VLAN. Si son TP-Link Omada, el SSID sin el portal de Omada: un solo portal, el del MikroTik.
  • Acceso por Winbox o SSH desde la VLAN de gestión, y una copia (/export) antes de empezar.
  • Saber qué pide la dirección: acceso libre aceptando condiciones, clave por habitación o vales de un día.

1. La red de huéspedes, aparte

La VLAN 100 tiene su interfaz y su subred. Una /22 da más de mil direcciones, suficiente para un hotel lleno con dos o tres dispositivos por persona:

RouterOS · la interfaz de huéspedes
/interface vlan add interface=bridge1 name=vlan100-huespedes vlan-id=100/ip address add address=10.40.100.1/22 interface=vlan100-huespedes/ip firewall address-list add list=redes-privadas address=10.0.0.0/8/ip firewall address-list add list=redes-privadas address=172.16.0.0/12/ip firewall address-list add list=redes-privadas address=192.168.0.0/16/ip firewall filter add chain=forward in-interface=vlan100-huespedes dst-address-list=redes-privadas action=drop comment="huespedes: nada interno" place-before=0
  • La regla bloquea cualquier destino privado, no solo las VLAN del local: también la red del router 4G (192.168.8.0/24) o una VPN hacia la central.
  • Hacia el router, los huéspedes solo necesitan DHCP, DNS y el portal. Las reglas dinámicas del Hotspot abren lo suyo; añade DNS y cierra lo demás:
RouterOS · lo que un huésped puede pedir al router
/ip firewall filter add chain=input in-interface=vlan100-huespedes protocol=udp dst-port=53,67 action=accept comment="huespedes: DNS y DHCP"/ip firewall filter add chain=input in-interface=vlan100-huespedes protocol=tcp dst-port=53 action=accept/ip firewall filter add chain=input in-interface=vlan100-huespedes action=drop comment="huespedes: ni Winbox ni SSH"
  • Aislamiento entre clientes en el punto de acceso: un huésped no debe ver el portátil del de al lado. En Omada, Guest Network en el SSID; en un punto de acceso MikroTik con el paquete wifi, client-isolation=yes en el datapath del SSID.

2. El Hotspot con ip hotspot setup

El asistente crea el servidor, el perfil, el pool, el DHCP y las reglas dinámicas en una sola pasada:

RouterOS · /ip hotspot setup
/ip hotspot setuphotspot interface: vlan100-huespedeslocal address of network: 10.40.100.1/22masquerade network: noaddress pool of network: 10.40.100.10-10.40.103.250select certificate: noneip address of smtp server: 0.0.0.0dns servers: 1.1.1.1,9.9.9.9dns name: wifi.northwind.examplename of local hotspot user: recepcionpassword for the user: ********
  • masquerade network: no porque la regla de NAT hacia la WAN ya existe. Si respondes que sí, quedará una segunda regla que hace lo mismo.
  • dns name es el nombre con el que el huésped ve el portal y al que vuelve para cerrar sesión. Uno corto y del dominio del hotel.
  • El router hace de DNS para los huéspedes: /ip dns set allow-remote-requests=yes. Con el input cerrado como en la sección 1, solo responde a las redes internas.
  • Revisa lo creado con /ip hotspot print, /ip hotspot profile print y /ip dhcp-server print. En IP › Firewall verás reglas marcadas con D en cadenas hs-*: son dinámicas, van siempre arriba y no se tocan.

El asistente pone el DHCP con su propio tiempo de concesión. Ajústalo en la sección 5; con un salón lleno, el tiempo de concesión decide si el pool alcanza.

3. La página de acceso y el walled garden

Las páginas del portal están en Files › hotspot: login.html, status.html, logout.html y sus imágenes. Se editan fuera del router y se suben de nuevo:

  • En login.html, el logotipo del hotel, el texto de condiciones de uso (lo redacta la dirección o su asesor legal) y los campos de usuario y clave. No quites el formulario ni sus campos ocultos: son los que envían el inicio de sesión.
  • Guarda una copia de la carpeta original antes de tocarla. Si la página deja de funcionar, se vuelve a ella.
  • Cómo se entra se elige en el perfil del servidor:
RouterOS · perfil del servidor Hotspot
/ip hotspot profile set [find name=hsprof1] login-by=http-chap,cookie,trial http-cookie-lifetime=1d trial-uptime-limit=30m trial-user-profile=default
  • http-chap: usuario y clave sin que viajen en claro. cookie: el dispositivo no vuelve a pedir el portal en un día. trial: acceso libre de 30 minutos al día por dispositivo, útil en una cafetería; quítalo si todo debe pasar por usuario.

El walled garden es lo que se puede abrir sin iniciar sesión: la web del hotel, la carta del restaurante o la pasarela de reservas:

RouterOS · walled garden
/ip hotspot walled-garden add dst-host=www.northwind.example comment="web del hotel"/ip hotspot walled-garden add dst-host=*.northwind.example comment="carta y reservas"/ip hotspot walled-garden ip add dst-address=203.0.113.40 action=accept comment="servidor de reservas por IP"

walled-garden filtra por nombre las peticiones web; walled-garden ip, cualquier tráfico por dirección. Cuanto más corto, mejor: cada entrada es una puerta abierta sin identificar a nadie.

4. Usuarios, vales y perfiles con límites

El perfil de usuario fija la velocidad y la duración; el usuario, quién entra:

RouterOS · perfiles y usuarios
/ip hotspot user profile add name=huesped rate-limit=5M/20M shared-users=3 idle-timeout=30m keepalive-timeout=2m/ip hotspot user profile add name=evento rate-limit=2M/8M shared-users=1 session-timeout=6h/ip hotspot user add name=hab214 password=Mar7lago profile=huesped limit-uptime=3d comment="check-out 06/11"/ip hotspot user add name=boda1108-01 password=k4p9 profile=evento limit-uptime=8h/ip hotspot user print where profile=huespedColumns: NAME, PROFILE, UPTIME#  NAME    PROFILE  UPTIME0  hab214  huesped  0s
  • rate-limit es subida/bajada del huésped: 5M/20M son 5 Mbps de subida y 20 de bajada por usuario. El Hotspot crea una cola dinámica por cada sesión.
  • shared-users=3: el móvil, la tableta y el portátil de la habitación con la misma clave.
  • limit-uptime caduca la clave por tiempo de conexión; para que no sirva después del check-out, recepción la borra o el usuario se crea con la duración de la estancia.
  • Vales para eventos o el restaurante: lotes de usuarios del perfil evento impresos en tarjetas. Para muchos lotes o vales con caducidad por fecha, el paquete User Manager de RouterOS 7 hace de servidor RADIUS y los genera; el Hotspot lo usa con use-radius=yes en el perfil del servidor.
  • Las colas del Hotspot limitan a cada huésped. El total de la red de clientes, para que siempre quede ancho de banda para el TPV, va en una cola simple sobre la /22, como en la guía de red del local. Y recuerda: lo que va por FastTrack se salta las colas.

5. DHCP, concesiones y registros

RouterOS · concesión y ocupación del pool
/ip dhcp-server set [find interface=vlan100-huespedes] name=dhcp-huespedes lease-time=1h/ip dhcp-server lease print count-only where server=dhcp-huespedes388/ip hotspot active printColumns: SERVER, USER, ADDRESS, UPTIME, SESSION-TIME-LEFT#  SERVER     USER         ADDRESS        UPTIME   SESSION-TIME-LEFT0  hotspot1   hab214       10.40.100.57   1h12m1  hotspot1   boda1108-01  10.40.101.203  22m      5h38m
  • Una hora de concesión libera rápido las direcciones de quien se va, sin que el huésped que se queda lo note.
  • /ip hotspot host print muestra todos los dispositivos que el Hotspot ve, hayan iniciado sesión o no; /ip hotspot active print, solo las sesiones abiertas.
  • Registros: /system logging add topics=hotspot action=memory y /log print where topics~"hotspot". Cada inicio y cierre de sesión queda con usuario, IP y MAC.
  • En muchos países la ley obliga a conservar los registros de conexión de una red pública durante un tiempo. Envíalos a un servidor syslog (/system logging action add name=syslog target=remote remote=10.40.10.20) y pregunta a la dirección cuánto tiempo deben guardarse.

6. El ticket: "el huésped se conecta a la WiFi pero no navega / no le sale la página de acceso"

Viernes, 22:40. Recepción llama: el cliente de la 312 ve "Conectado" en el móvil, pero no le aparece la página para poner la clave y no carga nada. Otros huéspedes navegan bien.

  1. ¿Tiene dirección? En /ip hotspot host print se busca su MAC (el huésped la ve en los ajustes de la WiFi). Si no aparece, no ha recibido IP: /ip dhcp-server lease print count-only da 1.012 de 1.019 posibles. El pool está agotado por un tiempo de concesión de tres días que alguien puso. Se baja a una hora y se libera lo que no está activo; a los minutos el móvil obtiene dirección. Si aparece con una 169.254.x.x en su móvil, es lo mismo.
  2. Tiene IP, pero no sale el portal. El sistema del móvil detecta el portal pidiendo una página http:// fija a su fabricante; el Hotspot la intercepta y abre la ventana de acceso. Si no la abre:
  • Navegadores con HTTPS primero: el huésped escribe una web en https://. El Hotspot no puede redirigir HTTPS sin un error de certificado, así que la página no carga. Que abra http://wifi.northwind.example (el dns name); recepción lo tiene impreso en la tarjeta de la habitación.
  • DNS fijo o VPN: un móvil con DNS privado fijado en un proveedor concreto, o con una VPN que arranca sola, no ve el portal. Que ponga el DNS privado en automático o pause la VPN hasta iniciar sesión.
  • El walled garden demasiado generoso: si alguien añadió los dominios de comprobación de los fabricantes (o un * amplio) al walled garden, el móvil cree que ya tiene internet y no abre la ventana. /ip hotspot walled-garden print y fuera lo que no sea la web del hotel.
  1. Ve el portal, pone la clave y falla. /log print where topics~"hotspot" muestra el intento: login failed: invalid username or password, o que el usuario ha agotado su tiempo. La clave caducó con el limit-uptime, o hay más dispositivos que shared-users. Recepción le da una nueva.
  2. Inicia sesión y no navega. Si /ip hotspot active print lo muestra activo, el problema está detrás: /ping 1.1.1.1 desde el router, la DNS (/ip dns print) y la cola de su sesión en /queue simple print where dynamic. Si todos los huéspedes van mal a la vez, es la salida a internet y el ticket cambia de dueño.

En el ticket: MAC e IP del dispositivo, en qué paso falló, la causa y el cambio (concesión, walled garden, usuario). Si fue el pool, que se revise también en los demás establecimientos.

Una tarjeta en la habitación con el nombre de la red, la dirección http:// del portal y la clave evita la mitad de estas llamadas.

Siguientes pasos

  • La guía de red y WiFi de un restaurante u hotel tiene el plan de VLAN completo, la doble WAN y la WiFi lenta en mitad de una boda.
  • La de Zabbix en un restaurante o un hotel puede vigilar el número de sesiones del Hotspot y la ocupación del pool para avisar antes de que se agote.
  • Si el hotel quiere que el usuario de la WiFi salga del sistema de reservas al hacer el check-in, el paso siguiente es un servidor RADIUS conectado al PMS.

¿Falta algo o en tu entorno es distinto? Escríbeme y lo corrijo.

What you'll get

A guest Wi-Fi that runs itself: isolated from the POS, the card terminals and the staff network, with a hotel login page, per-room users or vouchers for the restaurant, a speed limit per person and logs to know who connected. And a method for reception's most repeated ticket: "I'm connected but nothing comes up".

Before you start

  • A MikroTik router on RouterOS 7 with the venue network built as in the restaurant or hotel network and WiFi guide: a bridge with VLAN filtering and VLAN 100 for guests.
  • Access points that put the guest SSID on that VLAN. If they are TP-Link Omada, the SSID without Omada's portal: one portal only, the MikroTik's.
  • Winbox or SSH access from the management VLAN, and a backup (/export) before you start.
  • Knowing what management wants: free access after accepting terms, a key per room or one-day vouchers.

1. The guest network, kept apart

VLAN 100 has its own interface and subnet. A /22 gives over a thousand addresses, enough for a full hotel with two or three devices per person:

RouterOS · the guest interface
/interface vlan add interface=bridge1 name=vlan100-huespedes vlan-id=100/ip address add address=10.40.100.1/22 interface=vlan100-huespedes/ip firewall address-list add list=redes-privadas address=10.0.0.0/8/ip firewall address-list add list=redes-privadas address=172.16.0.0/12/ip firewall address-list add list=redes-privadas address=192.168.0.0/16/ip firewall filter add chain=forward in-interface=vlan100-huespedes dst-address-list=redes-privadas action=drop comment="guests: nothing internal" place-before=0
  • The rule blocks every private destination, not only the venue's VLANs: also the 4G router's network (192.168.8.0/24) or a VPN to head office.
  • Towards the router, guests only need DHCP, DNS and the portal. The Hotspot's dynamic rules open what it needs; add DNS and close the rest:
RouterOS · what a guest may ask the router for
/ip firewall filter add chain=input in-interface=vlan100-huespedes protocol=udp dst-port=53,67 action=accept comment="guests: DNS and DHCP"/ip firewall filter add chain=input in-interface=vlan100-huespedes protocol=tcp dst-port=53 action=accept/ip firewall filter add chain=input in-interface=vlan100-huespedes action=drop comment="guests: no Winbox, no SSH"
  • Client isolation on the access point: a guest must not see the laptop next door. In Omada, Guest Network on the SSID; on a MikroTik access point with the wifi package, client-isolation=yes on the SSID's datapath.

2. The Hotspot with ip hotspot setup

The wizard creates the server, the profile, the pool, the DHCP server and the dynamic rules in one go:

RouterOS · /ip hotspot setup
/ip hotspot setuphotspot interface: vlan100-huespedeslocal address of network: 10.40.100.1/22masquerade network: noaddress pool of network: 10.40.100.10-10.40.103.250select certificate: noneip address of smtp server: 0.0.0.0dns servers: 1.1.1.1,9.9.9.9dns name: wifi.northwind.examplename of local hotspot user: recepcionpassword for the user: ********
  • masquerade network: no because the NAT rule towards the WAN already exists. Answer yes and you get a second rule doing the same thing.
  • dns name is the name under which the guest sees the portal and goes back to log out. A short one in the hotel's domain.
  • The router is the guests' DNS: /ip dns set allow-remote-requests=yes. With input closed as in section 1, it only answers the internal networks.
  • Review what was created with /ip hotspot print, /ip hotspot profile print and /ip dhcp-server print. Under IP › Firewall you'll see rules flagged D in hs-* chains: they are dynamic, always at the top, and you leave them alone.

The wizard sets up DHCP with its own lease time. Adjust it in section 5; with a full function room, the lease time decides whether the pool is big enough.

3. The login page and the walled garden

The portal pages are under Files › hotspot: login.html, status.html, logout.html and their images. Edit them off the router and upload them again:

  • In login.html, the hotel logo, the terms of use (written by management or its legal adviser) and the username and password fields. Don't remove the form or its hidden fields: they are what submits the login.
  • Keep a copy of the original folder before touching it. If the page stops working, you go back to it.
  • How guests sign in is chosen in the server profile:
RouterOS · Hotspot server profile
/ip hotspot profile set [find name=hsprof1] login-by=http-chap,cookie,trial http-cookie-lifetime=1d trial-uptime-limit=30m trial-user-profile=default
  • http-chap: username and password without sending them in clear. cookie: the device isn't asked for the portal again for a day. trial: free access for 30 minutes a day per device, useful in a café; remove it if everything must go through a user.

The walled garden is what can be opened without signing in: the hotel website, the restaurant menu or the booking page:

RouterOS · walled garden
/ip hotspot walled-garden add dst-host=www.northwind.example comment="hotel website"/ip hotspot walled-garden add dst-host=*.northwind.example comment="menu and bookings"/ip hotspot walled-garden ip add dst-address=203.0.113.40 action=accept comment="booking server by IP"

walled-garden filters web requests by name; walled-garden ip, any traffic by address. The shorter, the better: every entry is an open door with nobody identified.

4. Users, vouchers and profiles with limits

The user profile sets the speed and duration; the user, who gets in:

RouterOS · profiles and users
/ip hotspot user profile add name=huesped rate-limit=5M/20M shared-users=3 idle-timeout=30m keepalive-timeout=2m/ip hotspot user profile add name=evento rate-limit=2M/8M shared-users=1 session-timeout=6h/ip hotspot user add name=hab214 password=Mar7lago profile=huesped limit-uptime=3d comment="check-out 06/11"/ip hotspot user add name=boda1108-01 password=k4p9 profile=evento limit-uptime=8h/ip hotspot user print where profile=huespedColumns: NAME, PROFILE, UPTIME#  NAME    PROFILE  UPTIME0  hab214  huesped  0s
  • rate-limit is the guest's upload/download: 5M/20M is 5 Mbps up and 20 down per user. The Hotspot creates a dynamic queue for each session.
  • shared-users=3: the room's phone, tablet and laptop on the same key.
  • limit-uptime expires the key by connected time; so it doesn't work after check-out, reception deletes it or the user is created for the length of the stay.
  • Vouchers for events or the restaurant: batches of evento profile users printed on cards. For many batches or vouchers that expire by date, RouterOS 7's User Manager package acts as a RADIUS server and generates them; the Hotspot uses it with use-radius=yes on the server profile.
  • Hotspot queues limit each guest. The total for the guest network, so there is always bandwidth left for the POS, is a simple queue on the /22, as in the venue network guide. And remember: anything on FastTrack skips the queues.

5. DHCP, leases and logs

RouterOS · lease time and pool usage
/ip dhcp-server set [find interface=vlan100-huespedes] name=dhcp-huespedes lease-time=1h/ip dhcp-server lease print count-only where server=dhcp-huespedes388/ip hotspot active printColumns: SERVER, USER, ADDRESS, UPTIME, SESSION-TIME-LEFT#  SERVER     USER         ADDRESS        UPTIME   SESSION-TIME-LEFT0  hotspot1   hab214       10.40.100.57   1h12m1  hotspot1   boda1108-01  10.40.101.203  22m      5h38m
  • A one-hour lease frees the addresses of people who leave quickly, without the guest who stays noticing.
  • /ip hotspot host print shows every device the Hotspot sees, signed in or not; /ip hotspot active print, only open sessions.
  • Logs: /system logging add topics=hotspot action=memory and /log print where topics~"hotspot". Each login and logout is recorded with user, IP and MAC.
  • In many countries the law requires keeping connection logs for a public network for a period. Send them to a syslog server (/system logging action add name=syslog target=remote remote=10.40.10.20) and ask management how long they must be kept.

6. The ticket: "the guest connects to the Wi-Fi but can't browse / the login page doesn't open"

Friday, 22:40. Reception calls: the guest in 312 sees "Connected" on their phone, but the page to enter the key never appears and nothing loads. Other guests are browsing fine.

  1. Do they have an address? Look for their MAC (the guest sees it in the Wi-Fi settings) in /ip hotspot host print. If it isn't there, they got no IP: /ip dhcp-server lease print count-only shows 1,012 of 1,019 possible. The pool is exhausted because of a three-day lease time someone set. Lower it to one hour and free what isn't active; within minutes the phone gets an address. If their phone shows a 169.254.x.x, it is the same thing.
  2. They have an IP, but no portal. The phone's system detects the portal by requesting a fixed http:// page from its maker; the Hotspot intercepts it and opens the sign-in window. If it doesn't:
  • HTTPS-first browsers: the guest types a website as https://. The Hotspot can't redirect HTTPS without a certificate error, so the page doesn't load. Have them open http://wifi.northwind.example (the dns name); reception has it printed on the room card.
  • Fixed DNS or a VPN: a phone with Private DNS pinned to a specific provider, or with a VPN that starts on its own, doesn't see the portal. Have them set Private DNS to automatic or pause the VPN until signed in.
  • An over-generous walled garden: if someone added the makers' connectivity-check domains (or a broad *) to the walled garden, the phone thinks it already has internet and doesn't open the window. /ip hotspot walled-garden print and remove anything that isn't the hotel website.
  1. They see the portal, enter the key and it fails. /log print where topics~"hotspot" shows the attempt: login failed: invalid username or password, or that the user has used up its time. The key expired with limit-uptime, or there are more devices than shared-users. Reception issues a new one.
  2. They sign in and can't browse. If /ip hotspot active print shows them active, the problem is further along: /ping 1.1.1.1 from the router, DNS (/ip dns print) and their session's queue in /queue simple print where dynamic. If every guest is affected at once, it is the internet line and the ticket changes hands.

In the ticket: the device's MAC and IP, which step failed, the cause and the change (lease, walled garden, user). If it was the pool, have it checked in the other venues too.

A card in the room with the network name, the portal's http:// address and the key prevents half of these calls.

Next steps

  • The restaurant or hotel network and WiFi guide has the full VLAN plan, dual WAN and the slow WiFi in the middle of a wedding.
  • The Zabbix for a restaurant or hotel guide can watch the number of Hotspot sessions and pool usage to warn before it runs out.
  • If the hotel wants the Wi-Fi user to come from the booking system at check-in, the next step is a RADIUS server connected to the PMS.

Is something missing, or different in your environment? Get in touch and I'll fix it.

Tech Career Lab · newsletter

¿Te ha servido? Cada dos semanas envío una idea práctica para perfiles IT: LinkedIn, proyectos, networking y procesos de selección.Found this useful? Every two weeks I send one practical idea for IT professionals: LinkedIn, projects, networking and hiring processes.

Apúntate y llévate las 33 ideasSign up and get the 33 ideas →