Back to Browse

Pi-hole in docker container on separate VLAN

1.0K views
Sep 23, 2025
13:49

I have a powerful Raspberry Pi 5 running, so now Pi-hole is running on Docker as a container on that RPI5. And I am running that Pi-hole container using Docker IPVLAN network driver in another (802.1q) VLAN, so I still can intercept and redirect all DNS requests properly to the Pi-hole. DNS redirect done properly: - https://www.vikash.nl/redirect-all-dns-requests-with-pfsense-to-pi-hole-or-adguard-home/ Commands used in this video are below, and CHANGE THE PARAMETERS to reflect your system and network: - add an interface with VLAN tagging: ip link add link eth0 name eth0.150 type vlan id 150 - enable the interface ip link set eth0.150 up Create docker network with IPVLAN: docker network create -d ipvlan \ --subnet=192.168.150.0/24 \ --gateway=192.168.150.1 \ -o parent=eth0.150 -o ipvlan_mode=l2 ipvlan_150 Run a simple alpine Linux container to test: docker run \ -it --net ipvlan_150 \ --ip 192.168.150.69 \ --name test1 \ -v alpine:/data alpine /bin/sh Docker compose to get you started: services: pihole: container_name: pihole image: pihole/pihole:latest hostname: pihole ports: - "53:53/tcp" - "53:53/udp" - "67:67/udp" - "80:80/tcp" - "443:443/tcp" environment: TZ: 'Europe/Amsterdam' FTLCONF_dns_listeningMode: all volumes: - '/home/vikash/pihole:/etc/pihole' cap_add: - NET_ADMIN restart: unless-stopped

Download

1 formats

Video Formats

360pmp421.8 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Pi-hole in docker container on separate VLAN | NatokHD