我正在运行 Ubuntu(全部 20.04)MacOS 和 Windows 10 的混合网络。
我运行 Ubuntu 服务器,该服务器运行 dnsmasq 并充当网络的 DHCP 服务器(该机器称为“serv2”,IP 地址为 192.168.2.4)。Serv2 还为网络提供缓存 DNS(并允许解析本地主机名)(再次使用 dnsmasq)。
我的系统使用 IPv4,并且我从未尝试配置 IPv6
出现了一个新问题,Ubuntu 桌面客户端有时(随机启动时)无法解析我网络上其他主机的名称。这可以通过重新启动来解决。
我进行了很多研究,我认为以下因素很重要:
resolve.conf
包含:
nameserver 192.168.2.4
nameserver fd52:a81c:df85:1:ded9:16ff:fed5:9a73
search njj.chickenkiller.com connect
仅当是第一个列出的名称服务器时,才会出现systemd-resolve --status
无法解析本地主机名的情况。fd52...
我的 ifconfig 输出:
enp6s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.2.11 netmask 255.255.255.0 broadcast 192.168.2.255
inet6 fe80::a37a:ffa8:2056:1d1e prefixlen 64 scopeid 0x20<link>
inet6 fd52:a81c:df85:1:389:3ab9:d587:3bb7 prefixlen 64 scopeid 0x0<global>
inet6 fd52:a81c:df85:1:cc9f:3c2f:ad73:fd29 prefixlen 64 scopeid 0x0<global>
ether b4:2e:99:41:5d:bc txqueuelen 1000 (Ethernet)
可以看到我已使用前缀 分配了 IPv6 地址fd52:a81c:df85
。同样,我的服务器也已分配了 IPv6 地址fd52:a81c:df85:1:1a31:bfff:fe6a:35bc
在我的 systemd 日志(journalctl -b|grep dhcp
)中,有以下条目:
May 08 12:16:03 kenickie audit[626]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=626 comm="apparmor_parser"
May 08 12:16:03 kenickie audit[626]: AVC apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=626 comm="apparmor_parser"
May 08 12:16:05 kenickie NetworkManager[687]: <info> [1588936565.2384] dhcp-init: Using DHCP client 'internal'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.1844] dhcp4 (enp6s0): activation: beginning transaction (timeout in 45 seconds)
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2316] dhcp4 (enp6s0): option dhcp_lease_time => '43200'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2316] dhcp4 (enp6s0): option domain_name => 'njj.chickenkiller.com'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2316] dhcp4 (enp6s0): option domain_name_servers => '192.168.2.4'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2316] dhcp4 (enp6s0): option expiry => '1588979768'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2316] dhcp4 (enp6s0): option host_name => 'kenickie'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2316] dhcp4 (enp6s0): option ip_address => '192.168.2.11'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2317] dhcp4 (enp6s0): option next_server => '192.168.2.4'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2317] dhcp4 (enp6s0): option ntp_servers => '192.168.2.4'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2317] dhcp4 (enp6s0): option requested_broadcast_address => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2317] dhcp4 (enp6s0): option requested_domain_name => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2317] dhcp4 (enp6s0): option requested_domain_name_servers => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2317] dhcp4 (enp6s0): option requested_domain_search => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2317] dhcp4 (enp6s0): option requested_host_name => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2317] dhcp4 (enp6s0): option requested_interface_mtu => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2317] dhcp4 (enp6s0): option requested_ms_classless_static_routes => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2317] dhcp4 (enp6s0): option requested_nis_domain => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2317] dhcp4 (enp6s0): option requested_nis_servers => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2318] dhcp4 (enp6s0): option requested_ntp_servers => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2318] dhcp4 (enp6s0): option requested_rfc3442_classless_static_routes => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2318] dhcp4 (enp6s0): option requested_root_path => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2318] dhcp4 (enp6s0): option requested_routers => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2318] dhcp4 (enp6s0): option requested_static_routes => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2318] dhcp4 (enp6s0): option requested_subnet_mask => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2318] dhcp4 (enp6s0): option requested_time_offset => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2318] dhcp4 (enp6s0): option requested_wpad => '1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2318] dhcp4 (enp6s0): option routers => '192.168.2.1'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2318] dhcp4 (enp6s0): option subnet_mask => '255.255.255.0'
May 08 12:16:08 kenickie NetworkManager[687]: <info> [1588936568.2318] dhcp4 (enp6s0): state changed unknown -> bound
May 08 12:16:09 kenickie NetworkManager[687]: <info> [1588936569.9981] dhcp6 (enp6s0): activation: beginning transaction (timeout in 45 seconds)
May 08 12:16:10 kenickie NetworkManager[687]: <info> [1588936570.0162] dhcp6 (enp6s0): option dhcp6_domain_search => 'connect'
May 08 12:16:10 kenickie NetworkManager[687]: <info> [1588936570.0166] dhcp6 (enp6s0): option dhcp6_name_servers => 'fd52:a81c:1234:1:ded9:16ff:fed5:9a73'
May 08 12:16:10 kenickie NetworkManager[687]: <info> [1588936570.0169] dhcp6 (enp6s0): state changed unknown -> bound
注意最后一行中 IPv6 名称服务器的分配
查看我的路由器,它有一个 IPv6 设置(我的 ISP 不支持我所在地区的 IPv6),提供 ULA 前缀fd52:a81c:df85::
(即我的网络上显示的前缀)。IPv6 设置旁边的文本显示“此页面允许配置家庭网络中使用的 IP 地址。如果使用 DHCP,Vodafone Connect 会自动为连接到网络的设备分配 IP 地址。”但是,路由器上的 DHCP 已关闭。
因此有四个问题:
- ULA 前缀如何在我的网络中共享?(是路由器错误吗)?
- IPv6 地址如何分配
- 名称服务器的 dhcp6 配置来自哪里?
- 有没有一种优雅的方法来停止名称服务器的 dhcp6 分配?
答案1
抱歉,我要自己回答这个问题,但这个问题与 VDSL 路由器有关(最终与 Ubuntu 无关)。在上次固件更新中,似乎已启用 IPv6,路由器正在为客户端分配 IPv6 地址和名称解析。
在我的这篇文章中对此进行了介绍ISP 的问题页面