此产品的文档集力求使用非歧视性语言。在本文档集中,非歧视性语言是指不隐含针对年龄、残障、性别、种族身份、族群身份、性取向、社会经济地位和交叉性的歧视的语言。由于产品软件的用户界面中使用的硬编码语言、基于 RFP 文档使用的语言或引用的第三方产品使用的语言,文档中可能无法确保完全使用非歧视性语言。 深入了解思科如何使用包容性语言。
思科采用人工翻译与机器翻译相结合的方式将此文档翻译成不同语言,希望全球的用户都能通过各自的语言得到支持性的内容。 请注意:即使是最好的机器翻译,其准确度也不及专业翻译人员的水平。 Cisco Systems, Inc. 对于翻译的准确性不承担任何责任,并建议您总是参考英文原始文档(已提供链接)。
本文介绍如何使用前缀委派功能来配置 DHCPv6(IPv6 动态主机配置协议)服务器和客户端。此功能可用于管理链路、子网和站点寻址更改。
在本文提供的配置示例中,我们为名为 DHCPv6 server 的路由器启用了前缀委派功能,使其作为前缀委派路由器工作。该前缀委派路由器会自动执行为请求路由器(即 DHCP 客户端)分配前缀的过程。 当服务器向客户端委派前缀后,请求路由器上连接到本地局域网 (LAN) 的接口将使用收到的前缀块生成 IPv6 地址。然后,请求路由器会在路由器通告消息中通告该地址。客户端路由器(即本地局域网中的路由器)可以使用自动配置选项从 DHCP 客户端通告的路由器通告消息中提取全局 IP 地址。
尝试进行此配置之前,请确保满足以下要求:
本文档不限于特定的软件和硬件版本。
本文所述的配置基于运行 Cisco IOS® 软件版本 12.4(15)T13 的思科 3700 系列路由器。
本部分提供有关如何配置本文档所述功能的信息。
本文档使用以下网络设置:
本文档使用以下配置:
下面这段来自思科支持社区的 视频展示了在 Cisco IOS 路由器上配置 DHCPv6 的具体步骤:
DHCPSERVER#show running-config version 12.4 ! hostname DHCPSERVER ! ipv6 unicast-routing ipv6 dhcp pool dhcpv6 !--- The DHCP pool is named "dhcpv6." ! prefix-delegation pool dhcpv6-pool1 lifetime 1800 600 !--- The prefix delegation pool name is "dhcpv6-pool1." ! dns-server 2001:DB8:3000:3000::42 domain-name example.com ! interface Serial0/0 no ip address ipv6 address 2010:AB8:0:1::1/64 ipv6 enable ipv6 dhcp server dhcpv6 clock rate 2000000 ! ipv6 local pool dhcpv6-pool1 2001:DB8:1200::/40 48 !--- The prefix pool named dhcpv6-pool1 has a prefix of length !--- /40 from which it will delegate (sub)prefixes of length /48. ! end[an error occurred while processing this directive]
DHCPCLIENT#show running-config version 12.4 ! hostname DHCPCLIENT ! ipv6 unicast-routing ! interface Serial0/0 no ip address ipv6 address autoconfig default !--- The autoconfig default adds a static ipv6 !--- default route pointing to upstream DHCP server. ! ipv6 enable ipv6 dhcp client pd prefix-from-provider !--- The DHCP client prefix delegation is !--- given the name prefix-from-provider. ! clock rate 2000000 ! interface FastEthernet0/0 no ip address duplex auto speed auto ipv6 address prefix-from-provider ::1:0:0:0:1/64 !--- The first 48 bits are imported from the delegated !--- prefix (2001:db8:1200) and the ::/64 is the client !--- identifier that gives the interface Fa0/1 the !--- global IPv6 address 2001:DB8:1200:1::1/64. ! ipv6 enable ! interface FastEthernet0/1 no ip address duplex auto speed auto ipv6 enable ipv6 address prefix-from-provider ::1/64 !--- Similarly, the global IPv6 address !--- for fa0/1 is 2001:DB8:1200::1. ! end[an error occurred while processing this directive]
本地 LAN 配置 | |
---|---|
客户端 1 | 客户端 2 |
CLIENT1#show running-config version 12.4 ! hostname CLIENT1 ! ipv6 unicast-routing ! interface FastEthernet0/0 no ip address duplex auto speed auto ipv6 address autoconfig !--- The clients can run autoconfig to get an IPv6 !--- address depending on the router advertisements !--- sent by the DHCP client (requesting router). ! ipv6 enable ! end[an error occurred while processing this directive] |
CLIENT2#show running-config version 12.4 ! hostname CLIENT2 ! ipv6 unicast-routing ! interface FastEthernet0/0 no ip address duplex auto speed auto ipv6 address autoconfig ipv6 enable ! end[an error occurred while processing this directive] |
请使用本部分描述的命令来验证配置。
注意:为了节省空间,本节所示的部分输出已经过换行。
DHCP 服务器上
本节的输出显示了活动客户端数量 (1) 以及其他配置参数信息,例如域名服务器地址和首选存活时间信息。
show ipv6 dhcp pool |
---|
DHCPv6 pool: dhcpv6 Prefix pool: dhcpv6-pool1 preferred lifetime 600, valid lifetime 1800 DNS server: 2001:DB8:3000:3000::42 Domain name: example.com Active clients: 1[an error occurred while processing this directive] |
show ipv6 dhcp binding命令提供有关客户端的信息,包括其DUID、IAPD、前缀以及首选和有效生存期。
show ipv6 dhcp binding |
---|
Client: FE80::C002:FFF:FEB4:0 DUID: 00030001C2020FB40000 Username : unassigned Interface : Serial0/0 IA PD: IA ID 0x00060001, T1 300, T2 480 Prefix: 2001:DB8:1200::/48 preferred lifetime 600, valid lifetime 1800 expires at Mar 02 2002 01:26 AM (1707 seconds)[an error occurred while processing this directive] |
DHCP 客户端上
show ipv6 dhcp interface命令显示接口S0/0已在客户端模式下配置,并显示DNS服务器地址及其从DHCP服务器接收的域名的详细信息。
show ipv6 dhcp interface |
---|
Serial0/0 is in client mode State is OPEN Renew will be sent in 00:04:37 List of known servers: Reachable via address: FE80::C003:FFF:FEB4:0 DUID: 00030001C2030FB40000 Preference: 0 Configuration parameters: IA PD: IA ID 0x00060001, T1 300, T2 480 Prefix: 2001:DB8:1200::/48 preferred lifetime 600, valid lifetime 1800 expires at Mar 01 2002 10:59 AM (1777 seconds) DNS server: 2001:DB8:3000:3000::42 Domain name: example.com Information refresh time: 0 Prefix name: prefix-from-provider Rapid-Commit: disabled[an error occurred while processing this directive] |
快速以太网接口Fa0/0和Fa0/1上的show ipv6 interface命令提供以下输出:
show ipv6 int fa0/0 | show ipv6 int fa0/1 |
---|---|
FastEthernet0/0 is up, line protocol is up IPv6 is enabled, link-local address is FE80::C002:FFF:FEB4:0 No Virtual link-local address(es): Global unicast address(es): 2001:DB8:1200:1::1, subnet is 2001:DB8:1200:1::/64 [CAL/PRE] valid lifetime 1535 preferred lifetime 335 !--- Output omitted.[an error occurred while processing this directive] |
FastEthernet0/1 is up, line protocol is up IPv6 is enabled, link-local address is FE80::C002:FFF:FEB4:1 No Virtual link-local address(es): Global unicast address(es): 2001:DB8:1200::1, subnet is 2001:DB8:1200::/64 [CAL/PRE] valid lifetime 1712 preferred lifetime 512 !--- Output omitted.[an error occurred while processing this directive] |
show ipv6 general-prefix命令通过前缀委派验证从DHCP服务器收到的任何前缀(常规前缀)。
show ipv6 general-prefix |
---|
IPv6 Prefix prefix-from-provider, acquired via DHCP PD 2001:DB8:1200::/48 Valid lifetime 1656, preferred lifetime 456 !--- 2001:DB8:1200::/48 is the general prefix received from server. FastEthernet0/1 (Address command) FastEthernet0/0 (Address command)[an error occurred while processing this directive] |
本地 LAN 客户端上
客户端路由器Client 1和Client 2的FastEthernet接口Fa0/0上的show ipv6 interface命令提供以下输出:
show ipv6 int fa0/0 | |
---|---|
客户端 1 | 客户端 2 |
FastEthernet0/0 is up, line protocol is up IPv6 is enabled, link-local address is FE80::C000:FFF:FEB4:0 No Virtual link-local address(es): Global unicast address(es): 2001:DB8:1200:1:C000:FFF:FEB4:0, subnet is 2001:DB8:1200:1::/64 [EUI/CAL/PRE] valid lifetime 1709 preferred lifetime 509[an error occurred while processing this directive] |
FastEthernet0/0 is up, line protocol is up IPv6 is enabled, link-local address is FE80::C001:FFF:FEB4:0 No Virtual link-local address(es): Global unicast address(es): 2001:DB8:1200:0:C001:FFF:FEB4:0, subnet is 2001:DB8:1200::/64 [EUI/CAL/PRE] valid lifetime 1770 preferred lifetime 570[an error occurred while processing this directive] |
目前没有针对此配置的故障排除信息。