-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Wireguard VPN support #86020
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
Wireguard VPN support #86020
Conversation
005e7bb to
01dba8d
Compare
|
01dba8d to
2fd6262
Compare
|
2fd6262 to
261c30f
Compare
|
|
The following west manifest projects have changed revision in this Pull Request:
✅ All manifest checks OK Note: This message is automatically posted and updated by the Manifest GitHub Action. |
261c30f to
fe241b0
Compare
|
fe241b0 to
456783b
Compare
|
456783b to
d7a004e
Compare
If the interface is Wireguard VPN interface, then print the public key of the interface. Signed-off-by: Jukka Rissanen <[email protected]>
Collect Wireguard VPN statistics and allow user to fetch it. Signed-off-by: Jukka Rissanen <[email protected]>
Show VPN statistics support if enabled. Signed-off-by: Jukka Rissanen <[email protected]>
The "net wg show 1" will show detailed information of the peer id 1. This is useful when debugging connectivity issues. Signed-off-by: Jukka Rissanen <[email protected]>
Send peer add/del network event when the peers is either added to the system or deleted from the system. Send VPN connected / disconnected event when a VPN connection is successfully established or the peer connection is disconnected. Signed-off-by: Jukka Rissanen <[email protected]>
Add Wireguard VPN events information printouts to event monitor. Signed-off-by: Jukka Rissanen <[email protected]>
Add support for getting public address and setting private key for the virtual interface. This is needed for Wireguard VPN. Signed-off-by: Jukka Rissanen <[email protected]>
Instead of calling various network interface API functions to get the network interface and related source IP address, have a single function that can return both data. Signed-off-by: Jukka Rissanen <[email protected]>
Add Wireguard configuration to echo-server application. Signed-off-by: Jukka Rissanen <[email protected]>
Add Wireguard configuration to echo-client application. Signed-off-by: Jukka Rissanen <[email protected]>
CONFIG_NET_MGMT_EVENT_INFO needs to be enabled for this sample so that we can get detailed information when the event is generated. Signed-off-by: Jukka Rissanen <[email protected]>
Add Wireguard configuration to http-server application. Signed-off-by: Jukka Rissanen <[email protected]>
Add a test that enables Wireguard VPN compilation so that we at least compile test the code. Signed-off-by: Jukka Rissanen <[email protected]>
Add example and information how to run VPN over a VLAN with the echo-server sample. Signed-off-by: Jukka Rissanen <[email protected]>
This is a hack that is used until we have proper IP routing in place. The code has now special check that makes sure that we only route IP packets to VPN interface when the packet is destined to that subnet. So if destination IP address does not belong to VPN interface subnet, it is not routed there. Signed-off-by: Jukka Rissanen <[email protected]>
Add WireGuard VPN licensing information to LICENSE.rst file in the documentation. Signed-off-by: Jukka Rissanen <[email protected]>
Allow user to provide a function that will need to get the current time from a RTC or SNTP or similar. Wireguard handshake replay prevention needs a monotonic time so the application should get it from somewhere. Signed-off-by: Jukka Rissanen <[email protected]>
If running wg in native-sim, use the host clock to get the current time. This helps to have a proper handshake when connecting even after restarting the zephyr.exe process. Signed-off-by: Jukka Rissanen <[email protected]>
b9647cb to
c2f2471
Compare
|
Yes, that was indeed good. Most of these algorithms are already available in the PSA / mbedTLS, the only one I saw that is definitely not there is blake2s. So why having duplicated functionality ?
Not necessarily, specially in cryptography. Some of these implementation state that they should not be used in production that they have alpha quality, which is very problematic at least.
For sure, we started conversation with mbedTLS / PSA folks regarding missing algorithm. Obviously since this involves another project the timeline can vary. Can we change it to use PSA for what is available and work together in a temporary solution for the missing bits ? We can't simply import another cryptography implementation to Zephyr that is not properly maintained. |
I did not want to have part of the code use PSA/mbedTLS and some part use the internal implementation. But I could consider porting the code to use the PSA and leave the blake implementation as is if that would be acceptable. |
|
Hi, as it might take some time before PSA has support for Wireguard needed crypto, I created an external module for the Wireguard support. This way people can try it more easily and give feedback to make it work better. The module can be found here https://github.com/jukkar/zephyr-wireguard. The module contain a demo of the usage and configuration with native_sim board. Note that you would need Zephyr version (4.1.99+), specifically from commit 8e90817 ("net: shell: iface: Print VPN public key") or later to use it. |
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
This is initial Wireguard VPN support. Part of the implementation is ported from wireguard-lwip project.
Some discussion about this can be found in #63722
Some of the commits in this PR might be sent separately to review.