web-dev-qa-db-ja.com

DNSMASQがルーティングされたサブネットからのDNSクエリに応答しない

2つのDD-WRT APを使用して2つのサブネットが接続されています-リモート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を設定しています。これは2番目のサブネットのDHCPサーバーでもあります-これは機能し、リモートクライアントは正しいルーターを取得します。 DNSMasqマシンは2番目のサブネット上のPCにpingを送信でき、その逆も真です。最初のサブネット上のPCから2番目のサブネット上のPCにRDPすることもできます。ワーキング

私の問題は、DNSMasqがDNS応答を2番目のサブネットに送信しないことです。最初のサブネットには機能します。なぜ誰かが提案できますか?

注意すべきことの1つは、2番目のネットワークのルートがゲートウェイデバイス(192.168.0.1)にあったことですが、これにより多くのパケットがドロップされたことがわかりました。つまり、最初のサブネットデバイスのそれぞれに、2番目のサブネットのローカルスタティックルートがそれ。

route add 192.168.2.0 mask 255.255.255.0 192.168.0.5

現在の問題のため、この時点ではDHCP割り当てルートをまだテストしていません

これは私が持っているもののスケッチです Sketch network

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
3
Ross

わかりましたので、マニュアルをよく読んだ後、ローカルサブネットのみに応答するというデフォルトをオーバーライドするために何かを追加する必要があります(--local-service)否定のないデフォルトオプションなので、たとえば、

listen-address=192.168.0.2

ただしresolve.confには次の行があります。

nameserver 127.0.0.1

他のすべてのマシンがDNSサーバーとしてDNSMASQを正常に使用している間、不思議なことに、DNSサーバーはDNS名を解決できなくなりました。代わりに次の行を追加してこれを修正しました

listen-address=192.168.0.2,127.0.0.1

resolveconfが行っていたことを修正する簡単な方法を見つけることができなかったため

4
Ross