How can I perform selective routing from the local system?

Started by Lucid1010, March 23, 2026, 01:08:42 PM

Previous topic - Next topic
wg1: flags=10080c1<UP,RUNNING,NOARP,MULTICAST,LOWER_UP> metric 0 mtu 1420
        description: Mullvad
        inet 10.x.x.x netmask 0xffffffff
        groups: wg wireguard

Selective routing has been configured, and traffic from specific hosts (192.168.10.0/24) is successfully being routed through Mullvad WireGuard.
vm(192.168.10.5) -> curl ifconfig.co -> show mullvad ip


However, it seems that traffic from the OPNsense machine itself through the wg1 interface is not going through Mullvad.
curl --interface wg1 ifconfig.co
> show wanip


How can I enable Mullvad routing from OPNsense (local)?



You can redirect the traffic to the desired gateway with a policy-routing rule for direction out on the WAN.

Don't forget to add a proper outbound /source NAT rule. As far as I know, this has to be added to the WAN, but with the translation address of the real outgoing interface.