I wanted to switch countries by switching Wi-Fi networks, partly to see how some of services developped by me behave from different locations, and honestly, partly to try some of the new LLM features that weren’t available in Europe yet.

My home network is build on Mikrotik for routing and Ubiquity AP for WiFi networking.

Here’s how to do it. The AP puts each VPN Wi-Fi network on its own VLAN, the switch carries those VLANs, and the MikroTik sends each one through its WireGuard tunnel.

Wi-Fi networkVLANIPv4 subnetGatewayInternet exit
HomeNative LAN in this example192.168.100.0/24192.168.100.1ISP
Proton CH1010.100.0.0/2410.100.0.1Switzerland
Proton USA1110.100.11.0/2410.100.11.1United States

The examples assume you already have a working internet connection and home LAN. I put both VLAN interfaces on the main bridge. If you already have separate bridges for your VPN VLANs, keep DHCP and the gateway IPs there and use those bridge names in the firewall rules below.

Get both VLANs to the access point

In my case, MikroTik port ether3 connects to a managed switch. I allowed VLANs 10 and 11 tagged on that link and on every switch link up to the UniFi AP. If the AP already uses an untagged management network, you can keep it as it is.

If bridge VLAN filtering is already on, tag both VLANs on ether3 and on bridge itself so the router can receive them. This assumes ether3 is a bridge port and the only MikroTik port carrying these two tags.

/interface bridge vlan
add bridge=bridge vlan-ids=10,11 tagged=bridge,ether3

MikroTik bridge VLAN table

Give each VLAN an IP gateway and DHCP server

Create the two VLAN interfaces, give each one a gateway address, and set up DHCP so devices get an IP when they join.

/interface vlan
add interface=bridge name=vlan-proton-ch vlan-id=10
add interface=bridge name=vlan-proton-usa vlan-id=11

/ip address
add address=10.100.0.1/24 interface=vlan-proton-ch
add address=10.100.11.1/24 interface=vlan-proton-usa

/ip pool
add name=pool-proton-ch ranges=10.100.0.100-10.100.0.200
add name=pool-proton-usa ranges=10.100.11.100-10.100.11.200

/ip dhcp-server network
add address=10.100.0.0/24 gateway=10.100.0.1 dns-server=1.1.1.1
add address=10.100.11.0/24 gateway=10.100.11.1 dns-server=1.1.1.1

/ip dhcp-server
add name=dhcp-proton-ch interface=vlan-proton-ch address-pool=pool-proton-ch disabled=no
add name=dhcp-proton-usa interface=vlan-proton-usa address-pool=pool-proton-usa disabled=no

DHCP gives clients 1.1.1.1 for DNS, so their DNS traffic follows the tunnel too. Here we can use DNS from Proton or router itself, but I'm happy with CF ones for now.

Create one Proton WireGuard tunnel per country

In your Proton VPN account, open Downloads → WireGuard configuration and generate a fresh router configuration for a Swiss server and another for a US server. Use the private key, peer public key, endpoint, and tunnel address from each corresponding file. The commands show the common Proton IPv4 tunnel address as an example. Use the supplied address if yours differs.

Use distinct local listen ports that are free on your router (they should not be public). The endpoint port comes from each Proton profile.

/interface wireguard
add name=WG_Proton_CH listen-port=42197 mtu=1420 private-key="<CH_PRIVATE_KEY>"
add name=WG_Proton_USA listen-port=42198 mtu=1420 private-key="<USA_PRIVATE_KEY>"

/ip address
add address=10.2.0.2/32 interface=WG_Proton_CH
add address=10.2.0.2/32 interface=WG_Proton_USA

/interface wireguard peers
add interface=WG_Proton_CH public-key="<CH_PEER_PUBLIC_KEY>" endpoint-address="<CH_ENDPOINT_HOST>" endpoint-port=<CH_ENDPOINT_PORT> allowed-address=0.0.0.0/0 persistent-keepalive=25s
add interface=WG_Proton_USA public-key="<USA_PEER_PUBLIC_KEY>" endpoint-address="<USA_ENDPOINT_HOST>" endpoint-port=<USA_ENDPOINT_PORT> allowed-address=0.0.0.0/0 persistent-keepalive=25s

Proton can assign the same tunnel address to separate profiles. Here each IPv4 default route names its own WireGuard interface, and each interface has one peer. Keep the ISP default route in main.

Proton’s MikroTik WireGuard guide

Route each subnet through its own tunnel

/routing table
add name=wg_proton_ch fib
add name=wg_proton_usa fib

/ip route
add dst-address=0.0.0.0/0 gateway=WG_Proton_CH routing-table=wg_proton_ch
add dst-address=0.0.0.0/0 gateway=WG_Proton_USA routing-table=wg_proton_usa

/routing rule
add src-address=10.100.0.0/24 action=lookup-only-in-table table=wg_proton_ch
add src-address=10.100.11.0/24 action=lookup-only-in-table table=wg_proton_usa

/ip firewall nat
add chain=srcnat action=masquerade src-address=10.100.0.0/24 out-interface=WG_Proton_CH
add chain=srcnat action=masquerade src-address=10.100.11.0/24 out-interface=WG_Proton_USA

The routing rule sends the client’s traffic into the right tunnel, then masquerade gives it that tunnel’s source IP.

lookup-only-in-table keeps these clients from falling back to the ISP if their VPN route disappears. If the route stays active but Proton stops responding, requests time out.

MikroTik policy routing

Exclude both VPN networks from FastTrack

FastTrack uses the main routing table, so it can send an established connection down the ISP route. If you have the standard defconf: fasttrack rule, exclude both VPN VLANs in both directions.

/interface list
add name=PROTON_VPN_VLANS

/interface list member
add list=PROTON_VPN_VLANS interface=vlan-proton-ch
add list=PROTON_VPN_VLANS interface=vlan-proton-usa

/ip firewall filter
set [find where chain=forward and action=fasttrack-connection and comment="defconf: fasttrack"] in-interface-list=!PROTON_VPN_VLANS out-interface-list=!PROTON_VPN_VLANS

If your FastTrack rule already has interface filters or you have multiple FastTrack rules, incorporate the exclusions into the existing policy. Test with fresh connections because previously FastTracked sessions can retain state.

PS: This is for IPV4 as at this moment in Bulgaria we don't get any IPV6 for end users ... but idea is the same basically.

MikroTik packet flow and FastTrack

Map the SSIDs in UniFi Network

  1. Open Settings → Networks and create Proton CH. Select Third-party Gateway under Router, then set VLAN ID 10.
  2. Create Proton USA the same way with VLAN ID 11.
  3. Open Settings → WiFi and create the Proton CH SSID. In the Network dropdown, select Proton CH. Set the password and choose which APs broadcast it.
  4. Repeat for Proton USA. Keep the home SSID mapped to its existing network.
  5. If a client associates but receives no lease, check tagged VLAN membership on the AP port, each intermediate switch link, and the MikroTik trunk.

UniFi virtual networks · UniFi Wi-Fi SSIDs

Check your public IP

Join each Wi-Fi network, check the IP and gateway against the table above, then run this from the device.

curl -4 https://ipinfo.io/json

Expect a Swiss exit on Proton CH, a US exit on Proton USA, and your usual ISP exit on Home.