Aplica-se a: LifeinCloud Cloud VPS • Ubuntu 22.04 LTS

Visão geral

O WireGuard é um protocolo VPN rápido e moderno que é simples de configurar. A LifeinCloud oferece uma imagem WireGuard com 1 clique, mas aqui está como configurá-lo manualmente.

Requisitos

  • VPS LifeinCloud executando Ubuntu 22.04.
  • Acesso root via SSH.

Passo 1 — Atualizar o VPS

ssh root@SEU_SERVIDOR_IP
apt update && apt upgrade -y

Passo 2 — Instalar o WireGuard

apt install -y wireguard qrencode

Passo 3 — Gerar chaves

umask 077
wg genkey | tee /etc/wireguard/privatekey | wg pubkey > /etc/wireguard/publickey

Passo 4 — Criar arquivo de configuração

nano /etc/wireguard/wg0.conf
[Interface]
Address = 10.0.0.1/24
PrivateKey = (conteúdo de /etc/wireguard/privatekey)
ListenPort = 51820
SaveConfig = true

[Peer]
PublicKey = CLIENT_PUBLIC_KEY
AllowedIPs = 10.0.0.2/32

Passo 5 — Ativar e iniciar o WireGuard

systemctl enable wg-quick@wg0
systemctl start wg-quick@wg0

Passo 6 — Regras de firewall

ufw allow 51820/udp
Nota: Para evitar a configuração manual, implante a imagem WireGuard VPN com 1 clique pelo painel da LifeinCloud.
Esta resposta lhe foi útil? 0 Usuários acharam útil (0 Votos)