OpenWrt VPN Router Setup Guide: Route Your Whole Home

Turn an OpenWrt router into a central VPN gateway for computers, phones, TVs, and other devices. This guide covers subscription import, split routing, DNS choices, bypass-gateway deployment, connection checks, and practical rollback steps.

An OpenWrt VPN router can act as a central gateway for computers, phones, televisions, game consoles, and other devices that are inconvenient to configure one by one. The main advantage is centralized routing: you choose which devices or destinations use the tunnel, while ordinary local traffic continues through the normal internet connection. The main challenge is that a router deployment combines several layers at once—firmware support, subscription format, proxy or tunnel software, DNS behavior, firewall zones, policy-based routing, and the physical network layout.

This guide focuses on a practical and reversible design. It explains how to prepare OpenWrt, import a subscription, choose between whole-home routing and split routing, deploy the router as either the primary gateway or a bypass gateway, verify the result, and roll back without losing access to the local network. The exact menu names vary between OpenWrt versions and compatible packages, so treat the concepts as the stable part and the interface labels as implementation details.

Understand the router design before changing settings

There are two common ways to place an OpenWrt VPN router in a home network. In a primary-gateway design, the OpenWrt device provides DHCP, NAT, firewalling, and the default gateway for the whole home. Every client receives its network settings from OpenWrt, so policy-based routing can be applied consistently. This is the cleanest arrangement when the router has enough processing capacity and you are comfortable managing the entire LAN from OpenWrt.

In a bypass-gateway design, the existing router remains responsible for the main household network. OpenWrt is connected behind it as a secondary router, and only selected devices are connected to the OpenWrt LAN or manually configured to use OpenWrt as their gateway. This arrangement is useful when the existing router must remain unchanged, when some household devices should never use the tunnel, or when you want to test the setup without moving the entire network.

90+

Countries covered

200+

Routes

Unlimited

Online devices

A router does not make every application compatible automatically. It forwards traffic according to destination, source device, port, protocol, and policy. Some applications use hard-coded DNS, unusual connection methods, local discovery, or certificate checks that can behave differently when traffic is routed through a tunnel. For that reason, begin with one test device instead of moving the whole home at once.

Also confirm that the OpenWrt hardware can run the software you intend to use. Storage, memory, CPU architecture, kernel compatibility, and package availability all matter. A router that can forward ordinary traffic may still struggle with encrypted tunnel processing, rule sets, DNS filtering, or several simultaneous clients. Do not assume that a package designed for one OpenWrt release or architecture can be installed safely on another.

Design principle: Start with a bypass gateway or one isolated test client, verify routing and DNS, and only then consider making OpenWrt the default gateway for the entire home.

Prepare OpenWrt and the subscription source

Before installing a compatible proxy or tunnel manager, record the current network arrangement. Identify which device is the upstream router, which port is connected to the internet-facing side, which port serves the LAN, and which clients depend on the existing DHCP service. Export or photograph important settings before making changes. At minimum, know how to reconnect to LuCI, how to access the router through SSH if enabled, and how to restore the previous gateway on a test device.

Update OpenWrt only through a package or firmware path appropriate for the exact device model. A firmware upgrade can change network interfaces, firewall syntax, package feeds, and configuration behavior. Avoid combining several large changes in one session. A safer sequence is to confirm basic LAN access first, install the routing software second, import the subscription third, and enable policy routing last.

A subscription link is usually a URL that returns server profiles or a provider-specific configuration. It is not the same as a single server address, and it may contain profiles for different clients. OpenWrt itself does not universally understand every subscription format. You generally need a compatible manager or core that can parse the link and generate local proxy, routing, DNS, and firewall behavior.

Depending on the package and the provider format, the imported profiles may describe Shadowsocks, VMess, Trojan, Hysteria2, WireGuard, or another supported transport. Compatibility is not determined by the protocol name alone. The installed core must support that protocol, the firmware must provide the required kernel or userspace features, and the configuration must be converted into a form the manager accepts. WireGuard, for example, is a tunnel protocol with interface and peer settings, while Shadowsocks, VMess, and Trojan are commonly handled by proxy cores. Hysteria2 may require support for its transport behavior and related options.

Keep the subscription URL private. Anyone who obtains it may be able to retrieve the profile or use information contained in it, depending on the provider's design. Do not paste it into public issue trackers, screenshots, browser sync notes, or untrusted conversion websites. If the provider offers a client-specific link, choose the format intended for the OpenWrt-compatible manager rather than copying a random profile from another client.

Import profiles and build routing policies

After the compatible manager is installed, open its subscription or provider section and add the URL. Let the manager fetch the profile, then inspect the generated entries before selecting a default route. A successful import does not prove that a profile works. It only confirms that the link was reachable and that the software could read enough of the returned data.

