我的家庭网络上有两台 Ubuntu 服务器:一台充当路由器/网关(路由器),另一台充当媒体/多用途服务器(服务器)。我一直试图在两台服务器上启用 IPv6,但在服务器上运行它时遇到了问题。
IPv6 在路由器上运行良好,我可以成功使用 ping6 访问 ipv6.google.com... 但在服务器上,每当我尝试使用 ping6 时都会出现网络无法访问错误。
对于两台机器上的防火墙,我使用的是firewalld。我已将服务“dhcpv6-client”和“dhcpv6”添加到相关区域。我还通过 AdGuardHome.yaml 在 LAN 上设置了 DHCPv6:
dhcp:
enabled: true
interface_name: enp3s0
local_domain_name: lan
dhcpv4:
gateway_ip: 10.0.0.1
subnet_mask: 255.255.255.0
range_start: 10.0.0.2
range_end: 10.0.0.254
lease_duration: 86400
icmp_timeout_msec: 1000
options: []
dhcpv6:
range_start: 2001:db8:100::2
lease_duration: 86400
ra_slaac_only: false
ra_allow_slaac: true
...在服务器上,我可以看到它通过 ip -ca 获取本地和全局 IPv6 地址:
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether d8:bb:c1:d8:6f:0d brd ff:ff:ff:ff:ff:ff
inet 10.0.0.238/24 metric 100 brd 10.0.0.255 scope global dynamic enp3s0
valid_lft 85023sec preferred_lft 85023sec
inet6 2001:db8:100::2/128 scope global
valid_lft forever preferred_lft forever
inet6 fe80::dabb:c1ff:fed8:6f0d/64 scope link
valid_lft forever preferred_lft forever
但是,当我在路由器上运行“ip -6 neigh”时,所有链接都处于陈旧状态(enp3s0 是 LAN,enp1s0 是 WAN):
fe80::10:18ff:febc:bda9 dev enp1s0 lladdr 02:10:18:bc:bd:a9 STALE
fe80::1af0:e3bf:955e:7922 dev enp3s0 lladdr dc:a6:32:2a:c9:80 STALE
fe80::221f:3bff:fe6c:ef6e dev enp3s0 lladdr 20:1f:3b:6c:ef:6e STALE
fe80::d358:7828:fa79:4a97 dev enp3s0 lladdr 38:86:f7:06:bd:21 STALE
fe80::76d4:23ff:febc:e2be dev enp3s0 lladdr 74:d4:23:bc:e2:be STALE
fe80::d9c7:c6cc:58c8:1181 dev enp3s0 lladdr 38:86:f7:16:3b:d7 STALE
fe80::ac9a:b6ff:feec:4a7e dev enp3s0 lladdr ae:9a:b6:ec:4a:7e STALE
fe80::dabb:c1ff:fed8:6f0d dev enp3s0 lladdr d8:bb:c1:d8:6f:0d STALE
fe80::5821:7eff:fe1a:2875 dev enp3s0 lladdr 5a:21:7e:1a:28:75 STALE
fe80::dabb:c1ff:fed8:6f0d dev enp1s0 FAILED
fe80::201:5cff:fe8e:5646 dev enp1s0 lladdr 00:01:5c:8e:56:46 router STALE
fe80::22df:b9ff:fe4b:9a8c dev enp3s0 lladdr 20:df:b9:4b:9a:8c STALE
fe80::7e04:3679:534b:707f dev enp3s0 lladdr e8:84:a5:8f:c4:01 STALE
fe80::aba:5fff:fec2:5b9c dev enp3s0 lladdr 08:ba:5f:c2:5b:9c STALE
2001:558:6012:51::1 dev enp1s0 lladdr 00:01:5c:8e:56:46 router STALE
服务器上的 /etc/sysctl.conf 中未禁用 IPv6:
net.ipv6.conf.all.disable_ipv6=0
net.ipv6.conf.default.disable_ipv6=0
net.ipv6.conf.lo.disable_ipv6=0
服务器上的 /etc/netplan/00-installer-config.yaml:
network:
version: 2
ethernets:
enp3s0:
dhcp4: true
dhcp6: true
服务器上的 /etc/network/interfaces:
source /etc/network/interfaces.d/*
auto enp3s0
iface enp3s0 inet6 dhcp
iface enp3s0 inet dhcp
由于我对 IPv6 还不熟悉,我可能忽略了一些简单的事情。如果有人能提供任何帮助来解决这个问题,我将不胜感激!