U2 Networking

Remote access without opening your network

The safest number of open ports on a home network is zero, and one is a close second. This guide compares the ways to reach your lab from outside and explains which services should never be published directly.

At a glance

  • Reach your lab through a VPN or a mesh overlay. Do not forward ports to management interfaces, remote desktop, SSH or file shares.
  • WireGuard is fast, simple and well reviewed, but it has no user management. Overlay products add that layer.
  • Mesh overlays and outbound tunnels work behind carrier-grade NAT, where inbound connections are impossible.
  • Whatever you choose, write access rules. The default in most overlays is that every device can reach every other device.
  • A tunnel provider that terminates TLS for you can see your traffic. Decide who belongs in your circle of trust.

Start with exposure, not tools

Every service reachable from the internet is scanned, constantly and automatically, within minutes of appearing. Most mass compromises of home and small office equipment begin with an administrative interface or remote access tool that was published directly. The first decision is therefore what should be reachable at all.

ServicePublish directly?Instead
Firewall, switch, hypervisor or NAS admin pagesNeverVPN or overlay only
Server management controllersNeverVPN to an isolated management network
Remote desktop and screen sharingNeverVPN or overlay, then connect internally
SSHAvoidVPN, or one hardened jump host if you must
File shares and databasesNeverVPN, or a sync tool designed for the internet
Camera recordersNeverVPN or overlay
A web application you want others to usePossiblyReverse proxy with strong authentication, ideally hosted away from home

The options compared

ApproachHow it worksOpen ports at homeWorks behind carrier NATWho you trust
VPN to your firewallDevices connect to a VPN endpoint on your firewallOne UDP portNoYourself
Coordinated mesh overlayEach device runs an agent; a coordination server exchanges keys; traffic flows peer to peerNoneYesThe coordination service, or yourself if you self-host it
Outbound tunnel serviceA connector inside your network dials out to a provider, which publishes your serviceNoneYesThe provider, which terminates TLS and can see traffic
Reverse proxy on a rented serverA small cloud server runs your proxy and reaches home over a VPNNone, or one VPN portYes, if home dials outYour hosting provider
Direct port forwardingThe firewall forwards a port to an internal serviceOne per serviceNoThe security of that service alone

A VPN to your firewall

For one person or one household reaching their own lab, a WireGuard VPN terminated on the firewall is simple and excellent. It uses a single modern set of cryptographic primitives with no negotiation to downgrade, runs in the kernel on Linux and BSD, and stays silent until traffic needs to flow. A port scan of a WireGuard endpoint sees nothing, because it does not answer packets that are not properly authenticated.

  1. Choose a tunnel network that does not overlap any network you will connect from. Our example network uses 10.42.99.0/24.
  2. Create one peer per device, each with its own key pair. Never share keys between devices, so a lost phone can be revoked on its own.
  3. Decide split or full tunnel. Split tunneling sends only traffic for your home networks through the VPN, which is faster and simpler to troubleshoot. Full tunneling sends everything, which is useful on untrusted public wireless networks.
  4. Send DNS through the tunnel so you can resolve internal names and so local networks do not see your lookups.
  5. Write firewall rules for the tunnel network. VPN clients should reach what they need, not everything by default.

WireGuard has no concept of users, logins or session accounting. If you need to give access to several people and know who connected when, use a VPN with user management or an overlay product that adds identity on top of WireGuard.

Rule of thumb

Use UDP for VPN transport. Tunneling over TCP is not more secure, because security comes from the encryption, and stacking TCP inside TCP performs badly on lossy connections. WireGuard itself uses UDP only. If you need a fallback for restrictive networks that block everything except web traffic, that requires a separate TLS-based VPN listening on TCP port 443.

Mesh overlays

A coordinated mesh overlay gives each device an agent and an address on a private virtual network. A coordination server distributes public keys and helps devices find each other; the traffic itself flows directly between devices, and private keys never leave them. When a direct path is impossible, traffic falls back to an encrypted relay, slower but still private.

Overlays solve problems that a traditional VPN cannot. They work when your provider uses carrier-grade NAT, when the far end is behind someone else's firewall, and when you want many sites connected without building a hub. A device can advertise a home subnet as a route, which brings in printers, cameras and other devices that cannot run the agent. Our Mesh VPN Remote Access project sets one up step by step.

  • Write access rules immediately. The default in most overlays allows every device to reach every other device. Restrict SSH and admin interfaces to your own administrative devices.
  • Watch for bypassed segmentation. A device that advertises routes into your home can let overlay traffic skip the firewall rules between your VLANs. Apply rules on the overlay too.
  • Understand the trust model. Whoever controls the coordination server can add devices to your network. Protect that account with strong multi-factor authentication, or self-host the coordinator on a small cloud server.
  • Keep application logins. Reaching a service over the overlay should still require authenticating to the service.

Carrier-grade NAT

Many providers, particularly mobile, satellite and fiber newcomers, share one public address among many customers. If the WAN address on your firewall is in 100.64.0.0/10 or does not match the address websites report for you, inbound connections cannot reach your network. Overlays and outbound tunnels work regardless, because every connection starts from inside.

Publishing a service to other people

Sometimes you genuinely want something reachable without a VPN: an RSS reader on your phone, a photo album for relatives, a small website. Choose one of two patterns.

Outbound tunnel service

  • Almost no setup, valid certificates and no open ports.
  • Can put an identity check in front of the app.
  • The provider terminates TLS and can see your traffic.
  • Subject to the provider's terms, including limits on media streaming.

Your own reverse proxy on a rented server

  • You control the proxy, certificates and logs.
  • The rented server reaches home over a VPN or overlay, so home stays closed.
  • You maintain and patch it.
  • Keeps public traffic, and attacks, away from your home address.

Either way, put real authentication in front of the application, add rate limiting or a community blocklist where possible, and keep the application patched. Publishing a service makes its vulnerabilities your vulnerabilities.

Jump hosts

A jump host, sometimes called a bastion, is one hardened machine that you connect to first and from which you reach everything else. It is useful when several people need SSH access or when you want a single place to log every administrative session.

  • Allow only key-based SSH authentication, with passphrase-protected keys and ideally a hardware security key.
  • Disable root login and restrict logins to named accounts.
  • Ban addresses that repeatedly fail authentication.
  • Log every session and send the logs to another machine.
  • Keep it minimal, patched automatically and disposable, so you can rebuild it from your automation in minutes.

Changing the SSH port reduces log noise from automated scanners. It is not a security control, and it should never be the only change you make.

Privacy VPN services are a different thing

Commercial privacy VPN subscriptions route your traffic through a provider's servers. They are useful on untrusted public wireless networks, for reaching region-restricted content and for keeping lab experiments from tracing back to your home address. They do not make you anonymous, they do not protect weak passwords, and they move your trust from your internet provider to a company you cannot audit.

  • Prefer providers that let you import a standard configuration into the operating system's own VPN client.
  • Avoid long prepaid plans; providers are bought, sold and occasionally breached.
  • Consider the alternatives: a VPN back to your own home from public networks, or your own small cloud server as an exit point.

Check your exposure from outside

Do not trust what you think is open. From a network outside your home, such as a phone hotspot or a rented server, scan your public address and confirm that only what you intended answers. Repeat the check after firewall changes and as part of your regular quarterly audit.