docker-wireguard-vpn
docker-wireguard-vpn copied to clipboard
docker network is not being created
root@xxx:~# wireguard up
Error response from daemon: network docker-vpn0 not found
[ OK ] conf file exists
[ OK ] ip link add wg0 type wireguard
[ OK ] wg setconf wg0 /etc/wireguard/wg0.conf
[FAIL]
root@xxx:~# wireguard status
Error response from daemon: network docker-vpn0 not found
Error response from daemon: network docker-vpn0 not found
[INFO] Checking VPN Status:docker: Error response from daemon: network docker-vpn0 not found.
DOWN
root@xxx:~# wireguard down
Error response from daemon: network docker-vpn0 not found
[ OK ] ip link del wg0
[INFO] Route/Rule/Network Does Not Exist. Creating ...
[ OK ] ip rule add from table 200
[ OK ] ip route add blackhole default metric 3 table 200
Error response from daemon: network docker-vpn0 not found
[INFO] Checking VPN Status:docker: Error response from daemon: network docker-vpn0 not found.
DOWN
root@xxx:~#
Please try the updated script and report back. Are you running the script as root? If you are still having an issue, please run the following from a term window and let me know the output:
docker network create docker-vpn0 --subnet 10.30.0.0/16 -o com.docker.network.driver.mtu=1420
Thanks for the quick update, now wireguard status
gives me vpn link down warning (works as intended)
I'll update you in 4-5 hours if now everything is okay
Regular VPN seems to work now, but using Cloudflare WARP+ (which uses IPv6) gives me error:
/usr/local/bin/wireguard: line 129: 2606:4700:110:XXXXX:XXXX:XXXX:XXXX:XXXX: command not found
Regular VPN seems to work now, but using Cloudflare WARP+ (which uses IPv6) gives me error:
/usr/local/bin/wireguard: line 129: 2606:4700:110:XXXXX:XXXX:XXXX:XXXX:XXXX: command not found
I did not write this with IPv6 in mind ... the issue is the way the script grep's for the IP address from the wireguard conf file, at least for starters.
interface_ip=$(grep Address /etc/wireguard/$dev_name.conf | awk '{print $3}' | cut -d/ -f1)
This is looking for a IPv4 address and needs to be corrected for IPv6. The first part of the command grep's for the "Address" field. Then grab the 3rd column. Finally the "cut -d/ -f1" removes the net mask from the field and stores the IP address as "interface_ip".
What's the Address portion of your wg0.conf file look like? If you need to, randomize the IP numbers as I am only interested in the format.
Regular VPN seems to work now, but using Cloudflare WARP+ (which uses IPv6) gives me error:
/usr/local/bin/wireguard: line 129: 2606:4700:110:XXXXX:XXXX:XXXX:XXXX:XXXX: command not found
Also, I believe line 126: cmd="ip addr add $interface_ip dev $dev_name" would need to change to "cmd="ip -6 addr add $interface_ip dev $dev_name"