DNSMASQ 不回答来自路由子网的 DNS 查询

Ros*_*oss 5 networking dnsmasq

我有两个使用两个 DD-WRT AP 连接在一起的子网 - 远程 AP 处于客户端路由模式,因此它有一个单独的子网,其 IP 是 192.168.2.1/24 和 192.168.0.5/24。本地 AP 处于 AP 模式 DD-WRT DHCP 设置为远程 AP 处于转发模式

我在 IP 192.168.0.2/24 上的第一个子网中设置了 DNSMASQ,它也是第二个子网的 DHCP 服务器 - 这有效并且我的远程客户端获得了正确的路由器。DNSMasq 机器可以 ping 第二个子网上的 PC,反之亦然在职的

我的问题是 DNSMasq 不会将 DNS 回复发送到第二个子网 - 它确实适用于第一个子网。谁能建议为什么?

需要注意的一件事是,第二个网络的路由在网关设备 (192.168.0.1) 上,但我发现这丢弃了许多数据包 - 因此每个第一个子网设备都有一个本地静态路由,用于添加到第二个子网它。

route add 192.168.2.0 mask 255.255.255.0 192.168.0.5
Run Code Online (Sandbox Code Playgroud)

由于我当前的问题,此时我还没有测试 DHCP 分配的路由

这是我所拥有的草图 草图网络

DNSMASQ 配置

# Configuration file for dnsmasq.
domain-needed
bogus-priv
addn-hosts=/etc/dnsmasq.hosts
# so don't use it if you use eg Kerberos, SIP, XMMP or Google-talk. This option only affects forwarding, SRV records originating for dnsmasq (via srv-host= lines) are not
# suppressed by it.
filterwin2k

dhcp-range=set:house,192.168.0.1,192.168.0.254,infinite
dhcp-range=set:backyard,192.168.2.1,192.168.2.254,infinite

# Change this line if you want dns to get its upstream servers from somewhere other that /etc/resolv.conf
resolv-file=/var/run/dnsmasq/resolv.conf
# server=61.9.134.49
# server=61.9.133.193 setup the default gateway
dhcp-option=tag:house,option:router,192.168.0.1
dhcp-option=tag:backyard,option:router,192.168.2.1

# option 42?
dhcp-option=option:ntp-server,192.168.0.2
expand-hosts
domain=wilson.lan
dhcp-range=192.168.0.100,192.168.0.150,12h
dhcp-range=192.168.2.100,192.168.2.150,255.255.255.0,12h


# DO NOT Set The route to that network Done on Gateway
#dhcp-option=121,192.168.2.0/24,192.168.0.5
#Send microsoft-specific option to tell windows to release the DHCP lease when it shuts down. Note the "i" flag,
#  to tell dnsmasq to send the value as a four-byte integer - that's what microsoft wants. See
# http://technet2.microsoft.com/WindowsServer/en/library/a70f1bb7-d2d4-49f0-96d6-4b7414ecfaae1033.mspx?mfr=true
dhcp-option=vendor:MSFT,2,1i
# Set the DHCP server to authoritative mode. In this mode it will barge in and take over the lease for any client
# which broadcasts on the network, whether it has a record
# of the lease or not. This avoids long timeouts when a machine wakes up on a new network.
# DO NOT enable this if there's the slightest chance that you might end up
# accidentally configuring a DHCP server for your campus/company accidentally.
# The ISC server uses the same option, and this URL provides more information:
# http://www.isc.org/files/auth.html
dhcp-authoritative
# Log lots of extra information about DHCP transactions.
log-dhcp
Run Code Online (Sandbox Code Playgroud)

Ros*_*oss 8

好的,所以在更好地阅读手册后,我需要添加一些内容来覆盖仅回答本地子网(--local-service)的默认值,这是一个没有否定的默认选项,例如我试过

listen-address=192.168.0.2
Run Code Online (Sandbox Code Playgroud)

然而,作为 resolve.conf 有行

nameserver 127.0.0.1
Run Code Online (Sandbox Code Playgroud)

我的更改停止了 DNSMASQ 自身回答查询 - 奇怪的是,DNS 服务器不再能够解析任何 dns 名称,而所有其他机器都成功地将其用作 dns 服务器。我通过添加以下行来解决此问题

listen-address=192.168.0.2,127.0.0.1
Run Code Online (Sandbox Code Playgroud)

因为我无法找到一种简单的方法来解决 resolveconf 正在做的事情