noamanahmed / wireguard-http-proxy

An HTTP Proxy which tunnels traffic over wire-guard
21 stars 9 forks source link

Tunnel not activating #5

Open kLeR1k opened 2 months ago

kLeR1k commented 2 months ago

Tunnel not activating in docker for some reason, please help to find the reason why? IPs and keys in quotas replaced with $.

Looks like the reason is, but cannot understand why

s6-rc: fatal: unable to take locks: No such file or directory

My wg0.conf file:

[Interface] Address = 10.8.$.$/$ DNS = 1.1.1.1, 1.0.0.1 PrivateKey = $=

[Peer] PublicKey = $= PresharedKey = $= AllowedIPs = 0.0.0.0/0, ::/0 Endpoint = 193.124.$.$:$ PersistentKeepalive = 25

Docker log:

2024-04-05 13:48:05 wireguard | Port 8888 2024-04-05 13:48:05 wireguard | Timeout 600 2024-04-05 13:48:05 wireguard | LogLevel Info 2024-04-05 13:48:05 wireguard | Syslog On 2024-04-05 13:48:05 wireguard | DisableViaHeader yes 2024-04-05 13:48:05 wireguard | #Added by start.sh. These will be overwridden 2024-04-05 13:48:05 wireguard | Listen 172.18.$.$ 2024-04-05 13:48:05 wireguard | Allow 172.18.$.$ 2024-04-05 13:48:05 wireguard | Allow 172.18.$.$ 2024-04-05 13:48:05 wireguard | Allow 127.0.0.1 2024-04-05 13:48:05 wireguard | Found WG conf /config/wg_confs/wg0.conf, adding to list 2024-04-05 13:48:05 wireguard | Activating tunnel /config/wg_confs/wg0.conf 2024-04-05 13:48:05 wireguard | Warning: `/config/wg_confs/wg0.conf' is world accessible 2024-04-05 13:48:05 wireguard | [#] ip link add wg0 type wireguard 2024-04-05 13:48:05 wireguard | [#] wg setconf wg0 /dev/fd/63 2024-04-05 13:48:05 wireguard | [#] ip -4 address add 10.8.$.$/$ dev wg0 2024-04-05 13:48:05 wireguard | [#] ip link set mtu 1420 up dev wg0 2024-04-05 13:48:05 wireguard | [#] resolvconf -a wg0 -m 0 -x 2024-04-05 13:48:05 wireguard | s6-rc: fatal: unable to take locks: No such file or directory 2024-04-05 13:48:05 wireguard | [#] wg set wg0 fwmark 51820 2024-04-05 13:48:05 wireguard | [#] ip -6 route add ::/0 dev wg0 table 51820 2024-04-05 13:48:05 wireguard | Error: IPv6 is disabled on nexthop device. 2024-04-05 13:48:05 wireguard | [#] resolvconf -d wg0 -f 2024-04-05 13:48:05 wireguard | s6-rc: fatal: unable to take locks: No such file or directory 2024-04-05 13:48:05 wireguard | [#] ip link delete dev wg0 2024-04-05 13:48:06 wireguard | Tunnel /config/wg_confs/wg0.conf failed, will stop all others! 2024-04-05 13:48:06 wireguard | * All tunnels are now down. Please fix the tunnel config /config/wg_confs/wg0.conf and restart the container

matorinvs commented 1 month ago

Try to add in docker-compose.yml

 cap_add:
       - SYS_MODULE
     volumes:
       - /lib/modules:/lib/modules

For WSL: you also can modify start.sh and add folowwing:

WG_QUICK_PATH="/usr/bin/wg-quick"
sed -i 's|\| cmd \$iptables-restore -n||g' "$WG_QUICK_PATH"