Default route and it relation to Policy based routing

I'd like to understand something instead of being handed the solution to a specific problem.

In a PBR scenario for inbound and outbound vpn, am I supposed to set the default route in the policy table myself by defining a 0.0.0.0 at the bottom that points to my mullvad interface (and remove the "add route" in all peer tab's) ?
Or should I define the default route on the peer tab of my mullvad "interface" and only use the policy table for the inbound vpn (after having remove "add route" in its peer tab.)

Both my tunnels work .. but not in unison. I have multiple vlan's and successfully figured out how to selectively do "intervlan" between them.
But the vpn routing stuff just eludes me.

thx

If you don't want to use pbr package, then a set of rules/routes for the vpn connection is needed.
For a piece of advice, filter out the default gateway from the vpn client, so that you only have the default route from the ISP on the main routing table.
Then create a route for the default via the vpn gateway in a new routing table. Finally make a rule to match the traffic that will use the new routing table, that is to use the vpn.

1 Like

https://openwrt.org/docs/guide-user/network/ip_rules#examples

1 Like