donaldzou / WGDashboard

Simple dashboard for WireGuard VPN written in Python w/ Flask
Apache License 2.0
1.41k stars 207 forks source link

Peers with ip v4 #330

Open Fox-khb opened 3 weeks ago

Fox-khb commented 3 weeks ago

Describe The Problem After updating to v. 4.0.2 I can only add peers with IP v 6. Even if I manually enter IP v 4 it says “This IP is not available:”

OS Information:

DaanSelen commented 3 weeks ago

Can you perhaps output the contents of the corresponding wireguard configuration file (REMOVE THE KEYS and other sensitive details) and show a screenshot of the dashboard with the error?

Fox-khb commented 2 weeks ago

Hello. Here is the content of wg0.conf

[Interface]
Address = 10.66.66.1/24
Address = fd42:42:42::1/64
PostUp = iptables -I INPUT -p udp --dport 62770 -j ACCEPT
PostUp = iptables -I FORWARD -i eth0 -o wg0 -j ACCEPT
PostUp = iptables -I FORWARD -i wg0 -j ACCEPT
PostUp = iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostUp = ip6tables -I FORWARD -i wg0 -j ACCEPT
PostUp = ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D INPUT -p udp --dport 62770 -j ACCEPT
PostDown = iptables -D FORWARD -i eth0 -o wg0 -j ACCEPT
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT
PostDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
PostDown = ip6tables -D FORWARD -i wg0 -j ACCEPT
PostDown = ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
ListenPort = 62770
PrivateKey = IFHvaIUVbH7Y+U/QRuKLz=

2024-08-25 15 52 01

donaldzou commented 2 weeks ago

Ahh yes, I spotted the bug and will update the dashboard later today :)

donaldzou commented 2 weeks ago

Hi! Please try to run ./wgd.sh update see if you can add multiple IP now :)

Fox-khb commented 2 weeks ago

Hello. ./wgd.sh update didn't help. I solved the problem by creating a new configuration via WGDashboard specifying IP v4.

donaldzou commented 2 weeks ago

Ahh i see why.. You could adjust your configuration from:

[Interface]
Address = 10.66.66.1/24
Address = fd42:42:42::1/64
...

to

[Interface]
Address = 10.66.66.1/24, fd42:42:42::1/64
...

and this should be good :)