man*_*tor 4 dns dhcp isc-dhcpd
我希望 tp 取代名称服务器信息,这些信息是我使用自己的配置从 DHCP 服务器获取的。因此,我在我的中使用以下选项/etc/dhcp/dhclient.conf:
supersede domain-name-servers 1.1.1.1, 2.2.2.2, 3.3.3.3;
Run Code Online (Sandbox Code Playgroud)
一切正常,但我想添加 IPv6 地址,而且这是双堆栈服务器。以下语句不起作用(我进入/etc/dhcp/dhclient.conf line 56: semicolon expected.系统日志):
supersede domain-name-servers 1.1.1.1, 2.2.2.2, 3.3.3.3, ::1, 2000::BEEF, FURTHER_IPv6_ADDRESS;
Run Code Online (Sandbox Code Playgroud)
所以我的问题是:如何将 IPv6 地址添加到supersede domain-name-servers中的选项中/etc/dhcp/dhclient.conf?
我找到了隐藏在这个错误中的解决方案,标题为:Bug 643890 - dhclient returns to prepend ipv6 nameservers。
Jiri Popelka 2010-10-18 15:37:46 UTC
(In reply to comment #0)
> prepend domain-name-servers 2001:470:20::2 ;
correct is
prepend dhcp6.name-servers 2001:470:20::2;
(see dhcp-options(5) man page)
but it seems that dhclient is really ignoring it.
I'm trying to figure out what's wrong.
Run Code Online (Sandbox Code Playgroud)
的手册页dhcp-options也显示了它:
option dhcp6.name-servers ip6-address [, ip6-address ... ] ;
The name-servers option instructs clients about locally available
recursive DNS servers. It is easiest to describe this as the "nameserver"
line in /etc/resolv.conf.
Run Code Online (Sandbox Code Playgroud)
因此,在我的客户端上,我添加了以下几行来执行双堆栈(IPv4 和 IP6):
$ cat /etc/dhcp/dhclient.conf
...
...
## Global section example
prepend domain-name-servers 192.168.7.14,192.168.7.85;
prepend dhcp6.name-servers 2602:6030:dd00:d807::1a11;
## Interface section example
interface "eth0" {
prepend domain-name-servers 192.168.7.14,192.168.7.85;
prepend dhcp6.name-servers 2602:6030:dd00:d807::1a11;
}
...
...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2380 次 |
| 最近记录: |