MikroTik: Route (guest) Wi-Fi over WireGuard VPN

Similar to how some institutions separate their traffic from traffic of their guests by routing guest traffic through different networks, offer guests and/or select (untrusted) devices an isolated network with traffic exiting through a WireGuard tunnel (e.g., Mullvad VPN).

On a Mikrotik router running RouterOS 7.20.x, this approach involves:

  1. allocating virtual Wi-Fi interfaces to separate bridge
  2. adding DHCP to separate bridge
  3. setting up WireGuard interface and peer
  4. configuring firewall and routing rules

A separate bridge is used instead of a VLAN for conceptual simplicity and as VLAN misconfiguration can more easily result in a need to reset router configuration if a serial console is not used.

Basic initialization

Starting from a clean slate, connect to MikroTik router configuration interface by visiting http://192.168.88.1/. Username is admin and there is no password.

Choose and set admin password.

Begin with Quick Set interface at top right and use Home AP Dual template.

Change Network Names under Wireless as desired and add WiFi Password.

Add Guest Wireless Network, update identifier as desired, and add Guest WiFi Password. This will be Wi-Fi interface that will be configured to route through tunnel.

Choose to Apply Configuration at bottom.

Move to Advanced interface at top right.

Remove WPA PSK as Authentication Type via Wireless > Wireless > Security Profiles for both security profiles.

Disable IPv6 via IPv6 > Settings and reboot via System > Reboot.

Allocate virtual Wi-Fi interfaces to separate bridge

Visit http://192.168.88.1/ and log in again.

Use Advanced interface again.

Create new bridge under Bridge > New. Choose name, such as alt-bridge.

Add virtual Wi-Fi ports to alt-bridge via Bridge > Ports > {wlan3, wlan4}, updating Bridge to alt-bridge. Select Ok.

Add DHCP to separate bridge

Decide on internal address range for separate bridge, such as 10.1.1.0/24.

Add new IP address for separate bridge via IP > Address > New. Set Address to 10.1.1.1/24, Network to 10.1.1.0, and Interface to alt-bridge. Then, select Ok.

Configure DHCP server via IP > DHCP > DHCP Setup at right. Select alt-bridge for DHCP Server Interface, then Next. Rest of details should be auto-populated (DHCP Address Space: 10.1.1.0/24; Gateway for DHCP Network: 10.1.1.1; Addresses to Give Out: 10.1.1.2-10.1.1.254; DNS Servers: 9.9.9.9 or similar; Lease Time: 3600 or similar).

Set up WireGuard interface and peer

Create new WireGuard interface via WireGuard > New. Name it mullvad or similar and select Ok. View created WireGuard interface and note Listen Port (e.g., 36000).

As WireGuard is UDP and not TCP, add firewall rule via IP > Firewall > Filter Rules > New to allow return WireGuard tunnel traffic. Set Chain to input, Protocol to udp, Dst. Port to 36000 or similar, and Action to accept. Select Ok. Drag and drop to position rule before final drop action for input chain.

Obtain assigned internal IP from Mullvad by logging into Mullvad, creating device, and downloading configuration file. Select WireGuard configuration under Downloads, followed by Generate key. Select an exit server, then Download file to retrieve assigned configuration.

Visit https://mullvad.net/en/servers and locate server to determine SOCKS5 Proxy Address corresponding to selected exit server. Determine IP of that proxy address (e.g., ping gb-lon-wg-socks5-001.relays.mullvad.net, yielding 10.124.0.59).

In downloaded configuration file, note PrivateKey value, IPv4 Address value, peer's PublicKey, peer's Endpoint, and peer's AllowedIPs.

Return to WireGuard > mullvad and update the Private Key value to the value obtained from the configuration file.

Add the assigned internal IP from Mullvad to the mullvad WireGuard interface via IP > Addresses > New, including the /32. For Network, specify the proxy address IP (e.g., 10.124.0.59).

Add the WireGuard peer via WireGuard > Peers > New. Select mullvad for Interface, specify the Public Key of the peer, Endpoint of peer (without port number), Endpoint Port of peer, Allowed Address (0.0.0.0/0 from AllowedIPs), and Persistent Keepalive (00:00:10). Select Ok, then return to peer entry to examine Last Handshake timer to confirm tunnel was established.

Configure firewall and routing rules

Create new routing table via Routing > Tables. Name table mullvad and enable FIB.

Add route for routing table via IP > Routes > New. Set Dst. Address to 0.0.0.0/0, Gateway to proxy address IP (e.g., 10.124.0.59), and Routing Table to mullvad.

Add routing rule for routing table to handle traffic tagged mullvad via Routing > Rules > New. Set Routing Mark to mullvad, set Action to lookup only in table, and set Table to mullvad. Select Ok.

Add NAT handling by adding NAT firewall rule via IP > Firewall > NAT > New. Set Chain to srcnat, Out. Interface to mullvad, and Action to masquerade. Select Ok.

Add firewall rule to drop unexpected inbound traffic via IP > Firewall > New. Set Chain to input, In. Interface to mullvad, and Action to drop. Select Ok.

Add firewall rule to not forward unexpected inbound traffic via IP > Firewall > New. Set Chain to forward, In. Interface to mullvad, Connection State to new, Connection NAT State to not (!) dstnat, and Action to drop. Select Ok.

Tag traffic from alt-bridge with mullvad to have routing rules apply via IP > Firewall > Mangle > New. Set Chain to prerouting, In. Interface to alt-bridge, Connection NAT State to not (!) dstnat, Action to mark routing, New Routing Mark to mullvad, and unselect Passthrough. Select Ok.

Validation

Visit https://mullvad.net/en/check using allocated "guest" SSID and confirm that traffic is routed appropriately.

Notes and references

Much of the literature on topic might have been written a few years back against an older version of RouterOS where it may have been possible to operate off of an input interface, rather than bridge, without need for traffic tagging and separate bridge.

No special DNS handling appeared to be needed.


© 2025 0n 0e <person at 0n0e dot com> All rights reserved. Last updated: 2025-12-26.