angristan / wireguard-install

WireGuard VPN installer for Linux servers
https://stanislas.blog/2019/01/how-to-setup-vpn-server-wireguard-nat-ipv6/
MIT License
8.02k stars 1.31k forks source link

Max 255 peers, --add option can add 10.8.0.256/32 and 10.8.0.257/32 peer and service restart fail #191

Closed iqdoctor closed 3 years ago

iqdoctor commented 3 years ago

bad ip

[Peer] ... AllowedIPs = 10.8.0.256/32,fd42:42:42::256/128

[Peer] AllowedIPs = 10.8.0.257/32,fd42:42:42::257/128

Feb 16 18:15:23 4172-autoinstall systemd[1]: Starting WireGuard via wg-quick(8) for wg0... Feb 16 18:15:23 4172-autoinstall wg-quick[166020]: [#] ip link add wg0 type wireguard Feb 16 18:15:23 4172-autoinstall wg-quick[166020]: [#] wg setconf wg0 /dev/fd/63 Feb 16 18:15:23 4172-autoinstall wg-quick[166042]: Unable to parse IP address: `10.8.0.256'

there is no counter control, or int to ip conversion https://stackoverflow.com/questions/10768160/ip-address-converter

angristan commented 3 years ago

I guess this check doesn't work?

https://github.com/angristan/wireguard-install/blob/21b5e56eea117ae0c509591a5fa1c9d79b37f383/wireguard-install.sh#L235-L246

angristan commented 3 years ago

Oh no, ok, you entered a wrong IP manually?

iqdoctor commented 3 years ago

sorry I mismatch project.

Real bug report https://github.com/complexorganizations/wireguard-manager/issues/84

please close this ticket