我正在尝试在 ubuntu 上设置 DHCPv6 以分配带有 112 前缀的地址。我的配置如下:
subnet6 2001:db8:a0b::640a:0/112 {
range6 2001:db8:a0b::6464:640a 2001:db8:a0b::6464:640d;
default-lease-time 600;
max-lease-time 7200;
}
我期望被分配具有以下符号的 IPv6:
2001:db8:a0b::6464:640a/112
但我得到的却是
2001:db8:a0b::6464:640a/64
我错过了什么?
答案1
范围仍然不正确。查看 IP 地址的倒数第二段。在 /112 中,您有 640a,但在您的范围内,您有 6464。进行以下更改。
subnet6 2001:db8:a0b::640a:0/112 {
range6 2001:db8:a0b::640a:640a 2001:db8:a0b::640a:640d;
default-lease-time 600;
max-lease-time 7200;
}
从https://subnettingpractice.com/ipv6_subnetting.html
Compressed Address: 2001:db8:a0b::640a:0/112
Expanded Address: 2001:0db8:0a0b:0000:0000:0000:640a:0000/112
Prefix: ffff:ffff:ffff:ffff:ffff:ffff:ffff:0000
Range: 2001:db8:a0b:0:0:0:640a:0
2001:db8:a0b:0:0:0:640a:ffff
Number of /64s: 3.552713678800501e-15