Insights
OPNsense WireGuard: Give one remote device access to a private service
Use OPNsense WireGuard for remote access to one private service. Check the tunnel handshake separately from what the firewall allows.

On this page
OPNsense can run WireGuardOpens in a new tab so your phone or laptop can reach a private service while you're away. Create a WireGuard instance, add your device as a peer, and route only the private service's address through the tunnel. One firewall rule lets your device reach the WireGuard listener from the internet, and another limits what it can reach inside.
In short:
- Use remote access. Add your device as a WireGuard peer on OPNsense.
- Route one address. Put only the service's private address in the device's
AllowedIPs. - Filter both layers. Limit the public rule to the listener and the tunnel rule to the approved service.
When remote access is the right setup
Use the remote-access setup, also called road warrior, when a device needs to connect back to OPNsense from another network. OPNsense runs the WireGuard instance that listens for connections, and the phone is a peer that OPNsense identifies by its public key.
To join two office networks, use a site-to-site tunnelOpens in a new tab. To send selected traffic from OPNsense to a WireGuard server elsewhere, use selective routing to an external endpointOpens in a new tab instead.
What goes on OPNsense and what goes on your device
For this example, assume a private host at 192.168.50.10 uses OPNsense as its default gateway. The app you want runs on Transmission Control Protocol (TCP) port 443, and a second service is already listening on TCP port 8443 for the access check. Replace the sample addresses and ports with your own.
1. Create the WireGuard instance on OPNsense.
In OPNsense, open the virtual private network (VPN) menu and go to VPN → WireGuard → Instances. Create an instance with listen port 51820 and tunnel address 10.10.10.1/24, using a subnet that doesn't overlap your existing networks. Use the cogwheel to generate the instance's key pair, leave Disable Routes unchecked, and leave Peers empty for now. If the WireGuard menu is missing, check the OPNsense instructions for your release before installing a plugin.
2. Generate the phone's keys and add it as a peer.
Generate a separate key pair on the phone. In OPNsense, add a WireGuard peer with the phone's public key and set Allowed IPs to 10.10.10.2/32, a single address in the instance's tunnel subnet. Keep each private key on the device that generated it.
3. Attach the peer and enable WireGuard.
In OPNsense, edit the instance, select the phone under Peers, and make sure the instance is enabled. Go to VPN → WireGuard → General, turn on WireGuard if it's off, and click Apply.
4. Point the phone at the public endpoint.
In the phone's WireGuard configuration, set the tunnel address to 10.10.10.2/32 and use the OPNsense instance's public key for its peer. Set Endpoint to the firewall's reachable public Internet Protocol (IP) address or publicly resolvable hostname, followed by the listen port. For example, 203.0.113.1:51820 shows the format. Use your actual public endpoint, not the instance's private tunnel address.
Which traffic goes through the tunnel
The two sides use similar field names for different addresses. On OPNsense, the phone peer's Allowed IPs is 10.10.10.2/32, which matches the phone's own tunnel address. On the phone, set AllowedIPs to 192.168.50.10/32, the private host you want to reach. The /32 selects one address, not a service port.
This is a split tunnel: traffic to the private host goes through WireGuard, while ordinary internet traffic keeps its usual route. Don't put the default routes 0.0.0.0/0 or ::/0 in the phone's AllowedIPs. With Disable Routes unchecked, OPNsense creates the route back to the phone's tunnel address. This local-only setup doesn't need an outbound network address translation (NAT) rule for internet traffic, though a full tunnel can need additional routing and NAT setup.
Which firewall rules let the right traffic through
Before you change the firewall, make sure you're authorized to do so and have a way to restore access if you lose it.
5. Allow the WireGuard listener on the internet-facing interface.
In OPNsense, add an inbound pass rule on the wide area network (WAN) interface. Set the destination to the firewall's WAN address and allow User Datagram Protocol (UDP) on destination port 51820, matching the instance's listen port. This rule lets the phone contact WireGuard. It doesn't open the private app on the WAN.
6. Limit traffic inside the tunnel to the approved service.
In OPNsense, add a pass rule on the WireGuard group with source 10.10.10.2/32, destination 192.168.50.10/32, and TCP destination port 443. Check for existing rules that could allow this peer to reach other ports or hosts. A narrow pass rule doesn't cancel a broader one.
Use the WireGuard group when the instance has no assigned interface. If you want separate rule sets for each instance, assign a dedicated interface and put its tunnel rule there. The interface gets the instance's tunnel address when WireGuard restarts, so you don't need to enter it again.
How to tell if the tunnel and service work
7. Check for a fresh handshake from off the local network.
Put the phone on mobile data or another outside network, turn on the tunnel, and try to reach the private app. In OPNsense, open VPN → WireGuard → Diagnostics and look for a fresh Handshake for the phone's peer. That shows the peers could establish the tunnel. If it doesn't appear after the attempt, check the public endpoint and port, the WAN listener rule, and the public key configured on each side.
8. Check that the approved service responds.
Try the app at 192.168.50.10 on TCP port 443 and look for its normal response. A handshake alone doesn't prove the app is reachable. If the handshake is fresh but the app doesn't respond, check the phone's destination route, the tunnel pass rule, and whether the service is listening and can reply through OPNsense.
9. Check that the unapproved service stays out of reach.
Confirm from an already permitted connection that the second service is running on TCP port 8443. Then try that port from the phone over WireGuard. The expected result is that 443 works and 8443 doesn't. Both tests use the same destination address, so the same tunnel route applies, but a timeout doesn't tell you which rule handled the traffic.
Where doxx.net fits. With a Pro trial or eligible invite, you can use WireGuard to connect a device to the doxx.net private networkOpens in a new tab, though that connection alone doesn't include the app's chat or calling interface. If that's the network you want to join, get started with doxx.netOpens in a new tab.