我也是用的 wgeasy ,不懂详细的配置,就把 docker compose 文件给你参考一下吧
wg-easy:
environment:
- TZ=Asia/Shanghai
# Change Language:
- LANG=chs
# ⚠️ Required:
# Change this to your host's public address
- WG_HOST=
xxx.domain.com # Optional:
- PASSWORD_HASH=xxxxxxxxxxxxxx
- PORT=51821
- WG_PORT=51820
- WG_DEFAULT_ADDRESS=10.8.0.x
- WG_DEFAULT_DNS=114.114.114.114,223.5.5.5
- WG_MTU=1392
- WG_ALLOWED_IPS=192.168.3.0/24
- WG_PERSISTENT_KEEPALIVE=25
- UI_TRAFFIC_STATS=false
image:
ghcr.io/wg-easy/wg-easy:latest container_name: wg-easy
volumes:
- ./config:/etc/wireguard
ports:
- "51820:51820/udp"
- "51821:51821/tcp"
restart: always
cap_add:
- NET_ADMIN
- SYS_MODULE
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1