OPNsense Forum

Archive => 15.7 Legacy Series => Topic started by: pwretmo on January 24, 2016, 02:27:10 pm

Title: Howto bind outgoing traffic from opnsense (localhost) to specific WAN interface?
Post by: pwretmo on January 24, 2016, 02:27:10 pm
Hi,

I have a multi-WAN setup.


I've used outbound NAT rules and firewall rules to route outgoing traffic from subnets to the OpenVPN interfaces. This is working well.

However, I wish to setup dyndns to cloudns.net using the WAN IP. Cloudns.net is not one of the listed providers for setting up dyndns in opnsense, so I was planning to add it myself as a cron job or similar. Hence relying on that the correct WAN interface is used for outgoing traffic from the opnsense host itself.  But localhost is using one of the VPN interfaces for outgoing traffic.

I have tried setting up similar firewall rules to make 127.0.0.1 use the WAN interface for outgoing traffic. I have tried putting this rule on all different interfaces, but outgoing traffic from localhost always go through one of the VPN interfaces.

How can I control which WAN interface opnsense (localhost) use for outgoing traffic?

Regards,
Peter
Title: Re: Howto bind outgoing traffic from opnsense (localhost) to specific WAN interface?
Post by: Alphabet Soup on January 27, 2016, 02:28:42 pm
I don't have much experience with OPNsense yet, but I do have a box doing multi-wan across two gateways (on OPT1 and OPT2) via Firewall rules.  Works great for all clients passing through the box from LAN, but the box itself initially could not ntp sync or do package updates.  Eventually surmised that box-generated traffic was directed to the Gateway that was marked as Default Gateway (WAN, disconnected in my case).  Duh.  I marked one of my OPT Gateways as Default and box-generated traffic has worked ever since.

Maybe your default gateway is not set, or set to the wrong gateway?
Title: Re: Howto bind outgoing traffic from opnsense (localhost) to specific WAN interface?
Post by: pwretmo on January 27, 2016, 11:02:47 pm
I thought of that as well, unfortunately it's not the case. My WAN gateway is set as the default gateway, but the box still use my second VPN gateway.
Title: Re: Howto bind outgoing traffic from opnsense (localhost) to specific WAN interface?
Post by: iosense on January 29, 2016, 12:31:49 am
I'm having the same problem, "LAN" port can not access the Internet via WAN.

I can not make any custom adjustment, WAN_DHCP is my default gateway and Device can access the Internet but clients can not!

Title: Re: Howto bind outgoing traffic from opnsense (localhost) to specific WAN interface?
Post by: franco on January 29, 2016, 12:55:36 am
https://redmine.pfsense.org/issues/5476
Title: Re: Howto bind outgoing traffic from opnsense (localhost) to specific WAN interface?
Post by: pwretmo on March 10, 2016, 09:09:44 pm
Late reply by me. Thanks for the link.