Skip to content

fix(wireguard): use first free name for new peer tunnels - #1926

Merged
Tbaile merged 4 commits into
mainfrom
issue_1915
Oct 14, 2026
Merged

Tbaile merged 4 commits into
mainfrom
issue_1915

Conversation

@m-dilorenzi

Copy link
Copy Markdown
Collaborator

This PR fixes the WireGuard tunnel import issue that occurs when a tunnel in the middle of the list is deleted and a new one is imported, resulting in the configs of existing tunnels being overwritten.

  • add-tunnel and import-configuration now take the first free wgN name, as add-server already does. They return no_free_instance when all names are in use (max 100 tunnels are allowed).
  • get-instance-defaults suggests the first free name and the first free port starting from 51820.
  • The post-commit hook now restarts the right interface for wg10 and above. Before, it also restarted wg1.

Closes: #1915

@m-dilorenzi m-dilorenzi self-assigned this Oct 8, 2026
@m-dilorenzi
m-dilorenzi requested a review from Tbaile October 8, 2026 16:17
@Tbaile Tbaile removed this from NethSecurity Oct 13, 2026
@Tbaile
Tbaile merged commit c864100 into main Oct 14, 2026
3 checks passed
@Tbaile
Tbaile deleted the issue_1915 branch October 14, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WireGuard: importing a peer tunnel overwrites an existing tunnel

2 participants