An OpenWrt router can route traffic for many devices through one connection, but installing a VPN package is only one part of the job. You also need a configuration compatible with the software running on the router, a clear decision about which devices should use the tunnel, working DNS, and a rollback plan. OpenWrt versions, hardware and available packages differ, so treat the steps below as a method to adapt to your device rather than a universal set of commands.

Plan the router setup before changing anything

Start by deciding what you want the router to do. A full-tunnel setup sends traffic from selected devices, or from the entire LAN, through the VPN. A policy-based setup sends only chosen devices or destinations through it and leaves other traffic on the normal WAN connection. The second option can be easier to manage when some devices need local services, direct access to a work network, or a connection that should not use the tunnel.

Next, identify the connection format you actually have. Some providers supply a standard WireGuard or OpenVPN configuration; others provide access through a compatible application or a subscription format intended for a specific client. Do not assume that a router can import any subscription link directly. A format accepted by a desktop client may not be accepted by OpenWrt, and installing a package does not make an incompatible configuration usable. Check the provider’s instructions and confirm that the router software supports the supplied protocol and configuration.

Make a short inventory before choosing packages:

  • Record the router model, hardware revision, OpenWrt release, and available storage. Confirm that any package you plan to install matches the router’s architecture and firmware release.
  • Check whether you can reach the router over Ethernet and whether you know its local address and administrator credentials.
  • Save the current configuration and note how to reset or recover the device if the web interface becomes unreachable.
  • Decide which LAN devices should use the tunnel, and list any local services that must remain reachable, such as a printer, network storage, or a home automation controller.

Keep the router’s existing WAN connection available while configuring the tunnel. If the VPN connection fails, the router should still have a known path for updates and administration. If you are comparing provider options, VPNEnjoy Reliable VPN for China is the site homepage; confirm the available configuration and device instructions before planning a router deployment.

5

setup stages

2

routing approaches

1

backup to keep

The figures above describe the organization of this guide, not a performance claim. Router throughput depends on the hardware, encryption workload, Wi-Fi conditions, ISP connection, selected endpoint and other traffic on the network.

Choose compatible software and a routing approach

OpenWrt is a Linux-based router operating system with a package system, firewall and network configuration tools. The exact menus and commands vary by release. Recent releases may use a different package manager from older releases, so first check the release information shown in the LuCI web interface or run ubus call system board over SSH. Use the package instructions for that release instead of copying commands from an unrelated tutorial.

For a standard WireGuard configuration, OpenWrt commonly uses the WireGuard kernel and user-space tools together with LuCI support where available. An OpenVPN configuration needs the corresponding OpenVPN package and compatible configuration files. If a provider supplies a proxy protocol or a subscription format, you may need a separate client such as sing-box, and availability depends on the firmware build and architecture. Shadowsocks, VMess, Trojan and Hysteria2 are distinct protocols; support for one does not imply support for another. Verify the exact configuration type and software support before installing anything.

For routing, the simplest design is often a dedicated VPN interface plus firewall rules that send a defined LAN network or selected devices through it. A policy-based routing package, such as pbr with its LuCI interface when supported by the release, can make per-device rules easier to manage. Package names and dependencies can change, so check the package feed that matches your firmware and read its documentation. Do not mix instructions for different firewall generations: current OpenWrt releases commonly use firewall4 and nftables, while older guides may refer to firewall3 and iptables.

Approach Useful when What to check
Full tunnel You want all eligible LAN traffic to use the VPN by default. Confirm what happens if the tunnel drops, and preserve access to the router and local network.
Policy-based routing Only selected devices or destinations should use the VPN. Check rule order, device identification, DNS handling and the intended fallback route.
Separate Wi-Fi network You want an easy way to choose which devices use the tunnel. Use a separate network and firewall zone; verify that it cannot unintentionally reach protected LAN devices.

A separate Wi-Fi network can be a practical alternative to maintaining a long device list. It usually requires its own network interface, DHCP settings, firewall zone and wireless network. Keep the configuration as simple as your use case allows: every extra rule adds another place to check when a device behaves unexpectedly.

Configure the connection and test it in stages

Work through the setup in small steps rather than changing the VPN, firewall, DNS and Wi-Fi configuration at once. The sequence below assumes that you have already confirmed a compatible client and configuration. Menu labels differ among OpenWrt releases and installed interfaces, so use the concepts rather than expecting an exact match on every router.

  1. Back up the current configuration. In LuCI, use the backup or configuration export option and store the file somewhere other than the router. If you use SSH, make a configuration archive using the method documented for your release. Keep a copy of your WAN settings and the original Wi-Fi details so you can restore access.
  2. Update package information and install only the required components. Use LuCI’s software page or the package manager appropriate to the firmware release. Check available storage before installation. Avoid upgrading the entire router or changing firmware during the same session as the VPN setup; that makes failures harder to diagnose.
  3. Create the VPN interface from the supplied configuration. Enter the endpoint, keys or credentials, address and DNS settings exactly as provided. Protect private keys and subscription credentials: do not paste them into public forums, online converters or screenshots. If a configuration file contains secrets, store it with appropriate permissions and remove temporary copies after import.
  4. Bring up the interface and inspect its status. Confirm that the interface reports an active connection and that the router has the expected route. A connected indicator alone does not prove that LAN clients use the tunnel. If the interface does not start, check the system log for a configuration, authentication, DNS or reachability error before adjusting firewall rules.
  5. Add routing and firewall rules for one test device. Start with a single computer or phone rather than the whole household. For a policy-based setup, make one rule that identifies the test device and directs it through the VPN. For a full-tunnel design, verify that the intended LAN traffic uses the VPN while router administration and required local services remain accessible.
  6. Test ordinary access, DNS and recovery. From the test device, load a site you normally use and check the apparent public IP with a trusted IP-checking page. Then check DNS resolution and try a local resource that should remain available. Finally, temporarily disable the VPN interface and verify that the fallback behavior matches your plan. Restore the connection after the test.

