mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-28 00:30:36 +01:00
Even if WireGuard is supported since long time in NetworkManager, it is still not possible to manage the list of peers via nmcli. The reason is that in the past we wanted to introduce a special syntax that would allow to manage the peer list more easily. However, this requires heavy changes to the nmcli output formatting code, and so it never happened. Since perfection is the enemy of good, abandon the idea of a custom handling of peers and treat them as any other composite property. The property is named "wireguard.peers" and exposes the peers indexed by public key, with optional attributes. Example: $ nmcli connection modify wg0 wireguard.peers "8Wgc1a0jJX3rQULwD5NFFLKrKQnbOnTiaNoerLneG1o= preshared-key=16uGwZvROnwyNGoW6Z3pvJB5GKbd6ncYROA/FFleLQA= allowed-ips=0.0.0.0/0 persistent-keepalive=10" $ nmcli connection modify wg0 +wireguard.peers "fd2NSxUjkaR/Jft15+gpXU13hKSyZLoe4cp+g+feBCc= allowed-ips=192.168.40.0/24 endpoint=172.25.10.1:8888" $ nmcli -g wireguard.peers connection show wg0 8Wgc1a0jJX3rQULwD5NFFLKrKQnbOnTiaNoerLneG1o= allowed-ips=0.0.0.0/0 persistent-keepalive=10, fd2NSxUjkaR/Jft15+gpXU13hKSyZLoe4cp+g+feBCc= allowed-ips=192.168.40.0/24 endpoint=172.25.10.1\:8888 $ nmcli connection modify wg0 -wireguard.peers 8Wgc1a0jJX3rQULwD5NFFLKrKQnbOnTiaNoerLneG1o= $ nmcli -g wireguard.peers connection show wg0 fd2NSxUjkaR/Jft15+gpXU13hKSyZLoe4cp+g+feBCc= allowed-ips=192.168.40.0/24 endpoint=172.25.10.1\:8888 |
||
|---|---|---|
| .. | ||
| tests | ||
| meson.build | ||
| nm-default-client.h | ||
| nm-libnm-aux.c | ||
| nm-libnm-aux.h | ||
| README.md | ||
libnm-client-aux-extern
libnm-client-aux-extern is a static library that:
- uses the public parts of "libnm"
- that can also be statically linked into other users of libnm.
Basically, it is a static library with utility functions that extends libnm.
That means:
- you can use it everywhere where you dynamically link with libnm.
Also, since libnm-client-aux-extern itself only uses public (stable) API of libnm, you theoretically can copy the sources into your own source tree.
This makes it very similar in purpose to ../libnmc-base/. The difference might be that this one is smaller and that you could easier copy+paste this to a libnm application outside this source tree.