Como configuro o IPv6 via WireGuard?

Como configuro o IPv6 via WireGuard?

Aluguei um VDS para configurar o WireGuard VPN nele e distribuir todos os clientes VPN/64 sub-redes IPv6. Da hospedagem, obtive originalmente o endereço 2a0c:xxx:yyy::1/32. Aqui estão as configurações das interfaces de rede que eu configurei:

❯ ip a
2: wan0: <BROADCAST,MULTICAST,ALLMULTI,UP,LOWER_UP> mtu 1500 ...
    inet6 2a0c:xxx:yyy:1001::1/32 scope global
        valid_lft forever preferred_lft forever
    inet6 fe80::****:**:****:****/64 scope link
        valid_lft forever preferred_lft forever
3: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue ....
    inet 172.22.9.1/24 brd 172.22.9.255 scope global wg0
        valid_lft forever preferred_lft forever
    inet6 fd4d:56d8:31d4:2001::1/56 scope global
        valid_lft forever preferred_lft forever

❯ ip -6 r
::1 dev lo proto kernel metric 256 pref medium
2a0c:xxx:yyy:2000::/56 dev wg0 proto static metric 20 pref medium
2a0c:xxx::/32 dev wan0 proto kernel metric 256 pref medium
2a0c:xxx::/32 dev wan0 proto ra metric 1024 expires 2591851sec pref medium
fd4d:56d8:31d4:2000::/56 dev wg0 proto kernel metric 256 pref medium
fe80::/64 dev wan0 proto kernel metric 256 pref medium
default proto static metric 1024 pref medium
        nexthop via 2a0c:xxx::1 dev wan0 weight 1
        nexthop via fe80::****:****:****:**** dev wan0 weight 1

❯ sudo sysctl net.ipv6.conf.all.forwarding
net.ipv6.conf.all.forwarding = 1

❯ cat /etc/ndppd.conf
proxy wan0 {
    rule 2a0c:xxx:yyy:2000::/56 {
        static
    }
}

# --- check routing to dns.google from one of the VPN clients ---
❯ ip -6 r get to 2001:4860:4860::8844 from 2a0c:xxx:yyy:2005::****:*
2001:4860:4860::8844 from 2a0c:xxx:yyy:2005::****:* via fe80::****:****:****:**** dev wan0 proto ra src 2a0c:xxx:yyy:1001::1 metric 1024 mtu 1500 pref medium

Dou todos os clientes fd4d:56d8:31d4:20zz::/64e 2a0c:xxx:yyy:20zz::/64sub-redes VPN ( zzsão diferentes para cada cliente). Quando configurei pela primeira vez tudo funcionou e os clientes puderam acessar a Internet via IPv6. Porém, depois de reiniciar o VDS, essa configuração não funcionou mais.

Quando tentei executar ping em um cliente VPN com endereço 2a0c:xxx:yyyy:2005::****:*de outro host que não está conectado a uma VPN, recebi vários pacotes de solicitação de vizinhos ( who has 2a0c:xxx:yyy:2005::****:*) para wan0 do roteador upstream, aos quais o VDS responderia periodicamente com pacotes de anúncios de vizinhos. No entanto, a solicitação de eco para wan0 e wg0 nunca chegou.

O que há de errado com minha configuração? Por que o IPv6 sobre WireGuard para de funcionar após a reinicialização do VDS?

Desde já, obrigado.


99-wg0.netdev

[NetDev]
Name=wg0
Kind=wireguard

[WireGuard]
PrivateKey=kH9-----------------------86u/Uw=
ListenPort=1194

[WireGuardPeer]
PublicKey=oXPdkrbDL---------------oKLW2HEEM=
PresharedKey=L9P------------------------jSiM=
AllowedIPs=2a0c:xxx:yyy:2005::/64
AllowedIPs=172.22.9.5/32

99-wg0.rede:

[Match]
Name=wg0

[Network]
Address=172.22.9.1/24

[Route]
Destination=2a0c:xxx:yyy:2000::/56
Metric=20

informação relacionada