forked from DevOps/deploy.stack
fix(WireGuardVPN): 添加必要的内核模块和网络配置
添加/lib/modules只读挂载以支持WireGuard内核模块 增加IPv4和IPv6相关网络配置参数确保网络转发正常工作
This commit is contained in:
@@ -14,6 +14,7 @@ services:
|
||||
volumes:
|
||||
# [!] 关键:将容器内的WireGuard配置目录映射到主机
|
||||
- ${Volumes_Path}/data:/etc/wireguard
|
||||
- /lib/modules:/lib/modules:ro
|
||||
ports:
|
||||
# 将WireGuard的端口映射到主机(必须与你原来的端口一致,通常是51820)
|
||||
- "51820:51820/udp"
|
||||
@@ -24,5 +25,8 @@ services:
|
||||
- SYS_MODULE
|
||||
sysctls:
|
||||
- net.ipv4.ip_forward=1
|
||||
- net.ipv4.conf.all.src_valid_mark=1
|
||||
- net.ipv6.conf.all.disable_ipv6=0
|
||||
- net.ipv6.conf.all.forwarding=1
|
||||
- net.ipv6.conf.default.forwarding=1
|
||||
restart: unless-stopped
|
||||
|
||||
Reference in New Issue
Block a user