before own config-files in /etc/dnsmasq.d get loaded, this folder have to be activated in /etc/dnsmasq.conf by removing the sharp (#) on beginning of the following line
The Interface-config is separated in my setup to /etc/dnsmasq.d/interfaces.conf. In this file interfaces and their Settings are defined.
which Interfaces should respond to DHCP-Requests (binding)?
interface=lan0 interface=wlan1 #interface=tun0 interface=lxcbr0 interface=ap0
which interfaces send no DHCP-answer?
the settings for DHCP:
dhcp-range=lan0,192.168.0.100,192.168.0.150,255.255.255.0,48h dhcp-option=lan0,3,192.168.0.10 dhcp-range=ap0,192.168.10.100,192.168.10.150,255.255.255.0,48h dhcp-option=ap0,3,192.168.10.1 dhcp-range=wlan1,192.168.11.100,192.168.11.150,255.255.255.0,48h dhcp-option=wlan1,3,192.168.11.1 dhcp-range=lxcbr0,10.0.3.100,10.0.3.150,255.255.255.0,48h dhcp-option=lxcbr0,3,10.0.3.1
Per client dns setting:
Add set option to host between mac and ip (after name)
And set dns-servers for that name
DNSMASQ can answer a DHCP-Request from a specific MAC-address always with same IP-address. For that i have also created a separate config-file (/etc/dnsmasq.d/mac.conf).
an Entry for that looks like this:
MAC-Address of the Client, a name, the desired IP-Address and last param is the Lease-time (how long lasts the DHCP-answer ⇒ renew of IP needed)
on wifi i have the problem, that i have 2 WIFI-APs (with different IPv4-Subnet) running on R2 and on both the same MAC-addresses can send a query. here the entry can contain the interface:
# service dnsmasq stop Stopping DNS forwarder and DHCP server: dnsmasq. # nano /var/lib/misc/dnsmasq.leases # service dnsmasq start Starting DNS forwarder and DHCP server: dnsmasq.