我如何configurationdnsmasq只在eth0分配地址,而不是wlan0 ?
手册页非常好地解释它。 如果只是DHCP,你不想在wlan0上运行,那么你可以使用--no-dhcp-interface=wlan0 。 如果你不想让dnsmasq在wlan0上听,那么你可以使用--except-interface=wlan0 。
如果你只想让dnsmasq监听eth0那么你可以使用--interface=eth0 。
这也可以从dnsmasqconfiguration文件中获得,并在http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq.conf.example中的Simon Kelley的示例文件中有logging。
# If you want dnsmasq to listen for DHCP and DNS requests only on # specified interfaces (and the loopback) give the name of the # interface (eg eth0) here. # Repeat the line for more than one interface. #interface= # Or you can specify which interface _not_ to listen on #except-interface=
对于那些喜欢我的人来说,为什么53端口对所有的接口都是开放的,不pipe你select哪个选项来限制它。 还有一个选项需要打开。
-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.