Choose one profile for initial testing and keep the policy simple. A useful first test is to route only one client through the selected profile while leaving the rest of the LAN on the ordinary gateway. This makes it easier to distinguish an OpenWrt configuration problem from a general upstream outage. If the manager supports health checks or profile testing, use them as a preliminary signal rather than treating them as proof of application compatibility.

Policy-based routing normally has several possible dimensions:

For most households, source-device rules are easier to understand than a large domain list. You can first route one device through the tunnel, confirm the result, and then add other devices gradually. Destination rules are useful when one device needs both direct and tunneled access, but they require maintenance. Domain lists become stale, some services use multiple domains, and content delivery networks may change addresses.

Use explicit local-network bypass rules. Traffic to the router's management address, local printer, network storage, smart-home hub, and other LAN services should not accidentally enter the tunnel. Local DNS, DHCP, and multicast discovery also need special attention. A television may require local discovery even when its internet traffic uses the tunnel, while a phone may switch between Wi-Fi and mobile data and therefore no longer match the same source rule.

DNS should be designed together with routing. If clients use the upstream router for DNS while their other traffic uses the tunnel, queries may reveal a different network path or return answers that do not match the selected route. If OpenWrt is the intended gateway, let it provide DNS to the clients or explicitly define the resolver policy in the tunnel manager. At the same time, do not redirect every DNS request blindly before confirming that local names and router management still work.

Routing approach Best suited for Advantages Points to verify
Whole-home tunnel A household where most clients need the same route Centralized management and fewer per-device settings Local services, banking or work exceptions, DNS behavior, and tunnel failure fallback
Per-device policy Homes with different requirements for computers, phones, TVs, and consoles Clear separation between tunneled and direct clients Stable client identification and correct DHCP or firewall matching
Destination policy One device that needs both direct and tunneled destinations Fine-grained control without changing the device's gateway Domain list maintenance, CDN changes, hard-coded DNS, and application-specific behavior
Bypass gateway Testing or selective deployment behind an unchanged main router Easy to limit the scope and preserve the existing network Non-overlapping subnets, double NAT, gateway assignment, and access to local devices

Deploy a bypass gateway safely

A bypass gateway is often the least disruptive starting point. Connect the OpenWrt WAN side to a LAN port on the existing router. Use a separate OpenWrt LAN network that does not overlap with the upstream LAN. Let OpenWrt provide DHCP on its own LAN if the selected clients will connect directly to it. This creates a clear boundary: the upstream router provides internet access to OpenWrt, and OpenWrt applies the tunnel policy to clients behind it.

For a wired test, connect a computer to an OpenWrt LAN port and confirm that it receives an address from OpenWrt. Check that the computer can open the OpenWrt management page, resolve ordinary domains, and reach the upstream router if that access is required. Then enable the tunnel policy for that client. If the client loses access, disable the policy from the OpenWrt management interface rather than changing several network settings at once.

For a wireless test, use a dedicated OpenWrt SSID rather than changing the existing household SSID immediately. Give the test network a clear name, keep management access restricted to the LAN, and avoid allowing guest isolation rules to block required DNS or gateway traffic. Once the behavior is understood, you can decide whether selected TVs or phones should remain on the dedicated SSID or move to a more permanent arrangement.

Double NAT is not automatically a failure in this design. Web browsing and many ordinary applications work normally behind two routing layers. However, inbound connections, device discovery, some multiplayer games, and certain remote-access tools may require additional forwarding or may not work as expected. If the goal is only outbound routing, keeping the upstream router unchanged is usually simpler than attempting to eliminate every layer of NAT.

Another option is to keep the main router as the DHCP server and manually assign the OpenWrt address as the gateway for selected devices. This requires careful client-side configuration and may be unreliable for devices that do not allow custom gateway settings. It also becomes harder to maintain when addresses change. A dedicated OpenWrt LAN or SSID is generally easier to audit because the gateway decision is made by the network design rather than by each device.

Rollback the bypass design

Rollback should be planned before activation. For a client connected to the OpenWrt LAN, disconnect its cable or Wi-Fi and reconnect it to the original router. If the client uses manual network settings, restore the original automatic DHCP behavior or the previous gateway and DNS values. On OpenWrt, stop the proxy or tunnel manager, disable the policy service, and confirm that the ordinary WAN connection still works.

If LuCI becomes unreachable after a change, connect through a local OpenWrt LAN port and avoid making further edits from the tunneled path. If you enabled a firewall rule that blocks management access, use the local console or SSH only from the trusted LAN, provided that access was previously configured. Keep the firmware recovery procedure for the exact router model available, but treat factory reset as a last resort because it removes the configuration you may need for diagnosis.

Verify routing, DNS, and failure behavior

Verification should cover more than checking whether one webpage opens. First confirm the client has the expected IP address, default gateway, and DNS server. Then compare the public network identity with the tunnel disabled and enabled. The result should change only when the selected policy says it should. A device that is supposed to remain direct must not silently inherit the tunnel merely because another client is using OpenWrt.

Test local access separately. Open the router management page, reach a local printer or storage device, and check whether local device discovery still works. If local services stop responding, inspect the policy rules and firewall zones before changing DNS randomly. A common mistake is to route the entire LAN through a proxy while forgetting that local address ranges need a direct path.

Test DNS in at least three situations: with the tunnel disabled, with the tunnel enabled, and after restarting the router or client. Look for inconsistent answers, failed local names, and applications that continue using a hard-coded resolver. DNS behavior can also change when a phone leaves Wi-Fi, when a television caches an old result, or when the subscription manager refreshes its rule set.

Test failure behavior deliberately with one non-critical client. Stop the selected tunnel or temporarily make the profile unavailable, then observe whether traffic goes direct, stops, or loops through a broken interface. There is no universally correct choice. Direct fallback preserves general connectivity but may not meet a strict routing requirement. Blocking avoids accidental direct access but can make the household appear offline. The important point is to choose intentionally and understand the result.

Performance diagnosis should also separate the router from the route itself. Encrypted forwarding consumes CPU, and DNS filtering or a large rule set can add additional work. Test the same client with the tunnel disabled and enabled, using the same connection type and similar network conditions. If direct forwarding is already unstable, changing the tunnel profile will not solve the underlying Wi-Fi, cabling, or upstream-router problem.

Verification rule: A working OpenWrt VPN router must pass four separate checks—gateway selection, DNS behavior, local-network access, and failure fallback—not merely open one remote website.

Maintain the setup and avoid common mistakes

Subscription profiles change over time, so schedule routine checks without blindly refreshing and applying every new entry. Keep the currently working profile identifiable, review newly imported settings, and preserve a known-good configuration before replacing it. If a refresh removes a working route, rollback is easier when the previous configuration has been exported and the policy rules are documented.

Separate configuration backups from subscription secrets. A router backup may contain encrypted credentials, URLs, private keys, or other sensitive values. Store it securely and do not upload it to a public file service. When sharing diagnostic information with support, remove tokens, private keys, client identifiers, and full domain lists before sending logs.

Common mistakes include enabling two competing proxy managers, running multiple DHCP servers on the same LAN, placing WAN and LAN in overlapping networks, and editing firewall rules without recording the original state. Another frequent problem is changing the default gateway on every device before testing one client. These choices make the failure scope large and obscure the cause.

Use one routing authority at a time. If a desktop client, phone profile, and router tunnel are all active on the same device, the effective path may not be obvious. Disable the device-level client while testing the router path, then re-enable it only if that combination is deliberately required. The same caution applies to browsers with their own proxy settings and applications that establish independent tunnels.

When the connection behaves unexpectedly, return to the simplest known state: ordinary WAN access, direct DNS, one test client, and one selected profile. Verify each layer in order. This method takes longer than repeatedly importing new profiles, but it produces a configuration that can be explained and maintained.

OpenWrt VPN router FAQ

Can every device use the router tunnel?

Most IP-based devices can use a router-level gateway without installing a client, including many computers, phones, televisions, and consoles. However, the result depends on the device's DNS behavior, IPv4 or IPv6 support, local discovery requirements, and the protocols supported by the OpenWrt software. Some applications may bypass the expected path or require direct access to local services. Test each important device instead of assuming that whole-home routing means identical behavior everywhere.

Should I route the entire home or use split routing?

Whole-home routing is simpler when most devices need the same policy. Split routing is safer when work systems, smart-home devices, local services, or ordinary browsing should remain direct. A per-device policy is usually easier to troubleshoot than a large destination list. You can begin with split routing and expand gradually after confirming DNS, local access, and fallback behavior.

Which protocol should I use on OpenWrt?

Use a protocol supported by both the subscription profile and the installed core. Shadowsocks, VMess, Trojan, Hysteria2, and WireGuard are not interchangeable configuration formats, and support can vary by package build. Rather than choosing by name alone, confirm that the manager can import the profile, create the required interface or proxy listener, and apply the route without errors. If one protocol is unstable, test another supported profile under the same policy conditions.

What is the safest way to recover after a bad change?

Keep one client on a known local path, preserve a configuration backup, and make changes from the LAN rather than through the tunnel. Disable the policy service first, restore the original gateway or DHCP arrangement if necessary, and then test ordinary WAN access. Avoid factory resetting the router until configuration rollback and local management access have both been attempted.

OpenWrt is most useful as a VPN gateway when the network design remains understandable. Begin with a limited deployment, import only a trusted subscription, use explicit policy rules, keep local traffic reachable, and document the rollback path. Once the test client behaves correctly after reconnects and tunnel failures, extending the same design to the rest of the home becomes a controlled network change rather than a blind switch.

Start Free