本產品的文件集力求使用無偏見用語。針對本文件集的目的,無偏見係定義為未根據年齡、身心障礙、性別、種族身分、民族身分、性別傾向、社會經濟地位及交織性表示歧視的用語。由於本產品軟體使用者介面中硬式編碼的語言、根據 RFP 文件使用的語言,或引用第三方產品的語言,因此本文件中可能會出現例外狀況。深入瞭解思科如何使用包容性用語。
思科已使用電腦和人工技術翻譯本文件,讓全世界的使用者能夠以自己的語言理解支援內容。請注意,即使是最佳機器翻譯,也不如專業譯者翻譯的內容準確。Cisco Systems, Inc. 對這些翻譯的準確度概不負責,並建議一律查看原始英文文件(提供連結)。
本文檔介紹如何使用字首委派功能配置DHCPv6(IPv6的動態主機配置協定)伺服器和客戶端。此功能可用於管理鏈路、子網和站點地址更改。
在此示例配置中,名為DHCPv6 server的路由器啟用了字首委派功能,並充當委託路由器。委託路由器自動執行為請求路由器(即DHCP客戶端)分配字首的過程。 一旦伺服器將字首委託給客戶端,則連線到請求路由器的區域網(LAN)的介面具有使用所接收字首塊的IPv6地址。然後,請求路由器在路由器通告消息中通告此地址。客戶端路由器(即本地網路中的路由器)可以使用autoconfig選項從DHCP客戶端通告的路由器通告消息中提取全域性IP地址。
嘗試此組態之前,請確保符合以下要求:
瞭解IPv6編址和基本連線
本文件所述內容不限於特定軟體和硬體版本。
本檔案中的組態是根據Cisco IOS®軟體版本軟體12.4(15)T 13上的Cisco 3700系列路由器。
本節提供用於設定本文件中所述功能的資訊。
本檔案會使用以下網路設定:
本檔案會使用以下設定:
以下影片連結演示了在Cisco支援社群 上提供的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] |
目前尚無適用於此組態的具體疑難排解資訊。