Skip to content

WireGuard: importing a peer tunnel overwrites an existing tunnel #1915

Closed

Description

@gsanchietti

Adding or importing a WireGuard peer tunnel can overwrite an existing tunnel. This happens when a tunnel in the middle of the list was deleted before impoting.

Steps to reproduce

  • Open the WireGuard page, "Peer tunnels" tab
  • Add three peer tunnels: tunA, tunB, tunC. They get the names wg1, wg2 and wg3
  • Delete tunB (wg2) and apply the changes
  • Click "Import peer tunnel" and load any valid WireGuard configuration file. "Add peer tunnel" has the same problem

Expected behavior

The new tunnel gets a name that is not in use, like wg2 or wg4. tunC stays as it was.

Actual behavior

The new tunnel is saved as wg3, on top of tunC:

  • tunC's name, address and private key are replaced by the imported ones
  • tunC's old peer stays attached to wg3, so wg3 now has two peers: the old one and the imported one

The firewall picks the next tunnel name by counting the existing WireGuard interfaces, not by looking for a free name. Adding a WireGuard server is not affected, because it already checks for a free name.

Components

  • Image version: NethSecurity 8.8.0 (r33051-f5dae5ece4)
  • ns-api-3.7.3-r2

See also


Thanks to Turbond for the report and the analysis on the community.

Activity

  1. added theissue type on Sep 29, 2026
  2. changed the title [-]WireGuard: adding or importing a peer tunnel overwrites an existing tunnel[/-] [+]WireGuard: importing a peer tunnel overwrites an existing tunnel[/+] on Sep 29, 2026
  3. added this to the 8.8.1 milestone on Sep 29, 2026
  4. self-assigned this
    on Oct 6, 2026
  5. Tbaile commented on Oct 14, 2026

    @Tbaile
    Collaborator

    QA: check issue is not reproducible.

  6. added
    testingPackages are available from testing repositories
    on Oct 14, 2026
  7. moved this from In Progress 🛠 to Testing in NethSecurityon Oct 14, 2026
  8. self-assigned this
    on Oct 14, 2026
  9. gsanchietti commented on Oct 14, 2026

    @gsanchietti
    MemberAuthor

    Verified

  10. added
    verifiedAll test cases were verified successfully
    and removed
    testingPackages are available from testing repositories
    on Oct 14, 2026
  11. removed their assignment
    on Oct 14, 2026
  12. moved this from Testing to Verified in NethSecurityon Oct 14, 2026
  13. moved this from Verified to Done ✅ in NethSecurityon Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    verifiedAll test cases were verified successfully

    Type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions