Merge pull request #2 from zhoreeq/wg-systemd-guide

Added wireguard+systemd-networkd connection guide
This commit is contained in:
Tristan B. Kildaire 2021-10-15 13:55:24 +02:00 committed by GitHub
commit d423d57f11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,61 @@
# How to connect to CRXN with wireguard and systemd-networkd
1) Generate the private key:
```
wg genkey | sudo tee /etc/systemd/network/crxn0-private.key
chmod 600 /etc/systemd/network/crxn0-private.key
```
2) Get the public key from it (you will need to send that to deavmi):
```
sudo cat /etc/systemd/network/crxn0-private.key | wg pubkey
```
3) Configure a new wireguard device:
```
sudo cat > /etc/systemd/network/crxn0.netdev <<EOF
[NetDev]
Name = crxn0
Kind = wireguard
Description = wg peering with crxn over yggdrasil
[WireGuard]
PrivateKeyFile = /etc/systemd/network/crxn0-private.key
ListenPort = 51820
[WireGuardPeer]
PublicKey = e0zNJwCyP+sD5oiF0QAkzrM3rJpmg1NeGxEHVCfBClM=
AllowedIPs = fd00::/8
Endpoint = [301:754:2ca2:57f8::1]:51820
EOF
```
4) Create the crxn network configuration file:
```
sudo cat > /etc/systemd/network/20-crxn0.network <<EOF
[Match]
Name=crxn0
[Network]
IPv6AcceptRA=false
[Address]
## Uncomment and change this to your IP address
# Address=fdf1:1dc1:f54d:0001::1/64 # CHANGE THIS !!!!
## Uncomment to route packets from another interface, ie eth0
# AddPrefixRoute=false
[Route]
Destination=fd00::/8
EOF
```
5) Restart the service to apply all settings:
```
sudo systemctl restart systemd-networkd
```