WireGuard: Difference between revisions

m Client setup: caveat wireguard private key ownership
m I was simply incorrect in my permissions command. I do not know how to configure private key file correctly in NixOS 24.05.
Line 18: Line 18:
Alternatively, you can use <tt>networking.wireguard.interfaces.[name].generatePrivateKeyFile</tt> option.
Alternatively, you can use <tt>networking.wireguard.interfaces.[name].generatePrivateKeyFile</tt> option.


If you decide to use files for storing your private keys and also use networkd, you'll need to modify the private key file permissions. For example, the following command configures the correct ownership of <code>/run/keys/my-wireguard.key</code><syntaxhighlight lang="bash">
If you decide to use files for storing your private keys and also use networkd, you'll need to modify the private key file permissions.
sudo chown systemd-network:systemd-network /run/keys/my-wireguard.key
 
</syntaxhighlight>
==== Troubleshooting Private Key File Resources ====
 
* https://discourse.nixos.org/t/wg0-failed-to-read-private-key/31461/8


===Server setup===
===Server setup===