I have configured my Rpi3 as an ethernet router. Rpi3 is running on Stretch Raspbian OS.


server= # Forward DNS requests to Google DNS
domain-needed # Don't forward short names

eth1 static ip is defined in dhcpcd.conf file

interface eth1
static ip_address=
static routers=
static domain_name_servers=

But dnsmasq is failed to start at boot. Therefore i want to run dnsmasq manually using sudo service dnsmasq start after that Rpi work as ethernet router.

What will be the cause which prevent dnsmasq from start?

Please help me

2 Answers 2


This might be because dnsmasq is attempting to bind to the socket before it becomes available.

To verify, run systemctl status dnsmasq -l. Possible error messages:

dnsmasq: failed to create listening socket for : Cannot assign requested address dnsmasq: unknown interface eth1

Solution 1a (easy): Do not use bind-interfaces

# Comment out this line

Solution 1b (easy): Do not listen on specific address/interface

# Comment out these lines

Solution 2 (harder): Find a way to start dnsmasq only after the network is ready

  • I am very interested in any information you can provide regarding "Solution 2". Looking at /etc/systemd/system/multi-user.target.wants/dnsmasq.service suggests that it runs after the network is up, but in my case I am trying to use it with hostapd which I think doesn't come up until later.
    – jacobq
    Commented Apr 26, 2018 at 18:02
  • What if we comment the line bind-interfaces only?
    – vishnu m c
    Commented Mar 7, 2019 at 12:15
  • @vishnu m c If the failure comes from trying to listen on an address before your network is up, then solely removing bind-interfaces wouldn't work Commented Mar 7, 2019 at 12:32
  • But commenting bind-interface worked for me. Then what will be the reason for the error?
    – vishnu m c
    Commented Mar 8, 2019 at 3:36
  • @akgren_soar Could you please tell me? How it happens? Its worked for me by just commenting the line bind-interfaces
    – vishnu m c
    Commented Mar 11, 2019 at 5:17

I have made a wifi-ethernet bridge on Raspbian stretch. The trick for me was following the tips from SurferTim on this rasbperrypi forum post with a similar question to yours: https://www.raspberrypi.org/forums/viewtopic.php?t=192377

Anyhow, using those guidelines that worked for me and others, here is what I would do:




interface eth1
static ip_address=



ip rules

sudo iptables -t nat -A  POSTROUTING -o wlan0 -j MASQUERADE

sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"

SurferTim says to sudo nano /etc/rc.local but I added here /lib/dhcpcd/dhcpcd-hooks/70-ipv4-nat => use a text editor

iptables-restore < /etc/iptables.ipv4.nat

In order to use normal interface names on boot edit /boot/config.txt


Or...(achieves same as above) in /etc/udev/rules.d/70-persistent-net.rules

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", 
ATTR{address}=="b8:ac:6f:65:31:e5", ATTR{dev_id}=="0x0", 
ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Do a reboot

sudo reboot

This worked for me and is the Raspbian stretch way to do things from what I understand. The raspberry pi forums are your friend :-) Happy Linuxing!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.