Specific gateway on specific interface/network

I have a ZeroTier interface/network on my router.

It has routes for and allows 0.0.0.0/0 - the problem is that I want it to use a certain WireGuard interface for that traffic and not my default route for 0.0.0.0/0 = wan.

I have forbid it to use wan through firewall - but how can I force it to use another gateway than the default = the one with lowest metric ? :thinking:

Metrics?

I assume the traffic on the other side of the Wireguard you're referring to are specific subnet or subnets (otherwise I'm not sure how you determine different traffic both on the Internet, a.k.a. 0.0.0.0/0), for example: 192.168.xxx.0/24. So, you'd just make a more-specific route for that traffic to use the WG interface:

config route
        option target '192.168.xxx.0/24'
        option interface 'wg'

???

That doesn't change routes.

You need to do Policy Based Routing and you have 3 options:

  1. mwan3 package
  2. pbr package
  3. a set of rules/routes for each internet connection.
2 Likes

Thanks a lot I solved my problems with PBR and this excellent this documentation :star_struck:

Those packages were needed:
opkg install luci-app-vpn-policy-routing vpn-policy-routing

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