I am trying to utilize a Raspberry Pi with Raspbian Stretch (Linux) so provide additional network monitoring and also routing capabilities. To this end I have the following setup:
Internet router [eth1]
||
[Raspberry Pi]
||
Wifi for clients [wlan0]
Ethernet for clients [eth0]
I have basically got everything working, except for assigning the DNS servers to the DHCP clients. I have been struggeling with this topic for many weeks now, followed dozens of guides on this site and others but regardless of whether I use dhcpd + dnsmasq, dnsmasq alone, bind or whatever: the DNS server is not assigned to the client. I also tried various operating systems on the clients: Windows, Ubuntu and Android, to make sure it isn't a setup problem there. But they work with all other LAN/Wifi networks and not with this setup, so it must be a problem with my configuration. The problem is the same for LAN and Wifi devices. Wifi is provided by hostapd, btw, and works.
My latest setup only utilizes dnsmasq. The clients that are thus assigned addresses via DHCP can
- Access intranet and internat IP addresses (ping, tracert, nmap)
- Reach the DNS server on my RPI (port open and reachable)
- Reach other clients in the network, and vice-versa
My dnsmasq.conf file:
bogus-priv
expand-hosts
dhcp-authoritative
no-resolv
interface=wlan0
interface=eth0
interface=lo
interface=eth1
dhcp-range=192.168.19.30,192.168.19.160,1h
bind-interfaces
dhcp-option=option:dns-server,0.0.0.0,192.168.19.1,192.168.19.2,192.168.178.20
dhcp-option=3,192.168.19.1
listen-address=127.0.0.1
listen-address=192.168.19.1
listen-address=192.168.19.2
listen-address=192.168.178.20
server=192.168.178.1
server=8.8.8.8
cache-size=1000
log-queries
domain="mydomain.biz"
Since the system is using systemd, I have also setup the files wlan0.network, eth0.network and eth1.network in /etc/systemd/network. eth1 assigns a fixed IP, for wlan0 and eth0 I have
[Match]
Name=eth0
[Network]
Address=192.168.19.2/24
DHCPServer=yes
and
[Match]
Name=wlan0
[Network]
Address=192.168.19.1/24
DHCPServer=yes
It also does not matter if I add something like "DNS=192.168.19.1" to the .network files... I really do not know what else I can do or what the problem might be. Thanks in advance!