...

Self-hosted VPN vs commercial VPN: when each one makes sense

“VPN” covers three different jobs, and the right setup depends on which one you need. If you want to reach your home network from outside, to open the NAS, the hypervisor or internal DNS, you need a server at home or a path into it. If you want a private exit address that you control, a VPN on a rented VPS gives you one. If you want exits in other countries or an address shared with many other users, that is what a commercial VPN sells. The first two are self-hosted, and they solve different problems.

A server at home, on your router or a box in the LAN, gives you a way in, but only if it can be reached from outside. A VPS usually has a public address, but it sits in a data centre and gives you an exit, not a path into your living room; reaching the home LAN through it needs an extra tunnel from a device at home out to the VPS. A commercial VPN gives you an exit address run by someone else; its usual tunnel runs from your device to the provider’s servers, so by itself it does not give you remote access to a home LAN. Some providers add device-linking features, but that is an extra on top of the standard service.

Can your home server be reached from outside?

Photo by User_Pascal on Unsplash

Before you plan a server at home, check the WAN address on your router. If it falls between 100.64.0.0 and 100.127.255.255, your ISP has most likely placed you behind carrier-grade NAT, which limits direct inbound IPv4 connections. RFC 6598 shared address space is reserved for service providers to number the interfaces facing their NAT devices, so an address in that range is a strong sign of CGNAT. An address outside it does not guarantee reachability either, so treat the check as a starting point.

Behind CGNAT, three options include asking the ISP for a public address, using public IPv6 if the ISP provides it, or renting a small VPS that your home router connects out to and using it as the rendezvous point. IPv6 only helps if the network you connect from also supports it and your firewall allows the inbound connection to the server. A standard commercial VPN tunnel does not solve this problem, because it is built for outbound traffic.

What a self-hosted WireGuard server is good at

WireGuard on pfSense or OpenWrt gives you a path into the LAN. WireGuard’s own documentation describes cryptokey routing as the association of public keys and allowed IPs, where the allowed IPs act as a routing table for outgoing packets and an access control list for incoming ones. The protocol runs over UDP, so a server on a separate machine needs one forwarded UDP port, while a server on the router itself normally just needs inbound UDP allowed on the WAN side. A guide to budget home lab routers with VLANs and VPNs lists OpenVPN and WireGuard as the options for remote lab access, so check that your router’s firmware supports one of them and gives you the throughput you want.

The setting that decides most of the behaviour is AllowedIPs on the client. Here is an example of the relevant part of a client configuration, not a complete one:

Markdown
[Peer]  PublicKey = (server public key)  Endpoint = vpn.example.net:51820  AllowedIPs = 192.168.10.0/24, 10.8.0.1/32

With this list, only packets for the lab subnet and the tunnel address go through the server, and everything else leaves the laptop on the local connection. Changing the line to 0.0.0.0/0, ::/0 asks the client to send everything home, but that alone does not make a working full tunnel: the server has to forward packets, the firewall has to allow them, and NAT may be needed for internet-bound traffic. Netgate’s pfSense documentation notes that traffic entering a WireGuard tunnel needs routing table entries as well as AllowedIPs.

A separate setting applies in a different setup, when a device at home connects out to a VPS from behind NAT. There you can add PersistentKeepalive = 25 to that device’s peer entry for the VPS: the WireGuard documentation describes it as a way to keep the NAT mapping open, so the VPS can still reach the home device when the link is quiet.

Who maintains it and what it costs

Photo by Domaintechnik on Unsplash

Self-hosting moves the work to you. You apply updates to the router firmware or the VPS operating system, you revoke a peer’s key when a laptop is lost or someone leaves, and you are the one who notices when the tunnel stops working while you are abroad. A server at home costs little beyond the hardware you already have, but it goes down with your power or your line. A VPS adds a monthly fee and its own patching, though it stays up when the house is offline. A commercial VPN costs a subscription, and in return the provider runs the servers, the updates and the exit locations.

What your ISP and websites see through each tunnel

A full tunnel to your own router protects the traffic you send through it on untrusted Wi-Fi: the café network sees only encrypted UDP going to your home address, and websites see your home IP. Your home ISP still sees where that traffic goes once it leaves the house. Hiding it from the ISP takes a tunnel to a server outside the ISP’s network, whether that is a commercial VPN or your own VPS, and then whoever operates that endpoint sees what the ISP used to see.

DNS needs its own check. In a split tunnel, lookups do not necessarily go to the resolver on your home network, because the operating system, the browser and individual apps have their own DNS settings. Naming a DNS server in the client config is not enough: the queries have to be routed through the tunnel. IPv6 needs a decision too, either carry it through the tunnel or block it, because otherwise it can bypass the tunnel on a dual-stack network.

When a commercial VPN is the better tool

A commercial VPN fits when you need an exit in another country, or an exit address shared with other users so that the IP alone says little about who sent a request, although accounts and cookies still identify you. Services differ in locations, jurisdiction, logging policy and throughput, so the exit you need narrows the list quickly. Reading side-by-side VPN test results helps build a shortlist. A speed test over the tunnel from your own line then shows how a chosen provider performs where you actually are.

Running both on the same network

The two can share a network if each kind of traffic has its own routing rule. Your WireGuard server keeps serving remote access to the lab. A separate VLAN, such as a media or guest segment, sends its outbound traffic through the commercial tunnel with policy-based routing that matches on its source subnet, while the rest of the lab keeps its normal ISP path. Check the return route for remote-access clients, because the client’s AllowedIPs entry does not set the server’s return route; depending on your policy rules, replies may leave through the commercial tunnel, and if they do, add an exception for them.

For the VPN segment, add a firewall rule that blocks forwarding to the WAN interface, so its traffic cannot fall back to the ISP link if the commercial tunnel drops. How you write that rule depends on the platform, so test it by taking the tunnel down and watching what the segment can still reach. The commercial VPN can also run on a single device instead of the router, which avoids most of this routing work.

Leave a Reply

Your email address will not be published. Required fields are marked *

Share this article.

Recommended
Noction Ad
Advertising Disclaimer

RouterFreak is a participant in various affiliate advertising programs and sponsorships designed to earn advertising fees by advertising and referring traffic. These earning are essential to supporting RouterFreak but we only recommend products we have vetted and would use ourselves.

Find out more about supporting RouterFreak.

Popular Articles

More Articles