For general client installation and account steps, use the setup guide; router configuration may require additional OpenWrt-specific work beyond a standard desktop or phone setup. Keep separate notes for the router interface name, firewall zone, routing rule and DNS choice. Those details make it easier to identify which layer is responsible if only some devices are affected.

Check DNS and leak behavior

DNS deserves a separate test because a browser can reach websites while queries still use an unintended resolver. First check which DNS servers the router advertises to clients through DHCP. Then review the VPN client’s DNS settings, the router’s resolver configuration, and any policy-routing option that controls DNS traffic. The exact design depends on the software: some setups send client queries to the router and then forward them through the tunnel, while others direct them to a resolver associated with the VPN interface.

Test from the same device and network that will use the router configuration. If you change DNS settings, renew the client’s network connection or clear its DNS cache before testing again; otherwise, cached results can make the change appear ineffective. Also consider IPv6. If the VPN path handles IPv4 only but the LAN continues to advertise IPv6 connectivity, some traffic may take a different route. Either configure a supported IPv6 path or disable IPv6 for the relevant network only when you understand the effect on local and internet access.

Do not treat one browser-based test as proof that every application follows the same route. Applications can use cached DNS, their own encrypted DNS, or network behavior that differs from the operating system’s resolver. Compare the router’s routing information with tests from more than one client, and investigate differences before expanding the rules to every device.

Troubleshoot problems and roll back safely

When a device loses access, identify whether the problem affects the router, the VPN interface, the routing policy, DNS, Wi-Fi or one application. Check one layer at a time. If the router itself cannot reach its gateway, focus on WAN settings. If the router can connect but a test device cannot, inspect the firewall zone, policy rule and DNS path. If only one application fails, test another application before changing the whole router configuration.

  • ✅ Keep one device on the normal LAN while testing, so you can still reach LuCI and local services.
  • ✅ Change one setting at a time and record the previous value before applying it.
  • ✅ Confirm that the route, interface status and DNS settings agree with the intended design.
  • ❌ Do not install a package built for a different OpenWrt release or hardware architecture.
  • ❌ Do not expose router administration to the public internet as a shortcut for remote troubleshooting.
  • ❌ Do not assume a connected tunnel means all devices are routed through it or that DNS follows the same path.

If the web interface becomes unreachable, reconnect by Ethernet and check whether the router still answers at its local address. If a recent change caused the failure, use a supported configuration recovery method or restore the backup you created. A factory reset is a last resort because it removes existing network settings; make sure you have the information needed to rebuild WAN and Wi-Fi access before using it. Avoid repeatedly power-cycling during a firmware update or package operation.

After a successful rollback, restore the original LAN and WAN behavior first. Then reapply the VPN configuration in smaller stages, testing after each stage. If the issue began immediately after adding a policy rule, remove or disable that rule before reinstalling packages. If a package is incompatible, restore the previous firmware-compatible state rather than forcing dependencies from another release.

Practical takeaway: keep a verified backup and a normal-LAN administration path, test one device first, and expand coverage only after routing, DNS and fallback behavior all match your plan.

OpenWrt VPN setup FAQ

Does every OpenWrt router support VPN routing?

No. Support depends on the device’s CPU, memory, storage, firmware build, network layout and available packages. A router may run OpenWrt but lack enough storage for an additional client, or its processor may not handle the encryption workload at the speed you expect. Check the device documentation, firmware architecture and package availability before changing the router. A VPN-compatible configuration still needs software that can read that format.

Only if the router software supports that specific subscription format. Subscription links are not interchangeable with WireGuard or OpenVPN configuration files, and support varies by client. Do not convert a private link using an unfamiliar website. Check the provider’s instructions for supported clients and configuration options; if the router cannot consume the supplied format, use a compatible client on each device or another supported network design.

Will one router connection cover every device in the home?

It can cover devices whose traffic is routed through the configured network, but coverage depends on the rules. Devices on another Wi-Fi network, a guest network, a wired network with separate policies, or a connection using a different route may not follow the VPN. Check each network and device group separately. A dedicated VPN Wi-Fi network can make the choice visible, while policy-based routing can be more flexible if you need finer control.

What should I do if the VPN stops working?

Check whether the router still has internet access, then inspect the VPN interface status and system log. Test DNS and routing from one device before changing global settings. If you need to restore ordinary connectivity quickly, disable the VPN-specific rule or interface using the administration path you kept available. Restore the backed-up configuration if necessary, and investigate the failure before enabling the same rule set again.