Skip to content

Add support for more configuration settings #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

francescolavra
Copy link

@francescolavra francescolavra commented Jun 15, 2025

These changes add a new WireGuard::begin() method, which allows specifying additional settings such as a DNS server and an MTU value, but does not add a remote peer for the WireGuard client; to add a peer after this begin() call, a WireGuard::addPeer() method is now defined, which (compared to the existing begin() methods) allows specifying additional settings such as a pre-shared key, a set of allowed IP addresses, and a keep-alive interval.

In addition:

  • the code has been updated to support Arduino core version 3,x, incorporating changes by @martinusGH and @pierrejay
  • a bug in WireGuard::end() has been fixed

Make the preshared_key struct field use the same encoding as the
public_key field, for ease of use.
This new begin() method allows specifying additional settings such
as a DNS server and an MTU value, but does not add a remote peer
for the WireGuard client; to add a peer after this begin() call,
define an addPeer() method, which (compared to the existing begin()
methods) allows specifying additional settings such as a pre-shared
key, a set of allowed IP addresses, and a keep-alive interval.
wireguardif_shutdown() frees the interface-private data associated
to the WireGuard network interface, so if there are any ongoing
connections on the WireGuard tunnel, when netif_remove() tries to
purge such connections it will cause a crash if
wireguardif_shutdown() has already been called.
@francescolavra francescolavra changed the title Add support for pre-shared keys Add support for more configuration settings Jun 28, 2025
This method returns whether the connection with the peer is
established, and allows retrieving the peer IP address.
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