Skip to content
Contents
GuidesOpenWrt

How to verify OpenWrt PBR matches the right device or domain

First ensure WAN and VPN are individually functional, then decide on rules based on fixed source IP, subnet, or domain name.

First ensure WAN and VPN are individually functional, then decide on rules based on fixed source IP, subnet, or domain name. On a single device, prioritize assigning a fixed DHCP address. When crossing three layers, verify that rules can still detect the source MAC. Domain name rules depend on the actual DNS resolver used by the client and the packet version's supported resolution methods.

Start with a rule

Install the corresponding firmware with pbr and LuCI frontend. Add only one test rule for a client connecting to the VPN in the interface. Before saving, verify the default path, whether failure prevents fallback, and the status of pbr and fw4. When the rule matches based on the resolved address, recheck the CDN address and TTL.

Verify traffic diversion works based on source using two terminals

Test device uses a fixed IP address; regular device serves as control. Both request the same external echo. Then, using the test domain, observe DNS address inclusion and egress. The router simultaneously logs and counts corresponding entries.

From two client devices accessing the same controlled service, compare outbound echo behavior. Read ip rule, routing table, and nftables counters. Try a normal shared CDN site with domain rules. After updating rules, rebuild sessions to avoid previous connections masking results.

Terminals to be redirected shall be directed through the corresponding interface, while the other remains on its original path. After changing the domain's IP address, retest; if the test fails, first revoke this experimental policy.

Use the firewall zone table to check the network assignment and forwarding direction of a dedicated egress.
Use the firewall zone table to check the network assignment and forwarding direction of a dedicated egress. · OpenWrt 25.12.6 x86/64 (LuCI, QEMU/KVM)
Use the firewall zone table to check the network assignment and forwarding direction of a dedicated egress. · OpenWrt 25.12.6 x86/64 (LuCI, QEMU/KVM) Open the original image

Reference

Related guides

Reference

Check the model, region and hardware revision on the label before selecting firmware.

Explore hardware

Comments