IPV6无状态的地址分配实验

组网需求
如图1所示,RouterA和RouterB分别通过GE1/0/0相连。要求RouterA和RouterB形成邻居关系,RouterB能通过邻居发现功能获得IPv6地址。
图1 配置IPv6基础功能组网图
dc_cfg_ipv6_002801.png
配置思路
配置IPv6基础功能思路如下:

1.使能RouterA的IPv6转发能力并配置IPv6地址,使路由器具有对IPv6报文的转发能力。

2.打开RouterA的RA报文发送开关。RouterB的GE1/0/0接口在接收到RouterA发送的RA报文后可根据RA报文中携带的路由前缀等信息进行地址自动配置。
操作步骤
1.配置RouterA

# 配置RouterA的接口GE1/0/0的IPv6地址。
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RouterA
[RouterA]ipv6
[RouterA]interface GigabitEthernet 0/0/0
[RouterA-GigabitEthernet0/0/0]ipv6 enable
[RouterA-GigabitEthernet0/0/0]ipv6 address 2001::1/64
# 配置RouterA的邻居发现功能。
[RouterA-GigabitEthernet0/0/0]undo ipv6 nd ra halt
[RouterA-GigabitEthernet0/0/0]quit

配置RouterB
system-view
[Huawei]sysname RouterB
[RouterB] ipv6
[RouterB]interface GigabitEthernet 0/0/0
[RouterB-GigabitEthernet0/0/0]ipv6 enable
[RouterB-GigabitEthernet0/0/0]ipv6 address auto link-local
[RouterB-GigabitEthernet0/0/0]ipv6 address auto global
[RouterB-GigabitEthernet0/0/0]quit

验证配置结果

如果配置成功,可以查看配置的全球单播地址,以及接口状态为Up,IPv6协议状态为Up,并可以查看接口的邻居情况。

# 查看RouterA的接口信息。
[RouterA]display ipv6 interface GigabitEthernet 0/0/0
GigabitEthernet0/0/0 current state : UP
IPv6 protocol current state : UP
IPv6 is enabled, link-local address is FE80::2E0:FCFF:FE1B:2E4D
Global unicast address(es):
2001::1, subnet is 2001::/64
Joined group address(es):
FF02::1:FF00:1
FF02::2
FF02::1
FF02::1:FF1B:2E4D
MTU is 1500 bytes
ND DAD is enabled, number of DAD attempts: 1
ND reachable time is 30000 milliseconds
ND retransmit interval is 1000 milliseconds
ND advertised reachable time is 0 milliseconds
ND advertised retransmit interval is 0 milliseconds
ND router advertisement max interval 600 seconds, min interval 200 seconds
ND router advertisements live for 1800 seconds
ND router advertisements hop-limit 64
ND default router preference medium
Hosts use stateless autoconfig for addresses

# 查看RouterB的接口信息。
[RouterB]display ipv6 interface GigabitEthernet 0/0/0
GigabitEthernet0/0/0 current state : UP
IPv6 protocol current state : UP
IPv6 is enabled, link-local address is FE80::2E0:FCFF:FEAE:5A00
Global unicast address(es):
2001::2E0:FCFF:FEAE:5A00,
subnet is 2001::/64 [SLAAC 1970-01-01 00:05:10 2592000S]
Joined group address(es):
FF02::1:FFAE:5A00
FF02::2
FF02::1
MTU is 1500 bytes
ND DAD is enabled, number of DAD attempts: 1
ND reachable time is 30000 milliseconds
ND retransmit interval is 1000 milliseconds
Hosts use stateless autoconfig for addresses

特别需要留意的是,大家在配置RouterA的IPV6的地址的时候,一定要注意掩码位,“对于IPv6单播地址来说,如果地址的前三bit不是000,则接口标识必须为64位;如果地址的前三位是000,则没有此限制。”这个是华为官方文档里面的,之所以引用,是因为如果掩码大于64位,您在做这个实验的时候地址效果出不来.

标签: 无

发表评论: