Platí pro: LifeinCloud Cloud VPS • Ubuntu 22.04 LTS
Přehled
WireGuard je rychlý a moderní VPN protokol, který je snadno konfigurovatelný. I když LifeinCloud nabízí WireGuard image na 1 kliknutí, zde je postup, jak jej nastavit ručně.
Požadavky
- LifeinCloud VPS s Ubuntu 22.04.
- Root SSH přístup.
Krok 1 — Aktualizujte VPS
ssh root@YOUR_SERVER_IP
apt update && apt upgrade -y
Krok 2 — Nainstalujte WireGuard
apt install -y wireguard qrencode
Krok 3 — Vygenerujte klíče
umask 077
wg genkey | tee /etc/wireguard/privatekey | wg pubkey > /etc/wireguard/publickey
Krok 4 — Vytvořte konfigurační soubor
nano /etc/wireguard/wg0.conf
[Interface]
Address = 10.0.0.1/24
PrivateKey = (obsah souboru /etc/wireguard/privatekey)
ListenPort = 51820
SaveConfig = true
[Peer]
PublicKey = CLIENT_PUBLIC_KEY
AllowedIPs = 10.0.0.2/32
Krok 5 — Povolte a spusťte WireGuard
systemctl enable wg-quick@wg0
systemctl start wg-quick@wg0
Krok 6 — Pravidla firewallu
ufw allow 51820/udp
Poznámka: Abyste se vyhnuli ruční konfiguraci, nasaďte WireGuard VPN image na 1 kliknutí z ovládacího panelu LifeinCloud.