Хостер отдаёт мне /125 подсеть. Шлюз хостера находится в /48. Конфиг systemd-networkd на сервере (касающееся ipv6):
[Match]
Name=ens3
[Network]
Address=2a0c::120/48
Gateway=2a0c::1
Конфиг wireguard:
[Interface]
Address = 2a0c::121/125
ListenPort = 5000
MTU = 1500
PrivateKey = xx
[Peer]
PublicKey = xx
AllowedIPs = 2a0c::122/128
net.ipv6.conf.all.forwarding=1
В ip6tables всё открыто.
$ ip -6 r s
::1 dev lo proto kernel metric 256 pref medium
200::/7 dev ygg proto kernel metric 256 pref medium
2a0c::120/125 dev wg6 proto kernel metric 256 pref medium
2a0c::/48 dev ens3 proto kernel metric 256 pref medium
fe80::/64 dev ens3 proto kernel metric 256 pref medium
fe80::/64 dev ygg proto kernel metric 256 pref medium
default via 2a0c::1 dev ens3 proto static metric 1024 pref medium
$ ip -6 a
ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 2a0c::120/48 scope global
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fe2c:1d4b/64 scope link
valid_lft forever preferred_lft forever
wg6: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 state UNKNOWN qlen 1000
inet6 2a0c::121/125 scope global
valid_lft forever preferred_lft forever
Конфиг WG клиента:
[Interface]
Address = 2a0c::122/125
PrivateKey = xx
MTU = 1500
[Peer]
AllowedIPs = ::/0
Endpoint = xx
PersistentKeepalive = 21
PublicKey = xx
В ip6tables всё открыто.
$ ip -6 r s
::1 dev lo proto kernel metric 256 pref medium
200::/7 dev ygg proto kernel metric 256 pref medium
2a0c::120/125 dev wg6 proto kernel metric 256 pref medium
2000::/3 via 2a0c::121 dev wg6 metric 1024 pref medium
fe80::/64 dev ygg proto kernel metric 256 pref medium
fe80::/64 dev eno1 proto kernel metric 1024 pref medium
$ ip -6 a
wg6: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 state UNKNOWN qlen 1000
inet6 2a0c::122/125 scope global
valid_lft forever preferred_lft forever
$ ping -6 2a0c::121
64 bytes from 2a0c::121: icmp_seq=1 ttl=64 time=47.5 ms
$ ping -6 2a0c::120
64 bytes from 2a0c::121: icmp_seq=1 ttl=64 time=46.9 ms (DIFFERENT ADDRESS!)
$ ping -6 2a0c::1
From 2a0c::121 icmp_seq=1 Destination unreachable: Address unreachable
Сервер:
$ ping -6 2a0c::1
64 bytes from 2a0c::1: icmp_seq=1 ttl=64 time=1.14 ms
При пинге клиентом 2a0c::1, сервер передаёт следующее:
# ip6tables -t mangle -A POSTROUTING -j LOG
$ journalctl -f -g 'SRC='
kernel: IN=wg6 OUT=ens3 MAC= SRC=2a0c:0000:0000:0000:0000:0000:0000:0122 DST=2a0c:0000:0000:0000:0000:0000:0000:0001 LEN=104 TC=0 HOPLIMIT=63 FLOWLBL=920934 PROTO=ICMPv6 TYPE=128 CODE=0 ID=14 SEQ=1
Ещё присутствует такое:
kernel: IN=ens3 OUT=ens3 MAC=00:00:00:00:00:00:00:00:00:00:00:00:00:00 SRC=fe80:0000:0000:0000:5054:00ff:fe2c:1d4b DST=2a0c:0000:0000:0000:0000:0000:0000:0001 LEN=72 TC=0 HOPLIMIT=255 FLOWLBL=0 PROTO=ICMPv6 TYPE=135 CODE=0
kernel: IN=ens3 OUT=ens3 MAC=00:00:00:00:00:00:00:00:00:00:00:00:00:00 SRC=fe80:0000:0000:0000:5054:00ff:fe2c:1d4b DST=ff02:0000:0000:0000:0000:0001:ff00:0001 LEN=72 TC=0 HOPLIMIT=255 FLOWLBL=0 PROTO=ICMPv6 TYPE=135 CODE=0
Prerouting при том же пинге:
# ip6tables -t mangle -A PREROUTING -j LOG
$ journalctl -f -g 'SRC='
kernel: IN=wg6 OUT= MAC= SRC=2a0c:0000:0000:0000:0000:0000:0000:0122 DST=2a0c:0000:0000:0000:0000:0000:0000:0001 LEN=104 TC=0 HOPLIMIT=64 FLOWLBL=920934 PROTO=ICMPv6 TYPE=128 CODE=0 ID=15 SEQ=1
Также без пинга есть это:
kernel: IN=ens3 OUT= MAC=33:33:00:00:00:12:00:00:5e:00:02:01:86:dd SRC=fe80:0000:0000:0000:327c:5e08:ae98:3c80 DST=ff02:0000:0000:0000:0000:0000:0000:0012 LEN=80 TC=224 HOPLIMIT=255 FLOWLBL=0 PROTO=112
Почему с клиента в сторону шлюза пакеты уходят, а в ответ тишина?