强制dnsmasq为DHCP绑定一个接口

我想在两个接口上使用带有两个configuration的dnsmasq,这两个接口应该在本地绑定。 如果你阅读手册页,它看起来像interface=wlan0 bind-interfaces应该做的伎俩。 但是它总是将dhcp服务器绑定到所有接口:

 udp 0 0 192.168.101.1:53 0.0.0.0:* 0 7410711 22333/dnsmasq udp 0 0 0.0.0.0:67 0.0.0.0:* 0 7410708 22333/dnsmasq 

configuration:

 interface=wlan0 except-interface=lo except-interface=wlan0_0 no-dhcp-interface=wlan0_0 dhcp-range=interface:wlan0,192.168.101.2,192.168.101.255,60m bind-interfaces 

命令行: dnsmasq -C /etc/dnsmasq.wlan0.conf -z

在理论上许多选项应该是多余的,但实际上它仍然约束在0.0.0.0:67

你可以做一切你想要的一个实例。 这是一个基于我已经使用的configuration的例子。

 # DHPC ranges set tag dhcp-range=set:able,192.168.20.10,192.168.20.100,255.255.255.0,48h dhcp-range=set:baker,192.168.30.10,192.168.30.100,255.255.255.0,192h # Tag dependent options dhcp-option=able,3,192.168.20.1 # Router dhcp-option=able,15,able.example.com # Domain dhcp-option=baker,3,192.168.20.1 # Router dhcp-option=baker,15,baker.example.com # Domain # Common settings dhcp-option=6,192.168.20.2,192.168.30.2 # DNS servers dhcp-option=19,0 # Option ip-forwarding off dhcp-option=20,0 # Source routing off dhcp-option=27,1 # All sub-nets are local dhcp-option=31,0 # Router Discovery off dhcp-option-force=42,192.168.20.5 # NTP time servers dhcp-option=119,able.example.com,example.com # Search List 

这在手册页中有介绍。