2020-12-24 14:27:31 +01:00
|
|
|
# Role Native Wireguard
|
2021-01-12 09:44:14 +01:00
|
|
|
Manages wireguard on host.
|
2020-12-24 14:27:31 +01:00
|
|
|
|
2021-01-12 09:44:14 +01:00
|
|
|
## Client
|
2021-01-12 11:19:08 +01:00
|
|
|
### Setup wireguard
|
|
|
|
```bash
|
|
|
|
pacman -S wireguard-tools
|
|
|
|
```
|
|
|
|
|
2021-01-12 09:44:14 +01:00
|
|
|
### Create Client Keys
|
|
|
|
```bash
|
|
|
|
wg_private_key="$(wg genkey)"
|
|
|
|
wg_public_key="$(echo "$wg_private_key" | wg pubkey)"
|
|
|
|
echo "PrivateKey: $wg_private_key"
|
|
|
|
echo "PublicKey: $wg_public_key"
|
|
|
|
echo "PresharedKey: $(wg genpsk)"
|
|
|
|
```
|
2020-12-24 14:27:31 +01:00
|
|
|
|
2021-01-12 09:44:14 +01:00
|
|
|
### Activate Configuration
|
|
|
|
```bash
|
|
|
|
cp /path/to/wg0.conf /etc/wireguard/wg0.conf
|
2024-01-10 11:18:38 +01:00
|
|
|
systemctl enable wg-quick@wg0.cymais.service --now
|
2021-01-12 09:44:14 +01:00
|
|
|
```
|
|
|
|
|
2021-01-12 11:19:08 +01:00
|
|
|
### Check status
|
|
|
|
```bash
|
2024-01-10 11:18:38 +01:00
|
|
|
systemctl status wg-quick@wg0.cymais.service
|
2021-01-12 11:19:08 +01:00
|
|
|
```
|
|
|
|
|
2021-01-12 09:44:14 +01:00
|
|
|
## See
|
|
|
|
- https://golb.hplar.ch/2019/01/expose-server-vpn.html
|
|
|
|
- https://wiki.archlinux.org/index.php/WireGuard
|
|
|
|
- https://wireguard.how/server/raspbian/
|
2021-01-12 11:19:08 +01:00
|
|
|
- https://www.scaleuptech.com/de/blog/was-ist-und-wie-funktioniert-subnetting/
|