Skip to content

Instantly share code, notes, and snippets.

@LucasPlacentino
Created July 29, 2022 10:02
Show Gist options
  • Save LucasPlacentino/f6c1d1d58edb9c3a71a78bc31dd3e6cf to your computer and use it in GitHub Desktop.
Save LucasPlacentino/f6c1d1d58edb9c3a71a78bc31dd3e6cf to your computer and use it in GitHub Desktop.
wirehole
version: "3"
networks:
private_network:
ipam:
driver: default
config:
- subnet: 10.2.0.0/24
services:
unbound:
image: "mvance/unbound:latest" # for x86 arch
container_name: unbound
restart: unless-stopped # or "always"
hostname: "unbound"
volumes:
- "./unbound:/opt/unbound/etc/unbound/"
networks:
private_network:
ipv4_address: 10.2.0.200
wireguard:
depends_on: [unbound, pihole]
image: linuxserver/wireguard
container_name: wireguard
cap_add:
- NET_ADMIN
- SYS_MODULE
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Amsterdam # change this to your VM Timezone
- SERVERPORT=51820
#- SERVERURL=ddns.example.com #optional - For use with DDNS (Uncomment to use)
- PEERS=10 # How many peers to generate for you (clients)
- PEERDNS=10.2.0.100 # Set it to point to pihole
- INTERNAL_SUBNET=10.6.0.0
#- ALLOWEDIPS=10.2.0.0/24 # Split tunnel. Remove/comment if you want full tunnel (or put 0.0.0.0/0)
volumes:
- ./wireguard:/config
- /lib/modules:/lib/modules
ports:
- "51820:51820/udp"
dns:
- 10.2.0.100 # Points to pihole
- 10.2.0.200 # Points to unbound
sysctls:
- net.ipv4.conf.all.src_valid_mark=1
restart: unless-stopped # or "always"
networks:
private_network:
ipv4_address: 10.2.0.3
pihole:
depends_on: [unbound]
container_name: pihole
image: pihole/pihole:latest
restart: unless-stopped # or "always"
hostname: pihole
dns:
- 127.0.0.1
- 10.2.0.200 # Points to unbound
environment:
TZ: "Europe/Amsterdam" # change this to your VM Timezone
WEBPASSWORD: "" # Blank password - Can be whatever you want.
ServerIP: 10.2.0.100 # Internal IP of pihole
DNS1: 10.2.0.200 # Unbound IP
DNS2: 10.2.0.200 # If we don't specify two, it will auto pick google.
# Volumes store your data between container upgrades
volumes:
- "./etc-pihole/:/etc/pihole/"
- "./etc-dnsmasq.d/:/etc/dnsmasq.d/"
# Recommended but not required (DHCP needs NET_ADMIN)
# https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
cap_add:
- NET_ADMIN
networks:
private_network:
ipv4_address: 10.2.0.100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment