How to choose gateway for connections originating from the opnsense itself?

Started by steven90, August 31, 2024, 01:47:27 PM

Previous topic - Next topic
Pretty much the title, how can i specify a particular gateway that the opnsense should use for connections from itself (like upstream dns requests or vpn connections)?

An example would be a setup with two physical WAN connections / gateways and a wireguard tunnel configured on the opnsense itself. Where could i set the physical WAN / ISP connection that should be used to establish the tunnel to the vpn server?

I know that for lan networks you can just create a firewall rule and then specify the gateway, but i couldnt find an interface / place to set firewall rules for traffic originating from the opnsense itself. And setting the rule on the wan interface doesnt really help ether bc this rule would have to be applied before the traffic hits the physical wan interface.

Thanks for any suggestions :)


Thanks,
can you elaborate a little bit?, is there any particular reason for it or is it just not implemented?
I kinda have to get this working somehow even if it is not a clean solution :/

Shouldnt it be possible to edit the routing table to allways use a particular interface / gateway for connections to the vpn servers public ip?