OPNsense Forum

Archive => 23.7 Legacy Series => Topic started by: keropiko on September 14, 2023, 11:16:09 AM

Title: Static Routes not being respected..? -SOLVED-
Post by: keropiko on September 14, 2023, 11:16:09 AM
Hello,

i have installed opnsense 23.7.3 with multiwan setup.

Yesterday I have tried to setup a static route, towards a specific VPS IP xx.xx.xx.xx/32 and i have noticed that the route , although i can see in the status page correctly, when i do a traceroute from a LAN client towards the ip, the gateway used is not the one chosen at the static route.
Title: Re: Static Routes not being respected..?
Post by: schmuessla on September 14, 2023, 11:49:57 AM
I think your VPS has an IP outside your local network (public IP)?

If I understood it correctly so far the "System routes" are only obeyed if traffic is forwarded to the "default" gateway.
But since you implemented multiwan you changed your gateway from "default" to a WAN group, so traffic is routed via one of that gateways. To enforce picking the system routing table you then need to add a firewall rule to your lan group above the default LAN traffic which has destination VPS IP and gateway "default"
Title: Re: Static Routes not being respected..?
Post by: Seimus on September 14, 2023, 12:03:47 PM
AS mentioned by @schmuessla,

You need to perform a Policy based routing, this is done within the Firewall rules where you need to specific a GW. What this will do basically is to permit traffic and forward it to the specified destination/gateway.

https://forum.opnsense.org/index.php?topic=11880.0
https://docs.opnsense.org/manual/how-tos/multiwan.html
https://docs.opnsense.org/manual/firewall.html#policy-based-routing

Regards,
S.
Title: Re: Static Routes not being respected..?
Post by: keropiko on September 14, 2023, 04:25:11 PM
Hello,

you are both correct. I completely "missed" the fact that it's a Public IP , so i should respect the policy routing instead of the default gateway.

thank you for your answers