Will It Work? · Guide

VPN server on your home router: will it work from outside?

By , founder of ElectronicsInfoline (since 2000)

Many home routers can act as a VPN server, so a phone or laptop away from home can reach the drive, printer or camera on your home network as if it were on your Wi-Fi. Whether it works from outside depends mostly on the router's WAN address. This guide is drawn from two router makers' support pages (one read on its US and India sites).

It works if your router's WAN address is public. Turn on dynamic DNS, enable the VPN server (WireGuard or OpenVPN), make one account or config file for each device, and connect from the VPN app. If the WAN address is private, a box in front of the router needs a port-forwarding rule too. If it is a carrier-grade NAT address (100.64.0.0 to 100.127.255.255), the server cannot be reached from outside until your provider gives you a public address.

What the server does

On a router, the VPN server works as a gateway: it accepts connections from your devices and gives them secure access to the home network (TP-Link). Your router is the server, and the remote device connects with a VPN app (TP-Link). It works one way: the device you connect from can reach your home network, but the home network cannot reach back into that device (TP-Link).

A VPN server on the home router: the phone connects in through a tunnelA phone away from home runs a VPN app with the file exported from the router. It connects across the internet to the router's VPN server, which lets it reach the home network: a storage drive, a printer, a camera. Option one, home network only: the phone's other web traffic goes out locally as usual. Option two, internet and home network: all of the phone's traffic goes through the tunnel and out through the home internet line, which may be slower.phone awayVPN app +exported fileinternethome routerVPN server(public WAN)encrypted tunneldrive · printer· cameraHome Network Onlyhome devices: through the tunnelother sites: the local connectiondefault on one makerInternet and Home Networkeverything: through the tunnelout through the home linemay be slower
Figure 1. The router is the server and the phone or laptop is the client. With Home Network Only, only traffic for devices at home goes through the tunnel; with Internet and Home Network, everything does, and goes out through your home line.

Check the WAN address first

A VPN server has to accept connections from the internet, so it has the same need as port forwarding: a public WAN address (TP-Link). Open the router's status page and read its WAN or internet address.

A private address (192.168.x.x or 10.x.x.x) means another box, often the provider's modem router, sits in front of yours. One maker covers this case: forward a port on the front box to your router, with the internal port the same as the VPN service port, then change the remote address in the client file to the front box's WAN address and the port to the external port you chose (TP-Link). An address from 100.64.0.0 to 100.127.255.255 is carrier-grade NAT, and forwarding will not work through it (TP-Link); most 4G and 5G providers give private addresses by default (TP-Link).

Check the router's WAN address before you turn on the VPN serverThree cases. A public WAN address such as 113.116.60.229: the server can be reached; set up dynamic DNS and use the name in the client file. A private WAN address such as 192.168.1.20: another box sits in front of the router; forward the VPN port on that box, with its internal port equal to the VPN service port, and put that box's WAN address in the client file. A carrier-grade NAT address, inside 100.64.0.0 to 100.127.255.255, such as 100.72.15.9: the server cannot be reached from outside; ask the provider for a public address.router WAN addresswhat to do113.116.60.229publicreachable from outsideput a DDNS name in the client file192.168.1.20privatea box in front of the routerforward the VPN port on that box100.72.15.9carrier-grade NATthe provider shares the addressask for a public (static) address
Figure 2. The same check as port forwarding: the VPN server only answers from outside if the router (or a box in front of it) has a public address. Carrier-grade NAT addresses run from 100.64.0.0 to 100.127.255.255.

The public address can change, so set up a name that follows it. One maker says to configure dynamic DNS or give the router's WAN port a static address, and sync the router's clock, before turning the server on (TP-Link). The other says dynamic DNS must be on before the VPN feature (NETGEAR).

Set up WireGuard

WireGuard runs over UDP (TP-Link). On one maker's routers, go to Advanced > VPN Server > WireGuard and tick Enable. The settings are filled in for you, and the maker says not to change them unless you have to (TP-Link). Add an account for each device. On a phone, install the WireGuard app and scan the QR code the router shows; for other devices, export the config file (TP-Link).

Each account serves one device at a time (TP-Link). And if you renew the server's keys, every client has to be set up again before it can reconnect (TP-Link). The optional Persistent Keepalive setting sends a regular heartbeat, every 25 seconds by default (TP-Link).

