For readers with an existing main router who want to test transparent proxying on a few devices with OpenWrt. First check whether traffic passes through OpenWrt, then confirm the firewall can hand connections to the core, and finally test DNS and IPv6 separately. This sequence helps avoid changing the gateway, forwarding rules, and core configuration all at once if the bypass router cuts off access.
Main Router or Bypass Router: Choose the Traffic Path First
“Transparent” proxying means apps don’t need individual proxy settings. It doesn’t mean every device on your LAN will automatically use the proxy. When OpenWrt is the main router, devices that use it as their default gateway typically send off-subnet traffic through it. When OpenWrt is just another device on the same subnet, clients keep using their existing gateway, so rules on the bypass router won’t automatically capture their connections.
Test with One Device on a Bypass Router
RecommendedKeep PPPoE and DHCP on the main router, and point the IPv4 default gateway of just one test device to the bypass router. If anything goes wrong, restore that device’s automatic network settings without affecting other devices’ DHCP leases.
Best for: an existing, stable main router and a first test on one computer
OpenWrt as the Main Router
OpenWrt handles both gateway and address assignment, centralizing traffic control. However, a firewall reload or DNS misconfiguration can affect more devices. Before migrating, confirm the WAN port, connection method, and local management access.
Best for: planning a maintenance window and managing the whole home network centrally
Pointing a Bypass Router Gateway and Running a Test
This example uses IPv4 on a single LAN: the main router is 192.168.50.1, the bypass router is 192.168.50.2, and the subnet mask is 255.255.255.0. These addresses aren’t a universal template. Use your existing subnet, and choose an address for the bypass router that won’t conflict with DHCP leases.
Back Up the Current Configuration
In LuCI, go to “System” → “Backup / Flash Firmware” and create a configuration backup. Note the current gateway, DNS, and management address. Keep another management device on the main router so you can still reach both routers if the test device loses connectivity.
Set a Static Address for the Bypass Router
On the bypass router, go to “Network” → “Interfaces” → “LAN” → “Edit” and set a static address. Set the bypass router’s own IPv4 default gateway to the main router. If the main router assigns addresses on this subnet, make sure the bypass router’s “DHCP Server” is not handing out IPv4 leases on that interface.
Switch One Test Device
Set the test device’s IPv4 default gateway to
192.168.50.2, but leave its DNS setting unchanged for now. Don’t enable transparent proxying yet. Confirm that the device can open the bypass router’s management page, then check whether ordinary forwarding provides internet access. If this fails, check the gateway, forwarding permissions, and actual return path before changing core routing.Check the Interception Path
In LuCI, check “Status” → “System Log” for service startup messages and port conflicts, then compare firewall counters with the core’s connection logs. First verify that one destination expected to use the proxy and one expected to connect directly behave as intended. Adjust the test device’s DNS only after that.
On a same-subnet bypass router, also check the return path. Traffic that isn’t proxied and is only forwarded may return directly from the main router to the client, bypassing the OpenWrt device. If connection tracking reports problems, verify the actual path before deciding whether to change return routing, adjust the topology, or apply source NAT to specific forwarded traffic. Don’t enable NAT for the entire LAN by default: logs may then show only the bypass router’s address, making it harder to identify issues by device.
Transparent Proxy Inbounds and Firewall Interception
Xray and V2Fly are cores that can run on a router; v2rayN is a desktop client. A router’s job has two parts: the firewall selects connections for interception, then the core handles them according to its inbound, routing rules, and outbound configuration. A successful subscription import, a running process, or a listening port doesn’t prove that forwarded traffic has reached an inbound.
Bottom line: Match the inbound to the rules first
After initiating a controlled connection, if the firewall rule counter increases but there’s no matching inbound entry in the core logs, check the protocol, port, and local delivery path before changing the outbound. If the rule counter doesn’t move at all, recheck the client gateway and the rule’s match scope.
- Choose the interception method: For TCP, a common approach is redirecting traffic and reading the original destination address. To preserve the original destination and handle both TCP and UDP, TPROXY is typically used. It also requires packet marks, policy routing, and a core inbound that supports transparent proxying. Don’t send transparent traffic directly to a standard SOCKS inbound.
- Check the firewall backend: Standard OpenWrt releases have used nftables-based firewall4 by default since 22.03; check the actual device if you’re running custom firmware. Don’t copy rules written for older iptables versions without adapting them. In particular, confirm that the rules remain in place after a firewall reload.
- Prevent traffic loops: Exclude local management traffic and core upstream connections that could re-enter the interception path. Keep other LAN services on direct connections where needed. Never expose a transparent inbound to the WAN.
Test DNS Interception and IPv6 Separately
The default gateway and DNS server are separate settings. After changing a test device’s gateway to the bypass router, it may still use the main router for DNS. When both the main router and the client are on the same subnet, DNS requests sent to the main router usually travel directly over the local network, bypassing the OpenWrt device. To monitor or manage these requests, first configure the test device to use the bypass router’s DNS service rather than immediately redirecting traffic across the entire network.
- Find out where DNS queries go: Check which resolver the device actually uses, then test a public domain and a LAN hostname separately. If the bypass router uses dnsmasq for local lookups, make sure its upstream resolver won’t send requests back to itself. Also make sure no other service is competing for port 53 on the same address.
- Separate DNS from connectivity: A DNS response confirms only that name resolution worked; it doesn’t mean the subsequent TCP or UDP traffic used the expected outbound. Intercepting port 53 alone won’t capture encrypted DNS initiated by apps. When troubleshooting, record system DNS queries and app connections separately.
- Check IPv6 separately: Changing the IPv4 gateway doesn’t change the IPv6 default route configured by router advertisements. A dual-stack device may still reach IPv6 destinations directly through the main router, making routing rules appear inconsistent. Check both default routes and their DNS sources, then decide whether to include IPv6 in the test. Don’t disable IPv6 across the whole network just to test one device.
Choosing a Core, Troubleshooting, and Rolling Back
When choosing Xray or V2Fly, start with the protocol, transport, and security settings supported by your existing server. Then check the router’s CPU architecture, available memory, and storage. Verify configuration fields against the version of the core you’re actually using: accepting JSON fields with the same names doesn’t mean both cores interpret every option identically. Keep a working configuration when updating, and change one component at a time so you can tell whether an issue came from a core update or a network rule.
| Symptom | Check first | Next step |
|---|---|---|
| No connection after changing the gateway | Connectivity between the device and bypass router; the bypass router’s default route | Pause interception and restore the basic forwarding setup |
| Can reach a specified IP address, but domain lookups fail | The device’s resolver and its upstream server | Test LAN hostnames and public domains separately |
| Web pages load, but some apps time out | Whether UDP and IPv6 follow the same expected path | Compare logs by protocol and address family |
| Transparent proxy stops working after a reboot | Whether the process started and policy routes and rules were restored | Find the missing component first, then check service startup order |
To roll back, first restore the test device’s gateway and DNS to their original settings. If you changed DHCP options, renew the test device’s lease and verify the settings it actually received. Next, remove the transparent interception rules and related policy routes together, following the deployment method. Stop the core last. Stopping the process while leaving rules that point to its local inbound can send matching traffic to a port with no listener.