Turn an Old Wi-Fi Router into a Travel VPN with OpenWrt
🤖 Researched and drafted automatically from the official docs, and reviewed before publishing. Commands are taken from the source projects — but always sanity-check before running anything on your own hardware.
You’ve got an old router in a drawer. Turn it into a portable security device that encrypts all your traffic when you’re on untrusted Wi-Fi. This guide walks you through flashing OpenWrt, setting up WireGuard as a VPN client, and connecting it to your home network from anywhere.
Prerequisites
-
Check hardware compatibility: Visit the OpenWrt supported devices database and search for your router model. Note the exact model number (usually on a sticker on the device). If it’s not listed, you cannot proceed—flashing incompatible hardware will brick it.
-
Gather what you need:
- Your router and its power cable
- An Ethernet cable
- A computer with a browser and SSH client (already on Linux/macOS; Windows users can use PuTTY or Windows Terminal)
- The factory firmware image for your exact model from the OpenWrt Firmware Selector
-
Prepare your home network: You’ll need a WireGuard server running on your home network. If you don’t have one, set it up first using the WireGuard server guide. You’ll need the server’s public key, your assigned client IP address (e.g.,
192.168.9.2/24), pre-shared key, and the server’s public endpoint (IP or DDNS hostname and port).
Flash OpenWrt onto the Router
-
Download the correct firmware image: Go to the OpenWrt Firmware Selector, enter your exact router model, and download the factory image (not sysupgrade). Save it somewhere you can find it.
-
Connect to the router: Plug in the router’s power cable and wait 30 seconds for it to boot. Connect your computer to one of the router’s LAN ports with an Ethernet cable.
-
Access the stock web interface: Open a browser and go to
192.168.1.1or192.168.0.1(check your router’s manual if neither works). Log in with the default credentials (oftenadmin/adminor blank). -
Find the firmware upload section: Look for “System Tools,” “Administration,” or “Firmware Upgrade.” Select the factory image you downloaded and confirm. The router will reboot—this takes 2–3 minutes. Do not unplug it.
-
Verify OpenWrt is running: Once it reboots, go to
192.168.1.1in your browser. You should see the LuCI web interface (OpenWrt’s control panel) with a logo and login prompt. Default login isrootwith no password.
Install Required Packages
-
Log into LuCI: Open
192.168.1.1in your browser, click “Login,” and leave the password blank. -
Update package lists: Go to System → Software → Update Lists and click the Update Lists button. Wait for it to finish.
-
Install WireGuard tools: Go to System → Software → Available Packages, search for
wireguard-tools, and click Install. Wait for it to complete. -
Install the LuCI WireGuard interface (optional but recommended): Search for
luci-proto-wireguardand install it. Restart services by going to System → Startup → Initscripts, finding network, and clicking Restart.
Configure WireGuard as a VPN Client
You can configure WireGuard via the web interface or command line. The web interface is simpler for this setup.
Via LuCI Web Interface (Recommended)
-
Create a new WireGuard interface: Go to Network → Interfaces → Add new interface…
- Name:
wg_vpn(or any name you prefer) - Protocol: Select WireGuard VPN from the dropdown
- Click Create Interface
- Name:
-
Configure the interface:
- Private Key: Paste the private key you generated on your home server (the client’s private key, not the server’s). If you don’t have one, generate it on your home server with
wg genkey | tee wgclient.key | wg pubkey > wgclient.puband use the contents ofwgclient.key. - IP Addresses: Add your assigned client IP from the server (e.g.,
192.168.9.2/24). Click Add to add it to the list. - Leave other fields at defaults for now.
- Click Save
- Private Key: Paste the private key you generated on your home server (the client’s private key, not the server’s). If you don’t have one, generate it on your home server with
-
Add the server as a peer:
- Still on the interface edit page, scroll down to the Peers section and click Add peer
- Public Key: Paste your home server’s public key
- Preshared Key: Paste the pre-shared key you generated on the server
- Endpoint Host: Enter your home server’s public IP address or DDNS hostname (e.g.,
myhome.ddns.net) - Endpoint Port: Enter the WireGuard port your server listens on (default
51820) - Allowed IPs: Add
0.0.0.0/0(this tells the router to send all traffic through the VPN) - Route Allowed IPs: Check this box
- Persistent Keepalive: Set to
25(keeps the connection alive through NAT) - Click Save
-
Configure the firewall: Go to Network → Firewall → General Settings
- Locate the Zones section and find or create a zone for the WireGuard interface
- Assign the
wg_vpninterface to the WAN zone (to treat VPN traffic as untrusted, minimizing firewall setup) - Click Save & Apply
-
Bring up the interface: Go back to Network → Interfaces, select your WireGuard interface, and click Up to activate it.
Via Command Line (Advanced)
If you prefer SSH, log in as root (no password by default) and run:
VPN_IF="wg_vpn"
VPN_SERV="your.home.server.com"
VPN_PORT="51820"
VPN_ADDR="192.168.9.2/24"
VPN_KEY="your_client_private_key"
VPN_PUB="your_server_public_key"
VPN_PSK="your_preshared_key"
uci -q delete network.${VPN_IF}
uci set network.${VPN_IF}="interface"
uci set network.${VPN_IF}.proto="wireguard"
uci set network.${VPN_IF}.private_key="${VPN_KEY}"
uci add_list network.${VPN_IF}.addresses="${VPN_ADDR}"
uci -q delete network.wgserver
uci set network.wgserver="wireguard_${VPN_IF}"
uci set network.wgserver.public_key="${VPN_PUB}"
uci set network.wgserver.preshared_key="${VPN_PSK}"
uci set network.wgserver.endpoint_host="${VPN_SERV}"
uci set network.wgserver.endpoint_port="${VPN_PORT}"
uci set network.wgserver.persistent_keepalive="25"
uci set network.wgserver.route_allowed_ips="1"
uci add_list network.wgserver.allowed_ips="0.0.0.0/0"
uci rename firewall.@zone[0]="lan"
uci rename firewall.@zone[1]="wan"
uci add_list firewall.wan.network="${VPN_IF}"
uci commit network
uci commit firewall
service network restart
service firewall restart
Connect the Router to Hotel/Café Wi-Fi
-
Scan for available networks: Go to Network → Wireless and look for the Wi-Fi network you want to connect to.
-
Join the network: Click Scan next to the radio you want to use, find the network in the list, and click Join Network. Enter the password if required.
-
Configure the wireless interface: Set the interface to Client mode and assign it to the WAN zone in the firewall so it acts as your upstream connection.
-
Verify the connection: Go to Status → Overview and check that the wireless interface shows an IP address. If it does, your router is connected to the café Wi-Fi.
Test the VPN Connection
-
Check WireGuard status: Go to Status → WireGuard. You should see your peer listed with a recent handshake time (within the last few seconds) and a transfer rate showing data moving.
-
Test from a connected device: Connect a laptop or phone to the router’s Wi-Fi (the SSID it broadcasts). Open a terminal or SSH into the router and run:
traceroute openwrt.org
The first hop should be through your home network, not the café’s ISP.
-
Check your public IP: On a device connected to the router, visit
https://whatsmyip.comin a browser. It should show your home network’s public IP, not the café’s. -
Verify DNS: Visit
https://dnsleaktest.comto ensure your DNS queries aren’t leaking through the café’s network.
Troubleshooting
No handshake with the server: Check that your home server is reachable. Verify the endpoint host and port are correct. Ensure NTP (time sync) is working on both devices—WireGuard is time-sensitive and will refuse traffic if clocks are out of sync.
Connected to Wi-Fi but no internet: The router may not have obtained a WAN IP from the café. Go to Network → Interfaces and check if the wireless interface shows an IP address. If not, try forgetting and rejoining the network.
VPN works but only for the router, not connected devices: Check the firewall rules. Ensure the WireGuard interface is assigned to the WAN zone and that forwarding rules allow LAN traffic to reach it.
Slow speeds: WireGuard encrypts all traffic, which adds CPU overhead. If your router is old, this is normal. For detailed performance info, SSH in and run wg show to see transfer rates.
Security Notes
- Never expose the LuCI web interface to the internet. The router should only be accessible over its local Wi-Fi or via SSH from your home network. When traveling, keep it on your laptop or in your bag—don’t leave it on a public network unattended.
- Use a strong password for LuCI: Go to System → Administration and set a login password immediately after flashing.
- Keep OpenWrt updated: Check System → Software → Available Packages periodically for security updates.
- The WireGuard endpoint (your home server) should be behind a firewall and only expose the VPN port. Never run your home server on a public cloud instance without proper hardening.
Is It Worth It?
Yes, if you travel often and use untrusted Wi-Fi. A dedicated VPN router in your bag is more reliable than VPN apps on individual devices—it protects everything at once, including devices that don’t support VPN clients. The initial setup takes an hour; after that, it’s plug-and-play. The downside: it adds another device to carry, and performance depends on your router’s CPU. For most people, a modern budget router handles it fine. If you already have an old router gathering dust, this is a smart reuse.
Sources
Related video
New self-hosted AI & homelab shorts, daily.
Subscribe on YouTubeRelated guides
Turn an old webcam into an AI security camera with Frigate
Run Frigate NVR on a spare PC to detect people, cars, and animals in real-time from cheap IP cameras or old USB webcams. Local processing, no cloud, integrates with Home Assistant.
Turn a $15 Android TV Box into an Armbian Linux Server
Flash Armbian on Amlogic S905/S922 TV boxes to run Docker, Pi-hole, and other services. Boot from USB first—eMMC flashing can brick it.
Turn an Old Laptop into a Home Server with CasaOS
Install CasaOS on Debian/Ubuntu with one command and get a click-install app store for Jellyfin, Nextcloud, Home Assistant. Runs on x86 and ARM.