Set up OpenVPN

On one maker's routers, go to Advanced > VPN Server > OpenVPN and select Enable VPN Server. The first time, generate a certificate before you enable it (TP-Link). Choose UDP or TCP and a service port between 1024 and 65535, pick the client access type, save, then export the configuration file for the remote device (TP-Link). Each device needs the OpenVPN client installed and the file copied into it (TP-Link).

On the other maker's routers, the page is ADVANCED > Advanced Setup > VPN Service: select Enable VPN Service, apply, and download the configuration files for your clients (NETGEAR). Install the OpenVPN software on each Windows computer you plan to use (NETGEAR). On Windows, that maker also asks you to rename the TAP network adapter's connection (not its device name) to NETGEAR-VPN; if you skip this, the tunnel fails to connect (NETGEAR).

Home only or everything

Both makers offer two choices. Home Network Only lets the remote device reach your home network and nothing more (TP-Link), and on one maker it is the default (NETGEAR). The other choice (Internet and Home Network, or All sites on the Internet & Home Network) sends the device's web traffic through your home line as well (NETGEAR). That can be slower than using the local connection directly (NETGEAR).

How many devices

One maker gives the limits for its routers: up to 16 WireGuard connections at once, and up to 10 OpenVPN connections at once (TP-Link). Other makers and models may differ, so check your model's user guide.

Devices connected at the same time, on one maker's routersOne router maker's limits for its VPN server: up to 16 WireGuard connections at once and up to 10 OpenVPN connections at once. Each WireGuard account serves one device at a time, so a phone, a laptop and a tablet need three accounts. Other makers and models may differ.WireGuard16OpenVPN10solid: three devices in use · pale: room leftWireGuard: one account per devicephone → account 1 · laptop → account 2 · tablet → account 3
Figure 3. One maker's figures: 16 WireGuard and 10 OpenVPN connections at once. Each WireGuard account serves one device at a time, so give every phone and laptop its own.

Tips and tricks

  • Test from a phone with Wi-Fi off. A connection made from inside your home proves nothing about reaching it from outside.
  • If the WAN address starts with 100. and falls between 100.64.0.0 and 100.127.255.255, stop: no router setting gets past carrier-grade NAT.
  • After you change the VPN settings or renew keys, export the file or QR code again and update every device.
  • Give each device its own account or file, so you can remove one lost phone without touching the others.
  • Keep Home Network Only unless you need to browse through your home line; then only traffic for your home devices goes through the tunnel.
  • If it worked yesterday and not today, check the DDNS name still matches the WAN address.

What we would do

We would read the WAN address first. If it is public, we would set up dynamic DNS, turn on WireGuard if the router offers it (fewer settings, a QR code for phones) and keep Home Network Only. If it is private, we would forward the VPN port on the front box and edit the client file as the maker describes. With a carrier-grade NAT address, we would ask the provider for a public address before spending time on settings.

Questions people ask

Can I set up a VPN server on my home router? If its menu has a VPN Server or VPN Service page, yes. One maker lists PPTP, L2TP/IPsec, OpenVPN and WireGuard, with support varying by model, so check your model’s specifications first.

Should I use WireGuard or OpenVPN on my router? Use whichever your router and devices both offer. On one maker’s routers, WireGuard needs fewer settings (they are filled in for you, and a phone scans a QR code) and takes up to 16 connections at once; OpenVPN takes up to 10 and needs a certificate and a config file.

Why can’t I connect to my home VPN from outside? Check the router’s WAN address first. A private address means a box in front of your router, where the VPN port must be forwarded. An address from 100.64.0.0 to 100.127.255.255 is carrier-grade NAT: the server cannot be reached until the provider gives you a public address. Then check the DDNS name and the router’s clock.

Do I need dynamic DNS for a VPN server? In practice, yes. One maker says to set up dynamic DNS or give the router a static WAN address before turning the server on; the other says to turn on dynamic DNS before the VPN feature.

Will a home VPN make my internet slower when I am away? Only if you send all traffic through it. With Home Network Only, only traffic for your home devices goes through the tunnel. With Internet and Home Network, everything goes out through your home line, and one maker warns that this might be slower.

