2023-03-02 16:00:19 +03:00
|
|
|
# WireGuard
|
|
|
|
|
2024-08-27 23:49:14 +03:00
|
|
|
## Generate key pair
|
2023-03-02 16:00:19 +03:00
|
|
|
|
|
|
|
```sh
|
|
|
|
umask 077
|
|
|
|
wg genkey > ./private
|
|
|
|
wg pubkey < ./private > ./public
|
|
|
|
```
|
|
|
|
|
2024-08-27 23:49:14 +03:00
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
|
|
Then create QR code with configuration using the following command:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
nix build -f ./misc/wg-client-conf.nix \
|
|
|
|
--argstr address "" \
|
|
|
|
--argstr dns "" \
|
|
|
|
--argstr privateKey "$(cat private)" \
|
|
|
|
--argstr serverPublicKey "" \
|
|
|
|
--argstr serverEndpoint ""
|
|
|
|
```
|
|
|
|
|
2023-03-02 16:00:19 +03:00
|
|
|
# References:
|
|
|
|
|
|
|
|
- https://nixos.wiki/wiki/WireGuard
|