OPNsense Forum

English Forums => General Discussion => Topic started by: wotcha on March 02, 2023, 09:23:18 PM

Title: Unbound DNS for VLANs via different gateways
Post by: wotcha on March 02, 2023, 09:23:18 PM
Is it possible to have 2 VLANs (55&66) use Unbound DNS though a VPN Gateway, AND have another 2 VLANs (77&88) use Unbound DNS but through the WAN as normal?

How do I set this up? via FW rules or via the Unbound settings page?
(I could only find listen interfaces on the Unbound settings page, with a place to specify the gateway)
Title: Re: Unbound DNS for VLANs via different gateways
Post by: zz00mm on March 09, 2023, 06:43:53 PM
Yes it can be done.
I have 10 VLANS
all but 2 have the default "*" gateway in the FW rule.

I have 1 openVPN connection to a US based endpoint.
In the FW rule for this VLAN the default gateway is changed to the connection name i.e. "openVPN_US"

1 have 1 openvpn connection to a EU based endpoint.
In the FW rule for this VLAN the default gateway is changed to the connection name i.e. "openVPN_EU"

1 note of interest, if you have issues getting DNS to resolve once the openVPN connection is up and active, I think I was unable to ping the LAN GW and DNS querys from command line against the IP would fail.
I created a Floating Rule to allow each VLAN access to its GW, I think it could be accomplished also by creating a rule on the VPN VLANs to allow them access to the GW and it should work.

Hopefully this helps.
zz00mm