Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Can't support multiple wireguard tunnels on the same devices #657

Closed
nemesifier opened this issue Jun 15, 2022 · 0 comments · Fixed by #666
Closed

[bug] Can't support multiple wireguard tunnels on the same devices #657

nemesifier opened this issue Jun 15, 2022 · 0 comments · Fixed by #666

Comments

@nemesifier
Copy link
Member

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
@nemesifier nemesifier added the bug label Jun 15, 2022
@nemesifier nemesifier added this to Backlog in OpenWISP Priorities for next releases via automation Jun 15, 2022
OpenWISP Priorities for next releases automation moved this from Backlog to Done Jun 24, 2022
@pandafy pandafy mentioned this issue Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant