I found out a flaw in the wireguard implementation:
|
if vpnclient.public_key: |
|
context['public_key'] = vpnclient.public_key |
|
if vpnclient.private_key: |
|
context['private_key'] = vpnclient.private_key |
The variables public_key and private_key will be overwritten if there are multiple wireguard tunnels on the same device, with the result that the first wireguard tunnels will not work (only the last applied template will work).
I think we have to do the following:
- make sure those variables get the UUID of the VPN server as their suffix, as all the other VPN related variables
- create a data migration to update the variables in the templates:
- look for all the currently existing VPN-client template which are related to a wireguard or wireguard/vxlan VPN
- replace
{{ public_key }} and {{public_key}} with {{ public_key_<UUID> }}, same for private_key. The UUID should be the UUID of the VPN server related to the VPN-client template
I found out a flaw in the wireguard implementation:
openwisp-controller/openwisp_controller/config/base/config.py
Lines 545 to 548 in 8b8de3c
The variables
public_keyandprivate_keywill be overwritten if there are multiple wireguard tunnels on the same device, with the result that the first wireguard tunnels will not work (only the last applied template will work).I think we have to do the following:
{{ public_key }}and{{public_key}}with{{ public_key_<UUID> }}, same for private_key. The UUID should be the UUID of the VPN server related to the VPN-client template