ngoduykhanh / wireguard-ui

Wireguard web interface
MIT License
3.77k stars 464 forks source link

Client config allowed IPs only processes the first entry #585

Open Lanthade opened 1 month ago

Lanthade commented 1 month ago

Wireguard UI App Version : v0.6.2 Git Commit : 99104e429557a4cd6bda4b0c2550a656cdfe9bb7 Git Ref : refs/tags/v0.6.2 Build Time : 05-22-2024 16:04:22 Git Repo : https://github.com/ngoduykhanh/wireguard-ui

Running on debian 12.

The client configuration allows for multiple address ranges to be entered in the Allowed IPs field. These are appropriately saved in the corresponding db/clients file. However, only the first address range is actually processed into the /etc/wireguard/wg0.conf file. I've tested with 1, 2, and 3 entries in this field. The Extra Allowed IPs does function with multiple ranges as expected.

If the Allowed IPs range is only supposed to take one entry then it needs to be updated to not allow additional entries. I would however suggest that it should allow multiple entries and the code to update the wg0.conf file should be fixed to properly enter those fields into the wg0.conf file. This is because the Allowed IPs entries show up in the clients overview and the Extra Allowed IPs do not. Having all the information in this heads-up view without having to edit the client configuration is beneficial.