使用 Dhcpcd 设置前缀长度提示(和类似的 DHCPv6)选项

使用 Dhcpcd 设置前缀长度提示(和类似的 DHCPv6)选项

因此,我尝试从我的 ISP(本例中为 Verizon)获取一个 ipv6 地址。使用 OPNSense,我需要将 wan 接口设置为 dhcpv6 客户端,并使用前缀大小提示 56,并且仅要求提供前缀。现在我尝试仅使用原始 dhcpcd 来执行此操作,但似乎缺乏有关如何设置此类选项的文档。我甚至深入研究了 ipv6 rfcs 和 dhcpcd 源代码,试图弄清楚我应该做什么。以下是我最终得到的配置:

duid
noipv6rs
nohook resolv.conf
nopv4ll

interface wan
  ipv6rs
  option dhcp6_26 56 # iaprefix option
  # also tried with:
  #option 26 56
  #option dhcp6_iaprefix 56 # not recognized by dhcpcd
  #option iaprefix 56 # not recognized by dhcpcd

  iaid 1
  ia_pd 1

相关日志为:

Jan 13 01:10:36 hermes dhcpcd[79635]: wan: IAID 00:00:00:01
Jan 13 01:10:36 hermes dhcpcd[79635]: wan: soliciting a DHCPv6 lease
...
Jan 13 01:10:36 hermes dhcpcd[79635]: wan: soliciting an IPv6 router
Jan 13 01:10:36 hermes dhcpcd[79635]: wan: Router Advertisement from fe80::56e0:32ff:fe75:3164
Jan 13 01:10:36 hermes dhcpcd[79635]: wan: no global addresses for default route

有谁知道这应该如何工作?

编辑:这是 dhcpcd 启动时 wan icmp6 数据包的 tcpdump

sudo tcpdump -v -i wan icmp6
tcpdump: listening on wan, link-type EN10MB (Ethernet), snapshot length 262144 bytes
02:51:51.059467 IP6 (flowlabel 0xafbfa, hlim 255, next-header ICMPv6 (58) payload length: 16) hermes > ff02::2: [icmp6 sum ok] ICMP6, router solicitation, length 16
      source link-address option (1), length 8 (1): xx:xx:xx:xx:xx:xx
02:51:51.063387 IP6 (class 0xc0, hlim 255, next-header ICMPv6 (58) payload length: 24) fe80::56e0:32ff:fe75:3164 > ff02::1: [icmp6 sum ok] ICMP6, router advertisement, length 24
    hop limit 64, Flags [managed], pref medium, router lifetime 1800s, reachable time 0ms, retrans timer 0ms
      source link-address option (1), length 8 (1): yy:yy:yy:yy:yy:yy
02:51:52.227093 IP6 (class 0xc0, hlim 255, next-header ICMPv6 (58) payload length: 32) 2600:4040:5120::1 > ff02::1:ff21:971f: [icmp6 sum ok] ICMP6, neighbor solicitation, length 32, who has hermes
      source link-address option (1), length 8 (1): yy:yy:yy:yy:yy:yy
02:51:52.227249 IP6 (hlim 255, next-header ICMPv6 (58) payload length: 32) hermes > 2600:4040:5120::1: [icmp6 sum ok] ICMP6, neighbor advertisement, length 32, tgt is hermes, Flags [solicited, override]
      destination link-address option (2), length 8 (1): yy:yy:yy:yy:yy:yy
02:51:57.349138 IP6 (hlim 255, next-header ICMPv6 (58) payload length: 32) hermes > 2600:4040:5120::1: [icmp6 sum ok] ICMP6, neighbor solicitation, length 32, who has 2600:4040:5120::1
      source link-address option (1), length 8 (1): xx:xx:xx:xx:xx:xx
02:51:57.353447 IP6 (class 0xc0, hlim 255, next-header ICMPv6 (58) payload length: 24) 2600:4040:5120::1 > hermes: [icmp6 sum ok] ICMP6, neighbor advertisement, length 24, tgt is 2600:4040:5120::1, Flags [router, solicited]

相关内容