Skip to content

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

Description

@nemesifier

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions