I know this is a non-standard setup and a multi-disciplinary request, but I'm trying to get my PiHole to serve DHCP addresses (and, after that's working, resolve / block DNS queries) on multiple subnets which are on multiple VLANs. My plan is:
✅ Establish virtual interface eth0.66 for VLAN on Pi
Installed VLAN package:
sudo apt-get instal vlan
Created virtual interface:
/etc/network/interfaces.d/vlans:
auto eth0.66
iface eth0.66 inet manual
vlan-raw-device eth0
Assigned addresses:
Appended /etc/dhcpcd.conf:
# VLAN interface definitions
interface eth0.66
static ip_address=192.168.66.2/24
static domain_name_servers=192.168.66.2
Previous tail of /etc/dhcpcd.conf:
#fallback static_eth0
interface eth0
static ip_address=192.168.28.2/24
static routers=192.168.28.1
static domain_name_servers=192.168.28.1
sudo service networking restart
sudo pihole restartdns
I can ping in and out of this interface fine.
Set DNSMASQ to serve original range to eth0
Set DNSMASQ to serve new range to eth0.66
Set DNSMASQ to resolve queries from VLAN
Set PiHole to display both subnet queries in dashboard
If I add the following to /etc/dnsmasq.d/09-custom.conf DNS and DHCP stops working on the eth0 interface and DHCP does not start on the eth0.66 interface:
#VLAN 66 dirty DHCP and DNS congig
#router
dhcp-option=eth0.66,3,192.168.66.1
#dns server
dhcp-option=eth0.66,6,192.168.66.2
#dhcp range
dhcp-range=eth0.66,192.168.66.10,192.169.66.200,255.255.255.0,24h
Question: I think this is because the default PiHole config in /etc/dnsmasq.d/02-pihole-dhcp.conf does not specify an interface?
###############################################################################
# DHCP SERVER CONFIG FILE AUTOMATICALLY POPULATED BY PI-HOLE WEB INTERFACE. #
# ANY CHANGES MADE TO THIS FILE WILL BE LOST ON CHANGE #
###############################################################################
dhcp-authoritative
dhcp-range=192.168.28.10,192.168.28.249,24h
dhcp-option=option:router,192.168.28.1
dhcp-leasefile=/etc/pihole/dhcp.leases
#quiet-dhcp
Have I done something wrong here? Is my theory about the default config not specifying an interface correct? If so, how do I resolve this? If not, any ideas why this isn't working?
Thank you.
Systems:
Ubiquity UniFi setup (USG, SW-8s, AP-Pros)
PiHole on Pi 3b, wired