实验目的:1.实现路由器可以有状态的获取IPv6地址
2.实现路由器可以无状态的获取IPv6地址
配置思路:
- 配置路由器接口的IPv6地址
- 在路由器2上创建DHCP地址池,进入路由器3对应接口,开启应用DHCP地址池服务,进入路由器4对应的接口,配置无状态获取IPv6地址方式
拓扑图
AR2的配置
dhcp enable //使能dhcp
#
dhcpv6 pool pool1 //创建DHCP地址池,取名为pool1
address prefix 2002::/64 //地址池前缀
excluded-address 2002::1
interface GigabitEthernet0/0/0
ipv6 enable
ipv6 address 2002::1/64
ipv6 address auto link-local
dhcpv6 server pool1 //进行DHCP有状态地址配置,应用pool1地址池
interface GigabitEthernet0/0/1
ipv6 enable
ipv6 address 2003::1/64
ipv6 address auto link-local
undo ipv6 nd ra halt //使能接口发布ra报文,使接口能够进行IPv6无状态地址配置
interface GigabitEthernet0/0/2
ipv6 enable
ipv6 address 2001::2/64
ipv6 address auto link-local
AR1的配置
[Huawei]ipv6
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ipv6 enab
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ipv6 address 2001::1 64
[Huawei]ipv6 route-static 2002:: 15 2001::2 //配置一条到AR3网段的静态路由
AR3的配置
[Huawei]dhcp enable //开启dhcp服务
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ipv6 address auto link-local
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ipv6 address auto dhcp //设置接口的配置方式为DHCP
[Huawei]ipv6 route-static :: 0 2002::1 //配置一条默认路由
查看结果在AR3上,成功获取到IPv6地址
[Huawei]dis ipv6 interface
GigabitEthernet0/0/0 current state : UP
IPv6 protocol current state : UP
IPv6 is enabled, link-local address is FE80::2E0:FCFF:FE61:7DC3
Global unicast address(es):
2002::2, subnet is 2002::2/128
AR4的配置
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ipv6 address auto global //设置接口的配置方式为global(无状态获取)
[Huawei]ipv6 route-static 2001:: 64 2003::1
[Huawei]ipv6 route-static 2002:: 64 2003::1 //配置静态路由实现通信
测试结果