Running pi-hole in Docker macvlan mode on Windows with no success

Hello, if anyone can help me with this it would be much appreciated - I've been bashing my head against this and no amount of Googling or experimentation is helping.

The issue I am facing:
I have a Windows 10 machine on my network which is up 24/7, which I would like to run pi-hole on.

I can run a simple pi-hole setup in Docker just fine - it starts and I can access the UI. However, my router (Virgin Super Hub 3), does not allow a custom DNS server to be configured - so I'm trying to also use pi-hole as the DHCP server, but with the default settings the DHCP broadcasts don't get propagated on my physical network.

To enable this, from what I understand, there are three options:

  1. Keep the Docker network in bridge mode, and run a DHCP relay on the host machine
  2. Run the Docker network in host mode
  3. Use a macvlan network

According to the Docker docs, host mode is only supported on Linux, and I haven't tried option 1 because I'm not certain where to find a suitable DHCP relay for Windows, so I'm trying to get option 3 working - the macvlan network.

I've tried to configure pi-hole to start in Docker with a macvlan network but no matter what I try, pi-hole fails to start properly, and displays the error:

DNS resolution is currently unavailable

See below for the full details of my setup.

Details about my system:

Operating system: Windows 10
Pi-hole: running in Docker

My network info:

The host machine's IP address: 192.168.0.10
The router's IP address: 192.168.0.1

Result of running ipconfig command on the host machine:

ipconfig
Windows IP Configuration

Unknown adapter Local Area Connection:
   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Ethernet:
   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::98a2:79eb:d879:b46e%16
   IPv4 Address. . . . . . . . . . . : 192.168.0.10
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.0.1

Ethernet adapter Ethernet 2:
   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter vEthernet (Default Switch):
   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::2989:48a0:26:5edf%22
   IPv4 Address. . . . . . . . . . . : 172.17.23.49
   Subnet Mask . . . . . . . . . . . : 255.255.255.240
   Default Gateway . . . . . . . . . :

My docker-compose.yml:

docker-compose.yml
version: '2'

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    hostname: pihole         
    mac_address: d0:ca:ab:cd:ef:02
    volumes:
       - './etc-pihole/:/etc/pihole/'
       - './etc-dnsmasq.d/:/etc/dnsmasq.d/'
    cap_add:
      - NET_ADMIN
    networks:
      pihole_network:
        ipv4_address: 192.168.0.199
    dns:
      - 127.0.0.1
      - 1.1.1.1
    ports:
      - 443:443/tcp
      - 53:53/tcp
      - 53:53/udp
      - 67:67/udp
      - 80:80/tcp
    environment:
      ServerIP: 192.168.0.199 
      DNS1: 127.0.0.1
      DNS2: 1.1.1.1
    restart: unless-stopped

networks:
  pihole_network:
    driver: macvlan
    driver_opts:
      parent: eth0.10
    ipam:
      config:
        - subnet: 192.168.0.0/24           
          gateway: 192.168.0.1             
          ip_range: 192.168.0.192/28

Here are some commands I ran to get the pihole network details:

 docker exec pihole ip addr show eth0
10: eth0@if8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether d0:ca:ab:cd:ef:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 192.168.0.199/24 brd 192.168.0.255 scope global eth0
       valid_lft forever preferred_lft forever
 docker exec pihole ip route
default via 192.168.0.1 dev eth0
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.199

I am unfamiliar with Docker for Windows and how WIndows would create sub-interfaces, so this is just a guess:
Is there a specific reason you are configuring a trunked bridge (per eth0.10) as opposed to a plain bridge macvlan (per eth0)?

Did you try just eth0?

Yes, it didn't work for eth0 either - although I do wonder if I'm using the correct value here. I couldn't work out what the value should be for a network interface on Windows though, if it isn't eth0.

The macvlan networking driver only works on Linux hosts, and is not supported on Docker Desktop for Mac, Docker Desktop for Windows, or Docker EE for Windows Server.

1 Like

Hello, Stygian

Macvlan is only supported on Linux hosts.

  • The macvlan networking driver only works on Linux hosts and is not supported on Docker Desktop for Mac, Docker Desktop for Windows, or Docker EE for Windows Server.

Follow official documentation:
Networking using a macvlan network - Docker Docs

1 Like

Hmm, well that would explain it. Thanks - I missed that in the docs.

I guess that leaves me the options of either finding a DHCP relay to get it working in bridge mode, or buying a Pi.

My Orbi router doesn't have DHCP replay, so I installed a Debian on an old laptop. I'm using Docker on Linux with some containers to other network services and it's running fine.

Funny that lack of Windows support is mentioned in the tutorials, but not in the main article at Macvlan network driver | Docker Docs.
Lack of hosts support is mentioned in both sections.

I know. I spent two days trying to configure macvlan on my MacOS until I founded this information and decided to reinstall my MacBook with Debian.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.