OPNsense Forum

English Forums => Tutorials and FAQs => Topic started by: wpzed on June 22, 2023, 10:36:08 AM

Title: Destination Dependent Routing?
Post by: wpzed on June 22, 2023, 10:36:08 AM
I have multiple gateways and multiple vLANs.
I would like to route the outgoing traffic through "gateway1" if the destination IP is "A.B.C.D" independently from the source of the traffic.
The source of the traffic could be any vLAN network or the router itself. 
What is the best way to implement a rule like this?
Title: Re: Destination Dependent Routing?
Post by: franco on June 22, 2023, 10:46:14 AM
Floating rule? Or per interface. It's pretty standard..

Note that traffic from router itself is not able to be managed by a gateway rule.


Cheers,
Franco
Title: Re: Destination Dependent Routing?
Post by: wpzed on June 22, 2023, 11:06:55 AM
A "floating rule" works fine for vLANs but as you wrote it does not work for the router itself.
What is the suggested way to create the same rule for the router itself?
Title: Re: Destination Dependent Routing?
Post by: franco on June 22, 2023, 11:42:28 AM
You cannot at this point. It has been known for ages.


Cheers,
Franco
Title: Re: Destination Dependent Routing?
Post by: Patrick M. Hausen on June 22, 2023, 04:03:47 PM
What's keeping you from setting a static route for A.B.C.D/32 with gateway1? All routing is per destination by default. It's source based routing that is more complex.