OSPF协议是为IP协议提供路由功能的路由协议。OSPFv2(OSPF版本2)是支持IPv4的路由协议,为了让OSPF协议支持IPv6,技术人员开发了OSPFv3(OSPF版本3)。
无论是OSPFv2还是OSPFv3,OSPF协议的基本运行原理是没有区别的,然而,由于IPv4和IPv6协议意义的不同,地址空间大小的不同,它们之间的不同之处也是必然存在的。
本章内容介绍了OSPFv3协议的基本配置,通过本课程的学习将使学员掌握华为OSPFv3配置方法。
掌握OSPFv3的基本配置功能。
在R1、R2和R3上启用OSPFv3路由协议。R1和R2引入外部直连路由来与PC互联,要求PC与能够与PC2互访。
1.配置PC1、PC2、R1、R2及R3的IPv6地址,使直连设备可以进行相互通信;
2.在R1、R2和R3上配置OSPFv3,使R1、R2和R3可以进行互访;
3.在R1和R2的OSPFv3进程内引入直连路由,使得PC1能够与PC2互访。
1.1.1 配置步骤
步骤 1在路由器上开启IPv6功能,配置IPv6地址。
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1] ipv6
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ipv6 enable
[R1-GigabitEthernet0/0/1]ipv6 address 2000::1 64
[R1-GigabitEthernet0/0/1]quit
[R1]interface GigabitEthernet 0/0/2
[R1-GigabitEthernet0/0/2]ipv6 enable
[R1-GigabitEthernet0/0/2]ipv6 address 2003::1 64
[R1-GigabitEthernet0/0/2]quit
[R1]
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2] ipv6
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ipv6 enable
[R2-GigabitEthernet0/0/1]ipv6 address 2001::2 64
[R2-GigabitEthernet0/0/1]quit
[R2]interface GigabitEthernet 0/0/2
[R2-GigabitEthernet0/0/2]ipv6 enable
[R2-GigabitEthernet0/0/2]ipv6 address 2004::1 64
[R2-GigabitEthernet0/0/2]quit
[R2]
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3] ipv6
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ipv6 enable
[R3-GigabitEthernet0/0/1]ipv6 address 2000::2 64
[R3-GigabitEthernet0/0/1]quit
[R3]interface GigabitEthernet 0/0/2
[R3-GigabitEthernet0/0/2]ipv6 enable
[R3-GigabitEthernet0/0/2]ipv6 address 2001::1 64
[R3-GigabitEthernet0/0/2]quit
[R3]
步骤 1配置OSPFv3协议
[R1]ospfv3 2
[R1-ospfv3-2]router-id 10.10.10.10
[R1-ospfv3-2]quit
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ospfv3 2 area 0
[R1-GigabitEthernet0/0/1]quit
[R1]
[R2]ospfv3 2
[R2-ospfv3-2]router-id 20.20.20.20
[R2-ospfv3-2]quit
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ospfv3 2 area 1
[R2-GigabitEthernet0/0/1]quit
[R2]
[R3]ospfv3 2
[R3-ospfv3-2]router-id 30.30.30.30
[R3-ospfv3-2]quit
[R3]
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ospfv3 2 area 0
[R3-GigabitEthernet0/0/1]quit
[R3]interface GigabitEthernet 0/0/2
[R3-GigabitEthernet0/0/2]ospfv3 2 area 1
[R3-GigabitEthernet0/0/2]quit
[R1]ospfv3 2
[R1-ospfv3-2]import-route direct
[R1-ospfv3-2]quit
[R2]ospfv3 2
[R2-ospfv3-2]import-route direct
[R2-ospfv3-2]quit
结果验证