On 2023-05-06, Odd Martin Baanrud <mar...@lb7ye.net> wrote: > I choosed the WireGuard-tools solution, because I understood how it works, > and it is easy to configure. > I’ve read a bit in the wg(4) manual, and I get confused of how things > actually works. > Is it possible to use wireguard-tools’s private/public key e.g? > If not, is the actual configuration using the included tools easy to do?
The configuration for wg looks like this: wgport port-number wgkey my-private-key inet 10.0.98.1/24 wgpeer peer-public-key wgaip 10.0.98.2/32 wgpsk peer2-pre-shared-key wgpeer peer2-public-key wgaip 10.0.98.3/32 wgpsk peer2-pre-shared-key etc The keys are 44 character long strings, base64 encoded. You can generate a suitable key with openssl rand -base64 32. To find the oublic key associated with a private key that has been set, use "ifconfig wg0" as root. It will be shown as wgpubkey and you can copy that to another system. I've never used wireguard-tools but I assume the keys will be in the correct format to use directly in the ifconfig line or hostname.wg0 file.