Why not run another DNS server (such as pi-hole) and use that as a resolver for OPNsense, and therefore unbound.The other networks could have an alternative default gateway as well. Can you add your Ubuntu to more VLAN's and set it as the DG there?Bart...
how would I add the Ubuntu VM (192.168.1.10) to other subnets?
So the LAN traffic goes like this: LAN device (192.168.1.x) --> Ubuntu VM (192.168.1.10) --> out via Mullvad interface on the VM --> OPNsense gateway (192.168.1.1) --> internet.
I cannot figure out how to get Unbound to use this manually added gateway to send out DNS queries.
I am not sure how to get devices on other subnets to use the VM as gateway.
Quote from: randomwalk on September 24, 2023, 08:16:56 amSo the LAN traffic goes like this: LAN device (192.168.1.x) --> Ubuntu VM (192.168.1.10) --> out via Mullvad interface on the VM --> OPNsense gateway (192.168.1.1) --> internet.Nope, it doesn't. If you use policy-based routing on OPNsense to achieve this, the LAN devices will keep using OPNsense as their default gateway, which then forwards the packets:LAN device --> OPNsense --> Ubuntu VM --> OPNsense --> InternetTo avoid this, you can assign the Ubuntu VM as the default gateway via DHCP.
I was thinking that because the VM and LAN devices are in the same subnet (192.168.1.1/24), then traffic between them wouldn't go through OPNsense.
First, making the VM the default gateway would mean that none of the firewall rules or policy-based routing in OPNsense would have any effect, right? Since the traffic doesn't go to OPNsense first?
Second, since the VM currently forwards all incoming traffic on the LAN interface to wg-mullvad interface, LAN devices would not be able to access local subnets (devices in both the LAN and Guest nets) unless I somehow add iptable rules on the VM to direct "local" traffic to OPNsense.
Effectively, I have to make the VM a router too?
Just trying to understand the pros and cons of having the VM be the default gateway.