complexorganizations / wireguard-manager

✔️ WireGuard-Manager is an innovative tool designed to streamline the deployment and management of WireGuard VPNs. Emphasizing user-friendliness and security, it simplifies the complexities of VPN configuration, offering a robust yet accessible solution for both personal and professional use.
Other
1.59k stars 203 forks source link

Error when ipv6 not enabled #379

Closed colemar closed 1 year ago

colemar commented 1 year ago

Ubuntu 22.04

root@clmr:~# wireguard-manager.sh --add
What do you want to do?
   1) Show WireGuard
...
   16) Check Configs
Let's name the WireGuard Peer. Use one word only, no special characters, no spaces.
New client peer:1b1e9ec5938156f7210d5762048bf5c6fbcd3777e026a29da4aa09c539a8e9887054c790c63ac6b574f0d2e311ea89995b2d
/usr/local/bin/wireguard-manager.sh: line 1219: [: 10.0.0.2: integer expression expected
/usr/local/bin/wireguard-manager.sh: line 1277: 10.0.0.2: syntax error: invalid arithmetic operator (error token is ".0.0.2")

Wireguard was already installed (apt install wireguard) with just one peer before wireguard-manager.sh first run. This is /etc/wireguard/wg0.conf

[Interface]
Address = 10.0.0.1/24
SaveConfig = true
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
ListenPort = 51820
PrivateKey = wOY[redacted]z3E=

[Peer]
PublicKey = 5a/JPM0bWg[redacted]+T+Qi3w4=
AllowedIPs = 10.0.0.2/32
Endpoint = 79.17.166.2:59936

IPv6 is disabled at the kernel startup time. Since line 1219 seems to deal with ipv6 addresses, I guess the culprit is that there are no ipv6 addresses in /etc/wireguard/wg0.conf.

Prajwal-Koirala commented 1 year ago

Hello, Everyone wants IPv6. Unless there are edge circumstances, all installations should have IPv6 enabled. Disabling IPv6 at the kernel level will stop all IPv6-related networking if you choose to deactivate it; In order to future-proof installations, it is structured in this manner; if a user decides they eventually want IPV6 but don't want it now, they just need to enable it on the kernel level.

Note: It is not advised to manually edit the WireGuard configuration.

colemar commented 1 year ago

If ipv6 is enabled at the kernel level but disabled (temporarily) at systemd level or by some other means, I guess there will be no ipv6 addresses in wireguard wg0 config file (if installed while ipv6 is disabled). There are still many providers (even server providers like Oneprovider) that do not support ipv6 in the local network, hence sometimes there is no point in keeping ipv6 enabled except to complicate network administration.

Prajwal-Koirala commented 1 year ago

Whether we like it or not, we will all soon be utilizing IPv6 since we ran out of IPv4 capacity.

Prajwal-Koirala commented 1 year ago

Additionally, I honestly have no idea why IPv6 is so despised; the developer adoption rate is atrocious. If we can impose Ipv6 at the code level without the user having to worry about it in the background, it would be the best choice for the future of the web.