AdGuardHome icon indicating copy to clipboard operation
AdGuardHome copied to clipboard

Binding on 0.0.0.0 causing asymmetric routing on multihomed hosts

Open cyruz-git opened this issue 2 months ago • 0 comments

Prerequisites

Platform (OS and CPU architecture)

FreeBSD, AMD64 (aka x86_64)

Installation

Custom package (OpenWrt, HomeAssistant, etc; please mention in the description)

Setup

On one machine

AdGuard Home version

v0.107.69

Action

On a OPNsense router:

  1. Configured LAN 192.168.0.1 on igc0.
  2. Created VLAN30 as vlan0.30 and terminated it with IP 192.168.30.1.
  3. Allowed any traffic in the firewall for VLAN30.
  4. AdGuard bound on 0.0.0.0.

On a UNRAID NAS:

  1. Configured eth0 with IP 192.168.0.2.
  2. Configured OPNsense router as DNS, 192.168.0.1.
  3. Configured eth0.30 with IP 192.168.30.2.
  4. Created a macvlan docker network with parent eth0.30.
  5. Created a container in the macvlan network and assigned IP 192.168.30.3.

On a managed switch:

  1. Tagged the port for OPNsense and UNRAID with ID 30 and kept them untagged on default vlan.

On the container created in the UNRAID NAS:

  1. nslookup google.com

Expected result

The expected result would be a successful query.

Actual result

Query timed out.

Additional information and/or screenshots

The DNS is running on 192.168.0.1 and is reachable from 192.168.30.3. The issue is related to asymmetric routing.

With a tcpdump tcpdump -i vlan0.30 -nn port 53 on OPNsense, we can see that the query packet arrives from 192.168.30.3 to 192.168.0.1, but when it leaves OPNsense, its source is modified from 192.168.0.1 to 192.168.30.1.

This is probably due to some specific behavior of the FreeBSD kernel. The workaround is to bind to specific interfaces. I think something could be done to fix this, considering that Unbound works well in this very same setup.

cyruz-git avatar Nov 12 '25 23:11 cyruz-git