Skip to content

Fix: support WireGuard link-local remotes with ifindex specifier#596

Open
mvitale1989 wants to merge 2 commits into
canonical:mainfrom
mvitale1989:fix-scoped-address-support
Open

Fix: support WireGuard link-local remotes with ifindex specifier#596
mvitale1989 wants to merge 2 commits into
canonical:mainfrom
mvitale1989:fix-scoped-address-support

Conversation

@mvitale1989

@mvitale1989 mvitale1989 commented Jun 21, 2026

Copy link
Copy Markdown

Netplan currently rejects Wireguard link-local remotes, if they specify an interfaces index.
For instance, setting endpoint: "[fe80::5054:ff:fe75:5b1f%enp1s0]:51820" on a peer fails with the following error:

# netplan apply
/run/netplan/10-lexnet.yaml:33:19: Error in network definition: invalid endpoint address or hostname '[fe80::5054:ff:fe75:5b1f%enp1s0]:51820'
        endpoint: "[fe80::5054:ff:fe75:5b1f%enp1s0]:51820"
                  ^

This is a bug as these are valid IPv6 addresses, and wireguard itself accepts them without any issue:

# wg
interface: wg0
  public key: REDACTED
  private key: (hidden)
  listening port: 51820

peer: REDACTED
  endpoint: [fe80::5054:ff:fe75:5b1f%enp1s0]:51820
  allowed ips: ::/0, 0.0.0.0/0
  latest handshake: 22 seconds ago
  transfer: 360 B received, 280 B sent
  persistent keepalive: every 10 seconds

This PR introduces support for an arbitrary ifindex string, within a Wireguard remote endpoint specification.

I wasn't yet able to file this as a bug on Launchpad as I'm not receiving the e-mail verification to create an account, but I'm opening the PR already as I had the fix ready.

Checklist

  • Runs make check successfully.
  • Retains code coverage (make check-coverage). (the new lines are covered)
  • New/changed keys in YAML format are documented. (no YAML format changes)

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.

1 participant