From 5bb1e139f738631d23e77e77bc9b8dae5567bc18 Mon Sep 17 00:00:00 2001 From: cany748 <123sasha2@mail.ru> Date: Wed, 8 Jun 2022 23:06:04 +0700 Subject: [PATCH] Updated Using WireGuard Easy with Pi Hole (markdown) --- Using-WireGuard-Easy-with-Pi-Hole.md | 55 +++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/Using-WireGuard-Easy-with-Pi-Hole.md b/Using-WireGuard-Easy-with-Pi-Hole.md index c92a7ff..9035cf8 100644 --- a/Using-WireGuard-Easy-with-Pi-Hole.md +++ b/Using-WireGuard-Easy-with-Pi-Hole.md @@ -1,3 +1,54 @@ -Simply set the environment variable `WG_DEFAULT_DNS` to the IP address of your Pi-hole server, e.g. `192.168.0.2`. +Simply set the environment variable WG_DEFAULT_DNS to the IP address of your Pi-hole server, e.g. 192.168.0.2. -> TODO: A `docker-compose.yml` example of both servers. \ No newline at end of file +Example: +
+version: "3" +networks: + private_network: + ipam: + driver: default + config: + - subnet: 10.2.0.0/24 + +services: + wireguard: + depends_on: pihole + image: weejewel/wg-easy:latest + container_name: wireguard + cap_add: + - NET_ADMIN + - SYS_MODULE + environment: + - TZ=Asia/Barnaul # Change to your timezone + - PASSWORD=password + - WG_HOST=0.0.0.0 # Change to your server ip + - WG_DEFAULT_DNS=10.2.0.100 + volumes: + - ./wireguard:/etc/wireguard + ports: + - "51820:51820/udp" + - "51821:51821/tcp" + sysctls: + - net.ipv4.ip_forward=1 + - net.ipv4.conf.all.src_valid_mark=1 + restart: unless-stopped + networks: + private_network: + ipv4_address: 10.2.0.50 + + pihole: + container_name: pihole + image: pihole/pihole:latest + restart: unless-stopped + hostname: pihole + environment: + TZ: "Asia/Barnaul" # Change to your timezone + WEBPASSWORD: "password" + FTLCONF_REPLY_ADDR4: 10.2.0.100 + volumes: + - ./pihole/etc-pihole/:/etc/pihole/ + - ./pihole/etc-dnsmasq.d/:/etc/dnsmasq.d/ + networks: + private_network: + ipv4_address: 10.2.0.100 +\ No newline at end of file