To route specific local devices through an encrypted VPN tunnel while keeping the rest of your network on direct internet, you configure policy-based routing (PBR) on your router. Instead of forcing every packet through an encrypted interface, PBR matches outbound traffic by source IP address or MAC address and steers matching packets into the VPN client gateway while allowing unmatched packets to follow the default WAN gateway.
At 365Finds, we consider whole-network VPN routing a flawed compromise for modern households. Forcing an entire household through a single tunnel breaks local banking apps, degrades real-time gaming with unnecessary latency, disrupts smart TV local casting, and chokes high-speed fiber connections behind router CPU encryption limits. Selective routing is the practical architecture: it gives high-risk devices or region-shifting hardware dedicated cryptographic tunnels without collateral damage to the rest of the household.
[ Local Network Clients ]
| |
[ Streaming Box / ] [ Gaming Console / ]
[ Work Laptop ] [ Smart Home Hub ]
(192.168.1.50) (192.168.1.60)
| |
v v
[ Policy Match ] [ Default Route ]
| |
v v
[ tun0 / wg0 ] [ WAN / ISP ]
| |
(Encrypted Tunnel) (Direct Low Latency)
Step 0: Fix IP Addresses Before Creating Rules
Policy-based routing rules mapped to dynamic DHCP addresses inevitably break. The moment a client renews its lease and grabs a different IP, your routing policy either fails silently or routes the wrong hardware through your encrypted gateway.
- Navigate to your router's DHCP server settings (typically LAN > DHCP Server or Network > Interfaces > LAN).
- Create a static DHCP reservation for every machine targeted for selective routing (for example, assign
192.168.1.50to your streaming box and192.168.1.51to a work laptop). - Disable MAC address randomization (known as "Private Wi-Fi Address" on iOS, macOS, Android, and Windows) on client devices connecting to your home Wi-Fi network. If the device randomizes its MAC address, it receives an unexpected IP from the pool and bypasses IP-based policies.
- Ensure your local subnet (RFC 1918 ranges such as
192.168.1.0/24) is exempted from VPN redirection so local printers, Network Attached Storage (NAS), and casting protocols continue working without interruption.
Method 1: Asuswrt-Merlin (VPN Director)
Stock Asus routers provide a simplified interface called VPN Fusion, but Asuswrt-Merlin's VPN Director is substantially more reliable, handling state management and kill switches with granular precision.
1. Establish the VPN Client
Navigate to VPN > VPN Client. Configure your WireGuard or OpenVPN connection using your provider's configuration file. Verify that the tunnel status displays a connected state and receives an assigned virtual IP address.
2. Configure VPN Director Rules
Navigate to VPN > VPN Director. Rules are evaluated sequentially from top to bottom; the first matching rule dictates the outbound interface.
- Click the Add (+) icon in the rule table.
- Set Interface to your active VPN client (for example,
WireGuardorOVPN1). - Set Enable to
Yes. - In Local IP, enter the static IP of your target client (for example,
192.168.1.50/32or an IP range like192.168.1.50-192.168.1.55). - Leave Remote IP set to
0.0.0.0/0(or blank) to route all outbound internet traffic from this device through the tunnel. - Click Apply.
Interface Local IP Remote IP Description
WireGuard 192.168.1.50/32 0.0.0.0/0 Streaming Box Tunnel
WireGuard 192.168.1.51/32 0.0.0.0/0 Work Laptop Tunnel
All other network clients without an explicit rule match will bypass the VPN and exit through the default WAN gateway.
3. Prevent DNS Leaks via DNS Director
Routing payload data through a VPN while sending DNS requests across your ISP gateway exposes browsing behavior. In Asuswrt-Merlin:
- Go to LAN > DNS Director.
- Set Global Redirection to
Routeror configure device-specific overrides so that192.168.1.50uses the VPN provider's upstream DNS servers directly.
Method 2: GL.iNet Routers (Firmware v4.x Policy Mode)
GL.iNet travel and home routers feature a purpose-built policy engine layered directly over OpenWrt.
- Log in to the web Admin Panel (
192.168.8.1). - Navigate to VPN > VPN Dashboard and confirm your WireGuard or OpenVPN client is connected.
- In the top right corner of the VPN Dashboard, change the operational mode from Global Mode to Policy Mode.
- Click on Policy Settings (or VPN Policies depending on sub-version).
- Choose MAC Address as the policy type if you want hardware-level tracking, or choose Domain / IP if you prefer IP management.
- Under rule execution, select Only allow the following use VPN.
- Click Add, check the target device from the client list (or enter its MAC/IP manually), and click Apply.
- Uncheck Use VPN for all processes on the router. This keeps router-level maintenance services (such as NTP time sync, firmware update checks, and DDNS) on the direct WAN connection so they do not stall if the VPN drops.
Method 3: OpenWrt with pbr (nftables-based Policy Routing)
Modern OpenWrt versions (22.03 and later) run on nftables and fw4. The dedicated pbr package replaces legacy routing scripts with clean, high-performance packet marking.
1. Install the PBR Engine and Web Interface
Connect to your router via SSH or the LuCI web interface and install the required packages:
opkg update
opkg install pbr luci-app-pbr
If you plan to use domain-based routing alongside IP rules, install dnsmasq-full to support dynamic nftset resolution:
opkg remove dnsmasq
opkg install dnsmasq-full
2. Configure Policy Routing in LuCI
- Open LuCI and go to Services > Policy Routing.
- Under the Configuration tab, confirm that both your default WAN interface (
wan) and your VPN interface (for example,wg0ortun0) are detected and listed under supported interfaces. - Switch to the Policies tab and click Add.
- Configure the rule:
- Name:
vpn_streaming_box - Interface: Select your VPN interface (
wg0). - Source Address:
192.168.1.50 - Destination Address: Leave blank to match all external traffic.
- Name:
- Click Save & Apply.
- On the PBR Overview page, click Restart to generate the underlying
nftablesmark rules and routing tables.
Method 4: pfSense and OPNsense (Firewall Gateway Rules)
In enterprise-grade BSD router platforms like pfSense and OPNsense, policy routing is managed entirely through firewall rule evaluation and outbound NAT mapping.
1. Assign the VPN Interface and Verify Gateway
- Navigate to Interfaces > Assignments. Map your OpenVPN or WireGuard client instance to an interface (e.g.,
OPT1/VPN_WAN). - Navigate to System > Routing > Gateways and verify that a gateway pointing to your VPN interface is active and reporting low packet loss.
2. Create an IP Alias
- Navigate to Firewall > Aliases > IP.
- Click Add.
- Name the alias
VPN_Selective_Hosts. - Enter the static IPs of all target devices (
192.168.1.50,192.168.1.51). - Save and apply changes.
3. Configure Outbound NAT
By default, pfSense uses automatic outbound NAT. When forcing traffic out of a non-default gateway, manual translation rules are necessary:
- Navigate to Firewall > NAT > Outbound.
- Select Hybrid Outbound NAT and click Save.
- Add a mapping rule:
- Interface:
VPN_WAN - Source:
Single host or alias->VPN_Selective_Hosts(or your LAN subnet) - Translation Target:
Interface Address
- Interface:
- Save and apply changes.
4. Create the LAN Policy Rule
- Navigate to Firewall > Rules > LAN.
- Rules evaluate from top to bottom; the first rule that matches passes or blocks the traffic.
- First, verify you have a rule passing local network traffic (RFC 1918) using the default routing table:
- Source:
LAN net| Destination:RFC1918_Networks(10.0.0.0/8,172.16.0.0/12,192.168.0.0/16) | Gateway:default.
- Source:
- Add a rule for your VPN hosts immediately below your local bypass rule and above the default LAN-to-any rule:
- Action:
Pass - Interface:
LAN - Address Family:
IPv4 - Source:
Single host or alias->VPN_Selective_Hosts - Destination:
Any - Advanced Options > Gateway: Select your
VPN_WAN_GWgateway.
- Action:
- Save and apply changes.
- Go to Diagnostics > States > Reset States and clear existing states. Active connections established prior to rule creation will remain on the old gateway until terminated.
Common Failure Modes and Diagnostic Checklist
When policy routing misbehaves, the breakdown rarely stems from the core routing table itself. At 365Finds, our troubleshooting across multiple router implementations points to three recurring snags:
| Problem | Root Cause | Fix |
|---|---|---|
| Target device shows ISP IP | Persistent connection state table | Reset router state tables or toggle client Wi-Fi off and on. |
| Target device leaks DNS | Queries bypass tunnel via router local resolver | Enforce interface-level DNS or redirect port 53/853 to VPN DNS. |
| Streaming app detects VPN bypass | IPv6 dual-stack bypass | Disable IPv6 on the target device or block IPv6 WAN egress. |
| Local printer/NAS unreachable | Subnet traffic routed to tunnel | Add an explicit bypass rule for RFC 1918 local subnets above VPN rules. |
| Rule stops working after reboot | Dynamic IP reassignment | Verify static DHCP reservation and turn off client MAC randomization. |
To verify rule isolation, run an IP and WebRTC leak test simultaneously on both a targeted device and an untargeted gaming console or desktop. The targeted device must reflect your VPN provider's remote exit node and DNS endpoints, while the gaming console must register your direct ISP public IP with single-digit local latency.