openwisp / openwisp/openwisp-controller

[bug] Wireguard template auto tunnel provisioning breaks using IPV6

Open
#721 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
773
Forks
315
Avg merge
2d 16h
Merged PRs (30d)
14

Description

Setting up a Wireguard VPN and using an IPV6 network from OW IPAM works well.

When you then configure the client template to be able to associate client routers to the IPV6 VPN it doesn't work out.

What happens:

After going through the steps here: https://openwisp.io/docs/user/wireguard.html#create-vpn-client-template-for-wireguard-vpn-server

On step six after clicking on save and continue the template is populated with IPV4 instead of IPV6.

Screenshot from 2022-11-23 12-41-10

If you change the setting to IPV6 the address field is zeroed out and if you put the same thing back in that field that was there before changing to IPV6 you get an error after clicking save.

Invalid configuration triggered by "#/interfaces/0", validator says:

{'type': 'wireguard', 'private_key': '{{pvt_key_6fdfa88ac4e546c89c5cf8df22a1a0f1}}', 'port': 51820, 'mtu': 1420, 'nohostroute': False, 'fwmark': '', 'ip6prefix': [], 'addresses': [{'proto': 'static', 'family': 'ipv6', 'address': '{{ip_address_6fdfa88ac4e546c89c5cf8df22a1a0f1}}', 'mask': 128}], 'name': 'wg0', 'network': ''} is not valid under any of the given schemas

Expected behavior is that Autoconfigure should determine that the IPAM is IPV6 not IPV4 and accept the replacement var as is.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the WireGuard client-template flow described in the linked documentation, especially step six and the Autoconfigure behavior. Reproduce the IPv6 IPAM setup, trace why the template is populated with IPv4 and why the IPv6 replacement variable fails validation, and confirm that Autoconfigure accepts the IPv6 configuration without the reported schema error.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.