Hey deHakkelaar,
Thanks for the response. I didn't know that pihole was using dhcpcd5 as a dhcp client. If that's the case, what I would rather do would be to remove dhcpcd5 instead apt-get remove --purge dhcpcd5
, and let the old school network manager handle dhcp client duties.
A little bit of background, the bridge is for VMs running on QEMU/KVM. When one comes up, it's automatically added to the bridge.
Here's an updated interfaces
file:
# The loopback network interface
auto lo
iface lo inet loopback
# The eth0 interface
iface eth0 inet manual
# The primary network interface
auto virbr0
iface virbr0 inet dhcp
bridge_ports eth0
bridge_stp off
bridge_maxwait 0
bridge_fd 0
Here's the output of ifconfig for relevant interfaces:
eth0 Link encap:Ethernet HWaddr d4:3d:7e:9e:9d:e2
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7146 errors:0 dropped:0 overruns:0 frame:0
TX packets:5408 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1004296 (1.0 MB) TX bytes:696453 (696.4 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1097 errors:0 dropped:0 overruns:0 frame:0
TX packets:1097 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:83246 (83.2 KB) TX bytes:83246 (83.2 KB)
virbr0 Link encap:Ethernet HWaddr d4:3d:7e:9e:9d:e2
inet addr:192.168.0.201 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: 2606:6000:cd41:5d00:a14a:b1ff:e129:cb63/64 Scope:Global
inet6 addr: 2606:6000:cd41:5d00:d63d:7eff:fe9e:9de2/64 Scope:Global
inet6 addr: fe80::d63d:7eff:fe9e:9de2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6937 errors:0 dropped:0 overruns:0 frame:0
TX packets:5408 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:852990 (852.9 KB) TX bytes:696453 (696.4 KB)
And Pihole is still failing to resolve.
https://tricorder.pi-hole.net/l6afmoa0a5
However.
If I install Pihole on eth0 instead of virbr0, DNS resolution works the first time after install. After a reboot, it no longer works. Here's the ifconfig output after reboot.
eth0 Link encap:Ethernet HWaddr d4:3d:7e:9e:9d:e2
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:334 errors:0 dropped:0 overruns:0 frame:0
TX packets:272 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:46977 (46.9 KB) TX bytes:36266 (36.2 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:587 errors:0 dropped:0 overruns:0 frame:0
TX packets:587 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:45963 (45.9 KB) TX bytes:45963 (45.9 KB)
virbr0 Link encap:Ethernet HWaddr d4:3d:7e:9e:9d:e2
inet addr:192.168.0.201 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: 2606:6000:cd41:5d00:e896:ffb:91a6:f0cf/64 Scope:Global
inet6 addr: 2606:6000:cd41:5d00:d63d:7eff:fe9e:9de2/64 Scope:Global
inet6 addr: fe80::d63d:7eff:fe9e:9de2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:334 errors:0 dropped:0 overruns:0 frame:0
TX packets:272 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:42217 (42.2 KB) TX bytes:36266 (36.2 KB)
user@server:~$ sudo pihole status
[ā] DNS service is NOT running
Now I run dhclient eth0
and get an IP address for eth0 (201 as reserved by my router), and run pihole restartdns
. It works!
Okay, so it looks like the issue is maybe that eth0 should be configured by dhcp at boot? After all, that's what I'm doing manually with dhcp client eth0
, right?
So I change my /etc/network/interfaces file to:
# The loopback network interface
auto lo
iface lo inet loopback
# The eth0 interface
auto eth0
iface eth0 inet dhcp
# The primary network interface
auto virbr0
iface virbr0 inet dhcp
bridge_ports eth0
bridge_stp off
bridge_maxwait 0
bridge_fd 0
and reboot.
However, now I can't ping or ssh into my server. Is it because both eth0 and virbr0 are getting the same dhcp config as eachother, and they're on a bridge, so there's contention?
If I run a dhclient eth0
followed by pihole restartdns
once again, everything works. Am I supposed to install pihole on the eth0 interface instead of the bridge? What networking options am I screwing up to get this to work at boot?