
Estou tentando construir um túnel WireGuard em cadeia. No momento estou testando, mas estou preso.
Eu tenho dois servidores WireGuard, o primeiro está na Índia e o segundo está em Cingapura. Aqui está o que estou tentando.
Client < 10.26.26.0/24 > India < 10.26.27.0/24 > Singapore
Ponto de túnel IN: 10.26.26.20/32 Ponto de túnel SG: 10.26.27.20/32
Consegui implantar o WireGuard em ambos os servidores. E agora estou tentando estabelecer uma conexão entre Índia <> Cingapura criando uma nova interface tnl0. Sempre que eu estabeleço, isso me expulsa do SSH. Acredito que tenho que fazer algum tipo de firewall aqui. Aqui está a configuração do servidor. Interface do WG da Cadeia da Índia:
#Server:
[Interface]
Address = 10.26.26.1/24
ListenPort = 443
PrivateKey = YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
SaveConfig = true
## Firewall Rules
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
#PC-PEER:
[Peer]
Public Key = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AllowedIPs = 10.26.26.2/32
#Tnl-PEER:
[Peer]
PublicKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AllowedIPs = 10.26.26.20/32
Servidor de Singapura:
#Server:
[Interface]
Address = 10.26.27.1/24
ListenPort = 443
PrivateKey = YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
SaveConfig = true
## Firewall Rules
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
#Tnl-PEER:
[Peer]
PublicKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AllowedIPs = 10.26.27.20/32
Configuração do túnel Índia para Cingapura:
[Interface]
PrivateKey = YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
Address = 10.26.27.20/32
DNS = 1.1.1.1
[Peer]
PublicKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AllowedIPs = 10.26.27.0/24
Endpoint = 1.2.3.4:443
PersistentKeepalive = 21
Eu tentei seguir este guiahttps://www.ckn.io/blog/2017/12/28/wireguard-vpn-chained-setup/ Mas este é muito antigo e não funciona. Tentei replicar o máximo que pude, mas não tive sorte. Acredito que preciso adicionar algumas tabelas de roteamento no Tunnel Config para que isso me permita passar o tráfego do cliente para o servidor de Cingapura via Índia.