DHCPv6 PD客户端示例(pppoe)

参考链接

组网需求

参考A的配置,B是指运营商
IPV6 DNS地址自动获取不需要在路由器上配置
gigabitethernet 0/0/1的配置用拨号口代替
gigabitethernet 0/0/2的配置直接lan侧接入电脑的vlanif接口

如图1所示,用户希望路由器工业路由交换一体机作为DHCPv6 PD客户端,通过与DHCPv6 PD服务器通信,以获取IPv6地址前缀信息.配置路由器工业路由交换一体机作为DHCP PD客户端,可以为用户分配IPv6地址及其它网络配置信息,可以减少DHCPv6服务器的压力,实现IPv6的层次布局.DHCPv6 PD服务器的地址为fc00:1::1/64.DHCPv6 PD客户端和DHCPv6 PD服务器在同一个链路.假设DHCPv6 PD客户端为用户分配的网络配置参数中,DNS服务器地址为fc00:2::1/64,DNS域名后缀为example.com.

图1 DHCPv6 PD客户端组网图
图1 DHCPv6 PD客户端组网图

配置思路

  1. 在DHCPv6 PD客户端上,使能接口的IPv6功能,实现设备之间的IPv6通信.
  2. 在DHCPv6 PD客户端上,使能DHCPv6 PD客户端功能,实现设备通过DHCPv6方式获取IPv6地址前缀.
  3. 在DHCPv6 PD服务器上,使能DHCPv6 PD服务器功能,配置DNS服务器地址,实现设备通过DHCPv6方式获取DNS服务器地址.

操作步骤

  1. 在Router A上,配置接口的IPv6功能
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] ipv6
[RouterA] interface gigabitethernet 0/0/1
[RouterA-GigabitEthernet0/0/1] ipv6 enable
[RouterA-GigabitEthernet0/0/1] ipv6 address auto link-local
  1. 在Router A上,配置DHCPv6客户端功能
  • 使能GE0/0/1接口的DHCPv6 PD客户端功能.
[RouterA-GigabitEthernet0/0/1] dhcpv6 client pd myprefix 
[RouterA-GigabitEthernet0/0/1] quit 
  • 配置DNS域名后缀为example.com.配置域名后缀后,用户无需手动输入域名后缀,系统就会自动添加指定的域名后缀.
[RouterA] dns domain example.com
  1. 在Router B上,配置DHCPv6 PD服务器功能
  • 使能DHCPv6 PD服务器功能
<Huawei> system-view
[Huawei] sysname RouterB
[RouterB] dhcp enable
  • 在地址池pool1下配置DNS服务器地址为fc00:2::1/64.
[RouterB] dhcpv6 pool pool1
[RouterB-dhcpv6-pool-pool1] prefix-delegation fc00:1::/60 63  
[RouterB-dhcpv6-pool-pool1] dns-server fc00:2::1    
  1. 配置RouterA以路由通告形式向主机分配地址前缀
  • 配置发布RA消息,并配置M/O标志位.
[RouterA] interface gigabitethernet 0/0/2
[RouterA-GigabitEthernet0/0/2] ipv6 enable
[RouterA-GigabitEthernet0/0/2] ipv6 address auto link-local
[RouterA-GigabitEthernet0/0/2] undo ipv6 nd ra halt 
[RouterA-GigabitEthernet0/0/2] ipv6 nd autoconfig managed-address-flag
[RouterA-GigabitEthernet0/0/2] ipv6 nd autoconfig other-flag
[RouterA-GigabitEthernet0/0/2] ipv6 address myprefix ::1:0:0:0:1/64  
[RouterA-GigabitEthernet0/0/2] quit
  1. 验证配置结果
  • 在Router A上使用display dhcpv6 client命令用来查看DHCPv6客户端配置情况.
<RouterA> display dhcpv6 client
GigabitEthernet0/0/1 is in DHCPv6-PD client mode.                               
State is BOUND.                                                                 
Preferred server DUID   : 000300060819A6CDA894                                  
  Reachable via address : FE80::A19:A6FF:FECD:A897                              
IA PD IA ID 0x00000051 T1 43200 T2 69120                                        
  Prefix name  : myprefix                                                       
  Obtained     : 2012-12-22 09:33:09                                            
  Renews       : 2012-12-22 21:33:09                                            
  Rebinds      : 2012-12-23 04:45:09                                            
  Prefix       : FC00:1::/48                                                      
    Lifetime valid 172800 seconds, preferred 86400 seconds                      
    Expires at 2012-12-24 09:33:09(172792 seconds left)                         
DNS server     : FC00:2::1                
  • 在Router A上使用display dhcpv6 client statistics命令用来查看DHCPv6客户端报文的统计信息.
<RouterA> display dhcpv6 client statistics
Message statistics of interface GigabitEthernet0/0/1:                          
   Message                  Received                                            
   Advertise                1                                                   
   Reply                    1                                                   
   Reconfigure              0                                                   
   Invalid                  0                                                   
                                                                                
   Message                  Sent                                                
   Solicit                  1                                                   
   Request                  1                                                   
   Confirm                  0                                                   
   Renew                    0                                                   
   Rebind                   0                                                   
   Release                  0                                                   
   Decline                  0                                                   
   Information-request      0

配置文件

Router A的配置文件

#
 sysname RouterA
#                                                                               
ipv6                                                                            
# 
interface GigabitEthernet0/0/1
 ipv6 enable                                                                    
 ipv6 address auto link-local                                                   
 dhcpv6 client pd myprefix                                                              
# 
dns domain example.com 
#                                                                            
interface GigabitEthernet0/0/2  
 ipv6 enable                                                                    
 ipv6 address auto link-local                                                   
 undo ipv6 nd ra halt 
 ipv6 nd autoconfig managed-address-flag
 ipv6 nd autoconfig other-flag
 ipv6 address myprefix ::1:0:0:0:1/64                                                               
#  
return

Router B的配置文件

#
 sysname RouterB
#
dhcp enable                                                                   
#  
dhcpv6 pool pool1 
 prefix-delegation fc00:1::/60 63          
 dns-server FC00:2::1                                                           
#