Consider the following scenario: You want to connect a client to a server via Wireguard – the server’s IP address changes regularly. Further you want to contact the client from the server (so not the standard use-case) – you will also have to add a keep-alive to the client config.
The keep-alive is easy, just edit the client config and add “PersistentKeepalive = 25”:
cat /etc/wireguard/wg0.conf
To connect to an endpoint with a changing IP, this is documented in the Arch Linux wiki:
https://wiki.archlinux.org/title/WireGuard#Endpoint_with_changing_IP
You have to install wireguard-tools first to get all relevant config files to your machine.