我已经设置了一台双栈、两个接口的计算机作为家庭使用的路由器,但 LAN 设备无法通过 IPv6 到达外界。 (IPv4 完美运行)。
traceroute
当从 LAN 设备运行时,也会停止在路由器处。
但路由器本身能不过,ping IPv6 互联网地址没有问题。
我有以下拓扑:
ISP edge gateway <->(ext0) My router (int0)<-> Network switch <-> LAN devices
我对 IPv6 很陌生,并没有真正深入了解我在这里所做的事情:)我知道 ipv6 地址的组成部分以及前缀是什么,但仅此而已。
所有 LAN 设备都通过 DHCPv6-PD 和路由器通告获得正确的全局 IPv6 地址。为了简单起见,我现在已经削弱了路由器上的所有防火墙,因此它不会干扰(但一旦修复此问题我就已经将它们设置为工作)。
相关的 systemd-networkd 配置:(我有 dnsmasq 仅管理 IPv4,但我认为它与这里无关)
猫 /etc/systemd/network/20-external.network
[Match]
Name=ext0
[Network]
DHCP=yes
IPForward=yes
IPv6AcceptRA=yes
猫 /etc/systemd/network/20-internal.network
[Match]
Name=int0
[Network]
Address=192.168.1.1/24
IPMasquerade=yes
IPv6SendRA=yes
DHCPv6PrefixDelegation=yes
LinkLocalAddressing=ipv6
[IPv6SendRA]
RouterLifetimeSec=3600
通过此设置,我在路由器上得到以下信息:
ip-6a
2: int0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 2001:xxxx:xxxx:5dc0:21e:6ff:fe45:4afa/64 scope global dynamic
valid_lft 1027438sec preferred_lft 1027438sec
inet6 fe80::21e:6ff:fe45:4afa/64 scope link
valid_lft forever preferred_lft forever
3: ext0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 2001:xxxx:xxxx:5d00::1000/128 scope global dynamic noprefixroute
valid_lft 1025156sec preferred_lft 1025156sec
inet6 2001:xxxx:xxxx:5d00:21e:6ff:fe45:4afb/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 1062665sec preferred_lft 604772sec
inet6 fe80::21e:6ff:fe45:4afb/64 scope link
valid_lft forever preferred_lft forever
IP-6R
::1 dev lo proto kernel metric 256 pref medium
2001:xxxx:xxxx:5d00::/64 dev ext0 proto ra metric 1024 expires 1062685sec pref medium
2001:xxxx:xxxx:5dc0::/64 dev int0 proto kernel metric 256 expires 1027308sec pref medium
2001:xxxx:xxxx:5dc0::/64 dev int0 metric 1024 pref medium
unreachable 2001:xxxx:xxxx:5dc0::/60 dev lo metric 1024 pref medium
2001:xxxx:xxxx:5d00::/56 via fe80::4265:a3ff:feec:1e74 dev ext0 proto ra metric 1024 expires 1062685sec pref medium
fe80::/64 dev ext0 proto kernel metric 256 pref medium
fe80::/64 dev int0 proto kernel metric 256 pref medium
default via fe80::4265:a3ff:feec:1e74 dev ext0 proto ra metric 1024 expires 1792sec mtu 1500 pref medium
ping
从我的电脑:
PING ipv6.google.com(prg03s05-in-x0e.1e100.net (2a00:1450:4014:80c::200e)) 56 data bytes
^C
--- ipv6.google.com ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1045ms
traceroute
从我的电脑:
traceroute -6 ipv6.google.com
traceroute to ipv6.google.com (2a00:1450:4014:80d::200e), 30 hops max, 80 byte packets
1 2001XXXXXXXX5DC0021E06FFFE454AFA.catv.pool.telekom.hu (2001:xxxx:xxxx:5dc0:21e:6ff:fe45:4afa) 0.265 ms 0.240 ms 18.795 ms
2 * * *
3 * * *
4 * * *
[...]