Can two of my devices share one VPN account? Not at the same time on WireGuard. One maker says each account serves one device at a time, so make an account for each phone and laptop.

Sources

Each figure on this page is quoted from the source below or worked out from them. Sources checked , each quote read again against the source in a second pass.

  1. TP-Link, TP-Link FAQ 1544 (US): OpenVPN server on the router: your TP-Link router acts as the OpenVPN Server, and your remote device connects to it using the OpenVPN client app … Before enabling the VPN Server, configure Dynamic DNS or assign a static IP address to the router's WAN port, and make sure your system time is synced. … The first time you configure the OpenVPN Server, you must generate a certificate before enabling it. … Go to Advanced > VPN Server > OpenVPN … the port number should be between 1024 and 65535 … Select Home Network Only if you only want the remote device to access your home network … Click Export to save the OpenVPN configuration file … a multi-router setup where port forwarding is also required … Make sure the Internal Port matches the VPN Service Port you wrote down. … Modify the remote address to the WAN IP address of the Modem Router/Router1 tp-link.com/us/support/faq/1544/
  2. TP-Link, TP-Link FAQ 3772 (US): WireGuard VPN server on the router: WireGuard VPN is a modern protocol based on the User Datagram Protocol (UDP) … Go to Advanced > VPN Server > WireGuard and tick the Enable box for WireGuard. … The parameters are automatically filled in. Do NOT change them unless necessary. … Persistent Keepalive time (25 seconds by default) … Each WireGuard VPN account can only be used by one client device at a time. … download the WireGuard app from Google Play or the Apple App Store and scan the QR code generated by the router … If the server's private and public keys are renewed, any connected clients must be reconfigured before they can reconnect to the VPN server. … If your TP-Link router is connected to a main router, you may also need to configure port forwarding. tp-link.com/us/support/faq/3772/
  3. TP-Link, TP-Link FAQ 3799 (US): general VPN questions (protocols, connection limits): VPN server acts as a gateway, accepting client connections and providing secure access to a network. … PPTP, L2TP/IPsec, OpenVPN, and WireGuard, with compatibility varying by model … The VPN types supported by router and deco are designed for client-to-server connections, meaning that the client can access the server, but not the other way around. … For the WireGuard you can have a maximum of 16 concurrent connections, and for OpenVPN, the maximum number of concurrent connections is limited to 10. tp-link.com/us/support/faq/3799/
  4. NETGEAR, NETGEAR KB 24320: VPN clients reach only the home network (default): It allows VPN connections only to your home network, not to the Internet service for your home network. … Select ADVANCED > Advanced Setup > VPN Service … select the Home Network only radio button kb.netgear.com/24320/
  5. NETGEAR, NETGEAR KB 24319: VPN clients use the home internet service: Accessing the Internet remotely through a VPN might be slower than accessing the Internet directly. … select the All sites on the Internet & Home Network radio button … When you access the Internet with the VPN connection, instead of using a local Internet service, you use the Internet service from your home network. … download the configuration files for your VPN clients kb.netgear.com/24319/
  6. NETGEAR, NETGEAR KB 23854: enable the VPN feature (Dynamic DNS first, Windows client): You must install the OpenVPN software on each Windows computer that you plan to use for VPN connections to your router. … You must enable Dynamic DNS before enabling the VPN feature. … change its name (not its device name) to NETGEAR-VPN … If you do not change the VPN interface name, the VPN tunnel connection fails. kb.netgear.com/23854/
  7. TP-Link, TP-Link FAQ 785 (US): port forwarding not working: If the WAN IP is private or a CGNAT address (100.64.0.0–100.127.255.255), port forwarding will not work … Always verify the server is accessible from the local network before troubleshooting port forwarding rules. … Windows Firewall can block port forwarding connections. … Most 4G/LTE and 5G ISPs assign private IP addresses by default … including the correct internal IP address, port number, and protocol … the gateway on the client’s settings should be the router’s LAN IP address … prevent you from using OpenVPN or port forwarding and affect the NAT Type … you will need to open the same port on the upstream modem router as well tp-link.com/us/support/faq/785/

Author: Bulan Sarkar · Report an error

Numbers here are quoted from standards bodies and makers, or worked out from them. Nothing on this page was measured or tested by us.