Navod na zprovozneni Wireguard¶
1.Generovani klicu:¶
wg genkey | tee privatekey | wg pubkey > publickey
Verejny klic se predava spravci serveru (bezpecnym zpusobem), ten pridava verejny klic do ansible, rekonfiguruje wireguard server a prideluje statickou adresu. Dal se nastavuje klient.
2. Nastaveni pro systemd:¶
/etc/systemd/network/wg0.netdev
[NetDev]
Name=wg0
Kind=wireguard
Description=Piratsky WireGuard
[WireGuard]
PrivateKeyFile=/etc/systemd/network/wg0-private.key
[WireGuardPeer]
PublicKey=/DKOG7Gp8ymjLlqWFAaMxZK2kbZqOD9VbjVJ5PtZ2ng=
Endpoint=149.62.145.221:51194
PersistentKeepalive=20
AllowedIPs=10.42.22.0/24
AllowedIPs=10.42.0.0/22
AllowedIPs=10.42.4.0/24
/etc/systemd/network/wg0.network
[Match]
Name=wg0
[Network]
Address=STATICKA_ADRESA
DNS=10.42.1.2
DNS=10.42.2.2
Domains=~dc1.pirati.cz ~dc2.pirati.cz
[Route]
Gateway=10.42.22.1
Destination=10.42.0.0/22
[Route]
Gateway=10.42.22.1
Destination=10.42.4.0/24
3. nastaveni pro wg-quick¶
[Interface]
Address = STATICKA_ADRESA
DNS = 10.42.1.2,10.42.2.2
PrivateKey = XXXXXXXXXXXXXXX
[Peer]
PublicKey = /DKOG7Gp8ymjLlqWFAaMxZK2kbZqOD9VbjVJ5PtZ2ng=
AllowedIPs = 10.42.22.0/24,10.42.0.0/22,10.42.4.0/24
Endpoint = 149.62.145.221:51194
alternativni operacni systemy - https://www.wireguard.com/