大网数据广告活动
服务器运维问答

How to get a proper prefix length from DHCPv6 server?

· 52CE 我爱测

I have two virtual machines with Ubuntu Server 20.04. One of these virtual machines is a DHCPv6 server, and the other one is a client. I am able to set an IPv6 address on the client, but I cannot ping to and from this address. ip…

问题原文

原帖链接 · user6758 · CC BY-SA 4.0

I have two virtual machines with Ubuntu Server 20.04. One of these virtual machines is a DHCPv6 server, and the other one is a client. I am able to set an IPv6 address on the client, but I cannot ping to and from this address. ip -6 route shows this address but with prefix length of 128. I would like to have the prefix length equals to 64, the same as the server IP address has. When I add to my routing table on the client IP address obtained from the server but with prefix length equals to 64, I can ping between my virtual machines.

This is my /etc/dhcp/dhcpd6.conf file on the server:

default-lease-time 2592000;
preferred-lifetime 604800;
option dhcp-renewal-time 3600;
option dhcp-rebinding-time 7200;
allow leasequery;
option dhcp6.name-servers 3ffe:501:ffff:100:200:ff:fe00:3f3e;
option dhcp6.domain-search "test.example.com","example.com";
option dhcp6.info-refresh-time 21600;

authoritative:
subnet6 fdaa:a:a:a::/64 {
   range6 fdaa:a:a:a::100 fdaa:a:a:a::199;
}

The last three lines were added by me.

This is my /etc/netplan/00-installer-config.yaml file on the client:

network:
   ethernets:
      ens3:
         dhcp4: false
         dhcp6: true
   version: 2

Thank you in advance for any help.

已采纳解答

原帖链接 · Tommiie · CC BY-SA 4.0

As per the DHCPd documentation:

In a properly functioning system the client should use a prefix length of 128 and get any on-link information from the RAs from a router.

Since you are using two virtual machines and I assume no IPv6-capable virtual router connects to that virtual network, nobody is sending out those RAs so your client cannot get the correct subnet mask.

Check the link for more information.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-12-01)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。