Files
2026-06-16 03:39:15 +02:00

37 lines
1.2 KiB
Plaintext

# /etc/wireguard/wg0.conf - VPS 1 (Hub Central / Gateway)
# IP Privado VPN: 10.99.0.1
[Interface]
Address = 10.99.0.1/24
PrivateKey = <Chave_Privada_VPS1_Omitida_Por_Seguranca>
ListenPort = 51820
# Habilitar forwarding de pacotes para comunicação entre peers (Estrela/Hub)
# Certifique-se de que net.ipv4.ip_forward = 1 está ativado no sysctl.conf
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
# ----------------------------------------------------
# PEERS AUTORIZADOS NA VPN (10.99.0.0/24)
# ----------------------------------------------------
# Peer 1: Notebook do Rui (Administrador)
[Peer]
PublicKey = <Chave_Publica_do_Notebook_do_Rui>
AllowedIPs = 10.99.0.10/32
# Peer 2: VPS 3 (Banco de Dados Dedicado)
[Peer]
PublicKey = S40JqovA4F8oH8aieWsDvNEv1yw5Juwu1wb4zHjQ8Ww=
AllowedIPs = 10.99.0.3/32
# Peer 3: VPS 4 (Desenvolvimento / Dev)
[Peer]
PublicKey = ln7phEfm4w//jZJqqlkGAjsXKWQnOw2kYc64ni5PXX0=
AllowedIPs = 10.99.0.4/32
# Peer 4: VPS 5 (CRM WhatsApp / newwhats)
[Peer]
PublicKey = <Chave_Publica_da_VPS_5_Omitida>
AllowedIPs = 10.99.0.5/32