Pi-hole & cloudfared & docker

I am trying to follow the guide "Pi-hole and cloudfared with Docker", but for some reaseon it didn't work.

My network is a classic 192.168.1.0/24, router is at 192.168.1.1.

First I created the network:

$ sudo docker network create -d macvlan --subnet=192.168.1.0/24 --gateway=192.168.1.1 -o parent=ens192 priv_lan

Then I ran docker-compose:

$ sudo docker-compose -f docker-compose.yml -p pihole up

docker-compose.yml content:

https://0x0.st/--9O.yml

I just changed password & config location to current dir & ipv4_address to 192.168.1.10.

Docker log:

https://0x0.st/--9V.log

I don't see any error, both cloudfared & pihole containers are running.

When I ping or ask for resolve a dns:

$ ping 192.168.1.10

PING 192.168.1.10 (192.168.1.10): 56 data bytes
Request timeout for icmp_seq 0
^C
--- 192.168.1.10 ping statistics ---
2 packets transmitted, 0 packets received, 100.0% packet loss
$ dig dsl.sk @192.168.1.10
; <<>> DiG 9.10.6 <<>> dsl.sk [@]192.168.1.10
;; global options: +cmd
;; connection timed out; no servers could be reached

I am not able to access 192.168.1.10 in any form.

If I understand good I should be able to access pi-hole at 192.168.1.10 and be able to resolve DNS with dig [@]192.168.1.10.

web@c.mroach.com would be the best to ask, that's the author of the guide you followed.

Here is my yaml that works well across various platforms Pi, Unbuntu, and Synology so far. You will have to make a lot of edits for the IP addresses and how your subnet along with other config items. I added some comments that may help. Also don't forget to provide and edit the DNScrypt proxy.toml file to your needs.

version: '2'

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    hostname: pihole                        # <-- Update
    domainname: yourdomainname              # <-- Update
    cap_add:
      - NET_ADMIN
    networks:
      pihole_network:
        ipv4_address: 192.168.10.x           # <-- Update Address of PiHole Server
    dns:
      - 1.1.1.1
      - 1.0.0.1
    ports:
      - 443/tcp
      - 53/tcp
      - 53/udp
      - 67/udp
      - 80/tcp
    environment:
      ADMIN_EMAIL: youremailaddress         # <-- Update
      TZ: America/Chicago                    # <-- Update to your TZ
      ServerIP: 192.168.x.x                  # <-- Update (match ipv4_address)
      WEBPASSWORD: anythingbutpassword       # <-- Add password (if required)
      VIRTUAL_HOST: pihole.yourdomainname    # <-- Update (match hostname + domainname)
      PIHOLE_DNS_: 192.168.10.x#53;192.168.10.x#53    # <-- Update (needs to point to DNScrypt proxy address
      WEBUIBOXEDLAYOUT: boxed                # for working on large screens
    volumes:
       - '/docker/dns/etc-pihole/:/etc/pihole/'
       - '/docker/dns/etc-dnsmasq.d/:/etc/dnsmasq.d/'
    restart: unless-stopped


  dnscrypt:
    container_name: dnscrypt-proxy
    image: gists/dnscrypt-proxy:latest
    hostname: dnscrypt
    domainname: yourdomainname             # <-- Update
    ports:
    - 53/udp
    - 53/tcp
    networks:
      pihole_network:
        ipv4_address: 192.168.10.x         # <-- Update Address of DNScrypt
    volumes:
    - '/docker/dns/dnscrypt-proxy/dnscrypt-proxy.toml:/etc/dnscrypt-proxy/dnscrypt-proxy.toml'
    restart: always




networks:
  pihole_network:
    driver: macvlan
    driver_opts:
      parent: eth0                         # <-- Update if not eth0
    ipam:
      config:
        - subnet: 192.168.10.0/24            # <-- Update if subnet different
          gateway: 192.168.10.252              # <-- Update if subnet different 
          ip_range: 192.168.10.x/32        # <-- Update Address of Pihole container

Thanks Ron. In meantime I get it working: promiscuous mode must be enabled in ESXI to make it work with macvlan.