Force the local DNS server to use the tunnel as well. [...] For OPNsense itself, configure the DNS server to use the tunnel gateway.
# workstracepath -n 8.8.8.8# doesn't worktracepath 8.8.8.8
Proto Destination Gateway Flags Use MTU Netif Netif (name)ipv4 default <ISP WAN IP> UGS 11793 1500 igb1 wan
In resolver mode (default) the DNS Resolver [...] contacts servers which cannot be known beforehand, it must utilize the default route on the firewall to make outbound connections.
What are you trying to achieve? The most private way of doing DNS is to just use your local resolver without any forwarding.
You can add a static host route to your VNP endpoint and then change the default route to your VPN tunnel.
But again: why?
If it's privacy concerns, commercial VPN vendors are not a solution!
ipv4 0.0.0.0/1 wg0 US 35 1420 wg0 WAN_VPN ipv4 128.0.0.0/1 wg0 US 250 1420 wg0 WAN_VPN
Could you elaborate on how to do that? Do you mean a static route from the Local Endpoint interface IP to the ISP WAN? How would this work with multiple VPN gateways?
Do you mean no privacy when using a DNS resolver?
I haven’t tried this myself, but maybe an outbound NAT rule that sends all traffic from the unbound IP to destination port 53 over the VPN WAN interface?A static route may also be needed as earlier suggested
Proto Destination Gateway Flags Use MTU Netif Netif (name)ipv4 default X.X.X.1 UGS 434 1500 igb1 wan ipv4 10.10.10.54 wg0 UHS 0 1420 wg0 WAN_VPN ipv4 10.10.10.55 link#9 UHS 0 16384 lo0 Loopback ipv4 10.10.10.55/32 link#9 U 0 1420 wg0 WAN_VPN ipv4 X.X.X.0/24 link#2 U 0 1500 igb1 wan ipv4 X.X.X.X link#2 UHS 0 16384 lo0 Loopback ipv4 127.0.0.1 link#6 UH 12 16384 lo0 Loopback ipv4 192.168.1.0/24 link#1 U 1470 1500 igb0 lan ipv4 192.168.1.1 link#1 UHS 0 16384 lo0 Loopbackipv4 M.M.M.M 10.10.10.54 UGHS 2 1420 wg0 WAN_VPN
A static route for your single VPN gateway [...] pointing to only a single host, with router <your ISP gateway>. [...] Then you can route 0.0.0.0/0.
Proto Destination Gateway Flags Use MTU Netif Netif (name)ipv4 default 10.10.10.54 UGS 285 1420 wg0 WAN_VPN ipv4 10.10.10.54 wg0 UHS 0 1420 wg0 WAN_VPN ipv4 10.10.10.54/32 X.X.X.1 UGS 0 1500 igb1 wanipv4 10.10.10.55 link#9 UHS 0 16384 lo0 Loopback ipv4 10.10.10.55/32 link#9 U 0 1420 wg0 WAN_VPN ipv4 X.X.X.X.0/24 link#2 U 0 1500 igb1 wan ipv4 X.X.X.X link#2 UHS 0 16384 lo0 Loopback ipv4 127.0.0.1 link#6 UH 374 16384 lo0 Loopback ipv4 192.168.1.0/24 link#1 U 1962 1500 igb0 lan ipv4 192.168.1.1 link#1 UHS 0 16384 lo0 Loopback ipv4 M.M.M.M 10.10.10.54 UGHS 325 1420 wg0 WAN_VPN
QuoteDo you mean no privacy when using a DNS resolver?Whenever you use an upstream resolver, be it through a VPN or not, that upstream resolver sees all your queries. I consider that a serious privacy problem.
[...] nobody sees those. At least nobody in particular in a single place.
I tried the following:Interface: WANSource: Loopback netDestination Port: 53NAT Address: WAN_VPNDid you mean a outbound NAT rule or a port forward? Can you please give me some more details? A static route from where to where?
Interface: VPN_WANSource: This FirewallDestination Port: 53Translation / target: Interface address
Sorry, this is a bit of (somewhat educated) guesswork. I don't use unbound on OPNsense (I have a separate box that does DNS for my network).
But I have also just noticed that under Services/Unbound DNS/General/Advanced, you can set the Outgoing Network Interfaces.
I already have this set (I mentioned this in the initial post) but traffic still leaves through WAN. It seems the setting is just ignored...... What could be the reason that this happens? Wrong NAT rules? Missing rules?