VPN, policy routing and single port opens

I'm trying to figure out how to open a single port to bypass the VPN on a machine.

I have VPN Policy Routing 0.3.4-8 to send all packets from a single machine through the VPN.

 config policy
         option name 'VPN1'        
         option src_addr '192.168.1.52'
         option interface 'VPN'

If I try to open up any port or set a port range, it no longer goes through the VPN.

 config policy
         option name 'VPN2'
         option src_addr '192.168.1.52'
         option dest_port '0-65535'
         option src_port '0-65535'
         option interface 'VPN'

or

 config policy
         option name 'VPN3'
         option src_addr '192.168.1.52'
         option src_port '0-32399 32401-65535'
         option dest_port '0-32399 32401-65535'
         option interface 'VPN'

If I use VPN1 and try to add in this, it also fails.

 config policy
         option name 'plex'
         option src_port '32400'
         option dest_port '32400'
         option src_addr '192.168.1.52'
         option interface 'wan'

So, I'm assuming that I am doing something wrong here, or that I'm using the wrong tool for the job.
1: Can this even be done?
2: Am I using the right tool?
3:Am I using the tool correctly?

EDIT:
I'm using a simple 'what's my IP' check to see if I'm going through VPN.
Plex also shows me what the outside IP is.

Use the example for Plex server in the README as the highest listed policies, then add a policy to route all traffic from same IP to VPN.

Once the policy is matched, the policies below it in the list are no longer processed, the order matters.

PS. Better install pbr (if on OpenWrt 22.03) or pbr-iptables instead of vpn-policy-routing.

I don't actually get an option for PBR when I search through the packages list.
VPR says to use PBR as well, but again... I don't seem to have access.

EDIT: Nevermind.
Found the docs on how to install.
facepalm

Well, that was an adventure. Updated to 22.03.2, and somehow hosed all my VPN settings.
Ended up having to reset to basic image and re-setup everything

FINALLY looks like I got it working.
Thanks for the info @stangri !!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.