systemd-networkd 文档做出了这样的声明......
By enabling DHCPv6 support explicitly, the DHCPv6 client will
be started regardless of the presence of routers on the link
这是我正在寻找的行为 - 忽略任何可能出现或可能不出现的 RA,只启动 DHCPv6 客户端。
我没有看到任何证据表明 networkd 正在启动 dhcpv6 客户端,无论是从输出SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-networkd
还是来自tcpdump
.
但是,如果我手动调用,我可以确认我的 DHCPv6 服务器正在工作dhclient
。
root@client:~# dhclient -6 -v eth0
[...]
XMT: Solicit on eth0, interval 1070ms.
RCV: Advertise message on eth0 from fe80::baae:edff:fe77:7798.
[...]
XMT: Request on eth0, interval 910ms.
RCV: Reply message on eth0 from fe80::baae:edff:fe77:7798.
[...]
RCV: | | X-- IAADDR fd11:7::175
RCV: | | | X-- Preferred lifetime 7200.
RCV: | | | X-- Max lifetime 7500.
RCV: X-- Server ID: 00:01:00:01:29:d9:12:a2:02:42:0a:fe:fe:fe
message status code Success: "success"
PRC: Bound to lease 00:01:00:01:29:d9:12:a2:02:42:0a:fe:fe:fe.
配置systemd-network
(由 netplan 生成)。
[Match]
MACAddress=xx:xx:xx:xx:xx:xx
Name=eth0
[Network]
DHCP=ipv6 <-- explicitly enabling dhcpv6
LinkLocalAddressing=ipv6
Address=192.168.0.1/24
IPv6AcceptRA=no
[Route]
Destination=0.0.0.0/0
Gateway=192.168.0.10
关于为什么 networkd 没有启动 DHCPv6 客户端的任何想法?