We have used
dnsmasq to set up a wifi to ethernet router on raspbian jessie. I have configured eth0 for static IP address using dhcpcd.conf file and it is given as follows.
interface eth0 static ip_address 192.168.42.1/24 static routers=192.168.42.1 static domain_name_servers=192.168.42.1
But this assigns IP address only when a device is attached to it. At the time of development, I didn't connect a device.
dnsmasq.conf file for the router look like as follows.
interface=eth0 listen-address=192.168.42.1 # Bind to the interface to make sure we aren't sending things # elsewhere bind-interfaces server=220.127.116.11 # Forward DNS requests to Google DNS domain-needed # Don't forward short names # Never forward addresses in the non-routed address spaces. bogus-priv # Assign IP addresses between 192.168.42.2 and 192.168.42.100 with a # 12 hours lease time dhcp-range=192.168.42.2,192.168.42.100,12h
Then I tried to start dnsmasq and it was a failure.
dnsmasq failed to start because the eth0 has no IP.
I have connected a device to eth0 port and again tried to start
dnsmasq and it worked now.
But on each reboot, I need to start the
dnsmasq manually. After the research on google, I found that commenting the line
bind-interfaces will help. So I commented the line and
dnsmasq start to work at boot.
According to the man page, I understand that it is used for multiple interfaces, isn't it?
Actually, I didn't know what
bind-interface do? How they affect my router? Can you anyone help me with examples to understand the usage of