IPV6

[Huawei]ipv6

[Huawei]ospfv3 1                                                                              ospf进程号1       

[Huawei-ospfv3-1]router-id 1.1.1.1                                                   ID1.1.1.1

[Huawei-ospfv3-1]import-route direct                                                                               引入直连路由

[Huawei-ospfv3-1]import-route direct                                              引入静态

[Huawei-GigabitEthernet0/0/0]ipv6 enable                                       开启IPV6

[Huawei-GigabitEthernet0/0/0]ipv6 address 2001::1/64                   配置IPV6地址

[Huawei-GigabitEthernet0/0/0]ospfv3 1 area 0.0.0.0                        此接口配置属于进程号1的区域0

虚链路

[Huawei-ospfv3-1-area-0.0.0.0]vlink-peer 1.1.1.1                             虚链路配置指向1.1.1.1

[Huawei-ospfv3-1-area-0.0.0.0]vlink-peer 2.2.2.2                             指向2.2.2.2(两个路由器需要互指)


[Huawei]dis ipv6 int b                                                                       查看IPV6地址

[Huawei]nssa                                                                                     配置NSSA区域

[Huawei]stub                                                                                     配置STUB区域

[Huawei]nssa default-route-advertise  //将Area1设置为NSSA区域,并在ABR上配置产生缺省的Type7 LSA到NSSA区域




IPV4

[Huawei]ospf
1

[Huawei-ospf-1]area
0.0.0.0

[Huawei-ospf-1-area-0.0.0.0]authentication-mode simple plain
def    
//配置OSPF区域的验证模式为简单验证,明文口令为def

[Huawei-ospf-1-area-0.0.0.0]network 192.168.0.0 0.0.0.255     //指定运行OSPF 2协议的接口的IP地址位于192.168.0.0/24网段,接口所属的区域为area 0

[Huawei-ospf-1-area-0.0.0.0]area
0.0.0.1

[Huawei-ospf-1-area-0.0.0.1]authentication-mode
simple plain ghi

[Huawei-ospf-1-area-0.0.0.0]network
192.168.1.0 0.0.0.255

虚链路

[Huawei-ospf-1-area-0.0.0.0]vlink-peer
2.2.2.2          

[Huawei-ospf-1-area-0.0.0.0]vlink-peer 1.1.1.1                              
两个地址互指向(口令有没有无所谓)

[Huawei-ospf-1-area-0.0.0.0]vlink-peer 2.2.2.2 simple plain abc  //创建对端路由器ID为2.2.2.2的虚连接,并配置为简单验证模式且明文口令为abc

[Huawei-ospf-1-area-0.0.0.0]vlink-peer 1.1.1.1 simple plain
abc
     


正常IPV4的OSPF配置

[Huawei]ospf
2

[Huawei-ospf-1]area
0.0.0.0

[Huawei-ospf-1-0.0.0.0]network
192.168.2.0 0.0.0.255

[Huawei-ospf-1-0.0.0.0]network
192.168.0.0 0.0.0.255


[Huawei]ospf
router-id 1.1.1.1

[Huawei-ospf-1]area
0.0.0.0

[Huawei-ospf-1-area-0.0.0.0]network
1.1.1.1