Dnsmasq

將 dnsmasq 的 DHCP 伺服器限制在一個介面上

  • November 30, 2016

如何配置dnsmasq只分配地址eth0,而不是wlan0

手冊頁很好地解釋了它。如果您不想在其上執行它只是 DHCP,wlan0那麼您可以使用--no-dhcp-interface=wlan0. 如果您根本不想讓 dnsmasq 聽,wlan0那麼您可以使用--except-interface=wlan0.

如果您只想讓 dnsmasq 監聽,eth0那麼您可以使用--interface=eth0.

對於那些喜歡我的人來說,為什麼埠 53 仍然對所有介面開放,無論您輸入哪個選項來限制它。還有一個選項需要打開。

-z, --bind-interfaces On systems which support it, dnsmasq binds the wildcard address, even when it is listening on only some interfaces. It then discards requests that it shouldn't reply to. This has the advantage of working even when interfaces come and go and change address. This option forces dnsmasq to really bind only the interfaces it is listening on. About the only time when this is useful is when running another nameserver (or another instance of dnsmasq) on the same machine. Setting this option also enables multiple instances of dnsmasq which provide DHCP service to run in the same machine.

引用自:https://serverfault.com/questions/144674