Skip to content

Instantly share code, notes, and snippets.

@aiexz
Created June 26, 2022 14:10
Show Gist options
  • Save aiexz/17bb15e1122ea69c5418a8d33df89034 to your computer and use it in GitHub Desktop.
Save aiexz/17bb15e1122ea69c5418a8d33df89034 to your computer and use it in GitHub Desktop.
docker-compose lan only wireguard
version: "3.8"
services:
wg-easy:
environment:
- WG_HOST=1.1.1.1
- PASSWORD=password
- WG_ALLOWED_IPS=10.8.0.0/24
- WG_POST_UP=iptables -I FORWARD -i %i -d 0.0.0.0/0 -j DROP && iptables -I FORWARD -i %i -d 10.8.0.0/24 -j ACCEPT
image: weejewel/wg-easy
container_name: wg-easy
volumes:
- ./:/etc/wireguard
ports:
- "51820:51820/udp"
- "51821:51821/tcp"
cap_add:
- NET_ADMIN
- SYS_MODULE
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment