Skip to content

Instantly share code, notes, and snippets.

@divadsn
Last active July 6, 2023 16:13
Show Gist options
  • Save divadsn/e48a112018229fad601547559343b020 to your computer and use it in GitHub Desktop.
Save divadsn/e48a112018229fad601547559343b020 to your computer and use it in GitHub Desktop.
Run Pi-hole on your homelab using a dedicated IPv4 and IPv6 address through the macvlan network driver
version: "3.8"
services:
pihole:
image: pihole/pihole:latest
container_name: pihole
hostname: pihole
environment:
- TZ=Europe/Warsaw
- FTLCONF_LOCAL_IPV4=10.16.1.10 # change this to an IPv4 address in your home network, preferrably outside the DHCP range
- FTLCONF_LOCAL_IPV6=fd75:26fd:7019::10 # same as above or remove if you don't have IPv6
- DNSMASQ_LISTENING=local
- WEBPASSWORD_FILE=/run/secrets/webpassword
volumes:
- ./config/pihole:/etc/pihole
- ./config/dnsmasq.d:/etc/dnsmasq.d
secrets:
- webpassword
networks:
default:
ipv4_address: 10.16.1.10 # same as above
ipv6_address: fd75:26fd:7019::10 # same as above
restart: unless-stopped
secrets:
webpassword:
file: webpassword.txt
networks:
default:
enable_ipv6: true
driver: macvlan
driver_opts:
parent: eno1 # change this to the interface name your host is connected to the home network
ipam:
driver: default
config:
- subnet: 10.16.1.0/24 # change this to the subnet of your host's network
gateway: 10.16.1.1
- subnet: fd75:26fd:7019::/48 # same as above, preferrably a ULA prefix if your ISP is not giving a fixed
gateway: fd75:26fd:7019::1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment