Hello,
Thank you for your suggestions. Actually, I checked the network parameters multiple times. The modem and the RPI are on the same network. After a long day of debugging, I got to the point that I scrapped Debian and installed Ubuntu. I had to start over again.
This time, I'm betting on Docker again. I went through the steps that are provided in the official documentation.
Docker compose file:
version: "3"
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
hostname: pihole
ports:
- "53:53/tcp"
- "53:53/udp"
- "80:80/tcp"
environment:
TZ: 'America/Toronto'
WEBPASSWORD: '***'
DNSMASQ_LISTENING: 'all'
dns:
- 127.0.0.1
- 1.1.1.1
volumes:
- './etc-pihole:/etc/pihole'
- './etc-dnsmasq.d:/etc/dnsmasq.d'
cap_add:
- NET_ADMIN
restart: unless-stopped
Status report!
- Gravity update works. Blocking from within the RPI seems working. However, ad blocking does not work for any of my network devices.
List of clients:
Client |
Requests |
Frequency |
localhost |
507 |
|
172.18.0.1 |
114 |
|
pihole |
2 |
|
This is an excerpt of the container's network settings:
"Ports": {
"53/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "53"
},
{
"HostIp": "::",
"HostPort": "53"
}
],
"53/udp": [
{
"HostIp": "0.0.0.0",
"HostPort": "53"
},
{
"HostIp": "::",
"HostPort": "53"
}
],
"67/udp": null,
"80/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "80"
},
{
"HostIp": "::",
"HostPort": "80"
}
]
},
...
"Gateway": "172.21.0.1",
"IPAddress": "172.21.0.2",
"IPPrefixLen": 16,
Here's the token of the latest logs: E2wmKF8X
Here's some more information about my new set up:
PI Interfaces:
lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether
inet 192.168.2.100/24 brd 192.168.2.255 scope global dynamic noprefixroute eth0
valid_lft 254713sec preferred_lft 254713sec
inet6 fe80::f16b:4ae3:8b82:dff9/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether
inet 192.168.2.17/24 brd 192.168.2.255 scope global dynamic noprefixroute wlan0
valid_lft 254707sec preferred_lft 254707sec
inet6 fe80::68c2:5793:91f8:915c/64 scope link noprefixroute
valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
inet6 fe80::42:3ff:fe59:509f/64 scope link
valid_lft forever preferred_lft forever
18: br-3a7548a6bcb1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether
inet 172.21.0.1/16 brd 172.21.255.255 scope global br-3a7548a6bcb1
valid_lft forever preferred_lft forever
inet6 fe80::42:26ff:fe63:46f9/64 scope link
valid_lft forever preferred_lft forever
20: veth2f0f286@if19: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-3a7548a6bcb1 state UP group default
link/ether link-netnsid 0
inet6 fe80::a4dd:84ff:febe:eb1e/64 scope link
valid_lft forever preferred_lft forever
Modem DNS settings:
- Primary: x.y.z.100 (Pi/Pi-Hole on Docker on eth0)
- Secondary: 8.8.8.8
When I forced the secondary DNS to use Pi-Hole, no Internet! (as simple as that!)
Curiously, it is not possible to ping the gateway from RPI while it is possible to ping other devices on the network:
➜ RPI ping 192.168.2.1
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
From 192.168.2.100 icmp_seq=1 Destination Host Unreachable
From 192.168.2.100 icmp_seq=2 Destination Host Unreachable
^C
--- 192.168.2.1 ping statistics ---
5 packets transmitted, 0 received, +2 errors, 100% packet loss, time 4046ms
pipe 2
➜ RPI ping 192.168.2.11
PING 192.168.2.11 (192.168.2.11) 56(84) bytes of data.
64 bytes from 192.168.2.11: icmp_seq=1 ttl=64 time=3.51 ms
64 bytes from 192.168.2.11: icmp_seq=2 ttl=64 time=52.8 ms
^C
--- 192.168.2.11 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 3.506/28.136/52.766/24.630 ms
It is possible to ping the gateway and the RPI (eth0) from another device (laptop) on the same network:
➜ Laptop ping 192.168.2.1
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=4.90 ms
64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=2.86 ms
^C
--- 192.168.2.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 2.862/3.882/4.902/1.020 ms
➜ Laptop ping 192.168.2.100
PING 192.168.2.100 (192.168.2.100) 56(84) bytes of data.
64 bytes from 192.168.2.100: icmp_seq=1 ttl=64 time=5.12 ms
64 bytes from 192.168.2.100: icmp_seq=2 ttl=64 time=2.86 ms
64 bytes from 192.168.2.100: icmp_seq=3 ttl=64 time=2.77 ms
^C
--- 192.168.2.100 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 2.767/3.584/5.122/1.088 ms
Third observation, it is possible to ping an external domain name (e.g., www.google.com) from within the Docker container (pihole) but not the gateway.
➜ Hole docker exec -it pihole bash
root@pihole:/# ping 192.168.2.1
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
From 192.168.2.100 icmp_seq=1 Destination Host Unreachable
From 192.168.2.100 icmp_seq=2 Destination Host Unreachable
From 192.168.2.100 icmp_seq=3 Destination Host Unreachable
^C
--- 192.168.2.1 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4068ms
pipe 4
root@pihole:/# ping www.google.com
PING www.google.com (172.217.13.164) 56(84) bytes of data.
64 bytes from yul03s04-in-f4.1e100.net (172.217.13.164): icmp_seq=1 ttl=117 time=5.16 ms
64 bytes from yul03s04-in-f4.1e100.net (172.217.13.164): icmp_seq=2 ttl=117 time=4.26 ms
64 bytes from yul03s04-in-f4.1e100.net (172.217.13.164): icmp_seq=3 ttl=117 time=4.65 ms
^C
--- www.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 4.262/4.691/5.162/0.368 ms
root@pihole:/# nslookup www.google.com
Server: 127.0.0.11
Address: 127.0.0.11#53
Non-authoritative answer:
Name: www.google.com
Address: 172.217.13.164
Name: www.google.com
Address: 2607:f8b0:4020:805::2004
Last but not least:
- I replaced the network cable and used another port of the modem.
What am I missing here?