Cloud Hotspot Setup on MikroTik RouterOS v7 with WireGuard
· Login Methods and Device Guides
MikroTik RouterOS v7 delivers significant speed and security advantages for cloud-managed guest Wi-Fi deployments thanks to native kernel-space WireGuard support. Unlike legacy tunnel protocols that depend on multi-stage negotiations, the WireGuard interface in RouterOS v7 establishes a lightweight encrypted link using public and private key pairs. Even in locations where the edge router sits behind carrier-grade NAT without a static public IP, this tunnel gives the Hotspotly cloud a stable control and authorization channel.
A production-ready rollout goes beyond bringing up a tunnel: guest traffic stays segmented from internal corporate LAN subnets, DHCP leases remain isolated, and portal settings apply repeatably without manual guesswork. In this guide, we examine the complete RouterOS v7 architecture from WireGuard peering and guest bridge design to idempotent provisioning. For specific interface commands, consult the MikroTik v7 WireGuard setup guide.
Role of WireGuard in Cloud Hotspot Architecture
In a cloud hotspot deployment, three primary traffic streams travel between the branch router and cloud infrastructure: RADIUS authentication and accounting packets over UDP 1812 and 1813, dynamic CoA or Disconnect commands over UDP 3799, and remote management or diagnostic queries. Routing these streams across a WireGuard tunnel keeps credentials and session records encrypted end to end. Because the tunnel stays initiated from the branch, Hotspotly can reach the router while the tunnel is active over its virtual tunnel address regardless of upstream ISP NAT rules.
Key Pairs, Peer Configuration, and Local Breakout
During WireGuard setup, the MikroTik router holds its private key while registering Hotspotly's peer public key, endpoint address, and permitted tunnel IP range under Allowed Address. Enabling a persistent keepalive interval keeps intermediate firewall NAT tables open, maintaining control-plane reachability across NAT timeouts. Scoping Allowed Address only to control-plane subnets helps guest internet traffic break out directly over the local WAN link instead of hair-pinning through the cloud.
Setting an appropriate WireGuard interface MTU for fiber or PPPoE uplinks avoids silent fragmentation on large RADIUS attribute responses or TLS management handshakes. Because WireGuard swaps keys statelessly without multi-step renegotiation, control reachability recovers rapidly even after brief WAN link drops.
Separate Guest Bridge, VLAN, and DHCP Server Design
Attaching a hotspot service directly to a corporate management bridge or office LAN exposes internal devices and complicates broadcast handling. Best practice calls for creating a dedicated guest bridge or dedicated VLAN interface for visitor traffic. Binding guest wireless SSIDs or access ports to that segmented interface enforces Layer 2 isolation from corporate servers and local printers before traffic reaches firewall rules. Adding explicit forward filter drops toward private RFC1918 office ranges completes network isolation.
DHCP Pool Design and use-radius=accounting
The isolated guest bridge hosts a dedicated IP pool and DHCP server sized for expected visitor capacity. Configuring use-radius=accounting alongside the hotspot RADIUS settings ensures client lease and session lifecycle events stay aligned with central accounting logs. Detailed parameter walkthroughs appear in the MikroTik Hotspot Server documentation.
- Create a dedicated bridge or VLAN interface reserved for guest traffic and isolated from office LANs.
- Allocate a non-overlapping private subnet and verify DNS settings match captive portal interception rules.
- Enable RADIUS authentication and accounting with
use-radius=accountingso usage records reach the cloud reliably. - Exclude guest hotspot subnets from hardware FastTrack rules so MikroTik queues and accounting counters track session traffic consistently.
Aligning RADIUS, CoA, and Walled Garden Policies
When a visitor connects and obtains a DHCP lease, full internet routing remains blocked until captive authentication finishes; only explicitly permitted walled garden destinations remain reachable. Submitting login credentials triggers an Access-Request over UDP 1812 through the WireGuard tunnel, followed by periodic accounting packets over UDP 1813 during active browsing.
When a session quota expires or an operator ends access manually, the cloud platform dispatches a CoA Disconnect packet toward the router's tunnel IP on UDP 3799. If the incoming RADIUS CoA/Disconnect listener on UDP 3799 is missing or blocked by input firewall chains, remote disconnects fail silently. Keeping RADIUS, incoming CoA, and walled garden settings synchronized reduces operational drift.
Idempotent Diff-Based Portal Provisioning
Expecting field engineers to paste hundreds of CLI lines manually increases configuration drift and human error. To reduce reliance on manual CLI scripts, Hotspotly runs an idempotent, diff-based portal provisioning engine for RouterOS v7. Before writing changes, the engine inspects current router state, computes the exact difference against the target profile, and applies only missing or modified entries. Re-running provisioning converges cleanly without disturbing existing static routes or corporate VLAN rules.
Eight Core Modules in the Provisioning Pipeline
The diff-based provisioning sequence coordinates eight structured configuration domains:
- Portal redirect files: Deploys customized captive portal redirect HTML files and supporting local assets to router flash.
- Hotspot server profile: Synchronizes the hotspot server profile, authentication methods, timeout settings, and external portal redirect endpoints.
- RADIUS server profile: Configures the tunnel-routed RADIUS server address, shared secret, and hotspot service binding.
- Incoming CoA/Disconnect listener: Activates the incoming UDP 3799 listener for cloud-triggered CoA and Disconnect actions.
- Guest DHCP server: Validates the guest bridge DHCP server, IP address pool, and lease parameters.
- System clock and NTP client: Aligns the system clock and NTP client so TLS validation and accounting timestamps stay accurate.
- Remote syslog forwarding: Establishes remote log forwarding rules for operational troubleshooting and audit visibility.
- Pre-auth walled garden rules: Populates pre-authentication exemptions for splash assets, external identity providers, or payment gateways.
Because each module checks live state before writing deltas, repeated executions remain deterministic and safe on active routers. You can examine how each diff stage evaluates existing router entries inside the portal provisioning documentation.
Tunnel-Scoped API Access and Removing Wizard Local Hotspot Users
The WireGuard onboarding script creates a dedicated RouterOS API account restricted to the cloud tunnel server IP (/32), which remains in place for ongoing diff-based provisioning and diagnostics. Separately, if you initialized the hotspot server using RouterOS's built-in Hotspot Setup wizard, manually remove the default local /ip hotspot user entry created by that wizard so local credentials do not bypass RADIUS authentication.
Pre-Launch Verification and Live Session Testing
Before opening the guest SSID to visitors, connect a test device to confirm captive portal redirection triggers promptly, authentication succeeds through central RADIUS, and kicking an active session from the dashboard triggers a prompt CoA disconnect over UDP 3799. Confirming that guest clients remain blocked from internal corporate subnets completes readiness validation. To compare RouterOS v7 with other gateway options, browse the Hotspotly integrations overview.