OSPF加深测试

 测试编号:OSPF-4

测试项目:OSPF的邻居建立

测试子项目:影响OSPF邻居建立的因素

测试拓扑:


测试过程;开启OSPF

测试方法1

R5(config)#router ospf 1

R5(config-router)#network 172.16.5.0 0.0.0.3 ar 0

R2(config)#router ospf 1

R2(config-router)#network 172.16.5.0 0.0.0.3 ar 1

测试1的结果:

R2#show ip ospf neighbor

 

R2#

*Mar  1 00:15:37.335: %OSPF-4-ERRRCV: Received invalid packet: mismatch area ID, from backbone area must be virtual-link but not found from 172.16.5.1, FastEthernet0/1

Area ID不一致,不能建立邻居

 

测试方法2

R5(config)#router ospf 1

R5(config-router)#router-id 172.16.0.5

R2(config)#router ospf 1

R2(config-router)#router-id 172.16.0.5

测试2的结果:

R2#show ip ospf neighbor

 

R2#

*Mar  1 00:21:37.075: %OSPF-4-DUP_RTRID_NBR: OSPF detected duplicate router-id 172.16.0.5 from 172.16.5.1 on interface FastEthernet0/1

Router-id 重复,不能建立邻居

 

测试方法3

R5(config)#router ospf 1

R5(config-router)#router-id 172.16.0.5

R5(config-router)#network 172.16.5.0 0.0.0.3 ar 1

R5(config-router)#area 1 stub

R2(config)#router ospf 1

R2(config-router)#router-id 172.16.0.2

R2(config-router)#network 172.16.2.0 0.0.0.3 ar 0

R2(config-router)#network 172.16.5.0 0.0.0.3 ar 1

R2(config-router)#area 2 stub

测试3的结果:

R2#show ip ospf nei

 

Neighbor ID     Pri   State           Dead Time   Address         Interface

172.16.0.1        1   FULL/DR         00:00:34    172.16.2.2      FastEthernet0/0

172.16.0.5       1   DOWN/DROTHER       -      172.16.5.1      FastEthernet0/1

R2#

*Mar  1 00:48:20.731: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.0.5 on FastEthernet0/1 from FULL to DOWN, Neighbor Down: Adjacency forced to reset

 

测试方法4

R5(config)#router ospf 1

R5(config-router)#router-id 172.16.0.5

R5(config-router)#network 172.16.5.0 0.0.0.3 ar 1

R5(config-router)#area 1 nssa

R2(config)#router ospf 1

R2(config-router)#router-id 172.16.0.2

R2(config-router)#network 172.16.2.0 0.0.0.3 ar 0

R2(config-router)#network 172.16.5.0 0.0.0.3 ar 1

R2(config-router)#area 2 nssa

测试4的结果:

R2#show ip ospf nei

 

Neighbor ID     Pri   State           Dead Time   Address         Interface

172.16.0.1        1   FULL/DR         00:00:33    172.16.2.2      FastEthernet0/0

172.16.0.5       1   DOWN/DROTHER       -      172.16.5.1      FastEthernet0/1

 

*Mar  1 00:48:20.731: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.0.5 on FastEthernet0/1 from FULL to DOWN, Neighbor Down: Adjacency forced to reset

StubNSSA配置不一致,不能建立邻居

 

 

测试方法5

R5(config)#inter f0/0

R5(config-if)#ip add 172.16.5.1 255.255.255.240

R5(config-if)#exit

R5(config)#router ospf 1

R5(config-router)#router-id 172.16.0.5

R5(config-router)#network 172.16.5.0 0.0.0.15 ar 1

R2(config)#router ospf 1

R2(config-router)#router-id 172.16.0.2

R2(config-router)#network 172.16.5.0 0.0.0.3 ar 1

测试5的结果:

R5#show ip ospf neighbor

 

*Mar  1 01:08:35.427: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.0.2 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached

子网掩码不一致,不能建立邻居

 

测试方法6

R5(config)#inter f0/0

R5(config-if)#ip add 172.16.5.1 255.255.255.252

R5(config-if)#ip ospf network point-to-point

R5(config-if)#exit

R5(config)#router ospf 1

R5(config-router)#router-id 172.16.0.5

R5(config-router)#network 172.16.5.0 0.0.0.3ar 1

R2(config)#interface FastEthernet0/1

R2(config-if)#ip address 172.16.5.2 255.255.255.252

R2(config-if)#ip ospf network broadcast

R2(config-if)#exit

R2(config)#router ospf 1

R2(config-router)#router-id 172.16.0.2

R2(config-router)#network 172.16.5.0 0.0.0.3 ar 1

测试6的结果:

R5#show ip ospf neighbor

 

Neighbor ID     Pri   State           Dead Time   Address         Interface

172.16.0.2        0   FULL/  -        00:00:34    172.16.5.2      FastEthernet0/0

 

R2# show ip ospf neighbor

 

Neighbor ID     Pri   State           Dead Time   Address         Interface

172.16.0.1        1   FULL/DR         00:00:34    172.16.2.2      FastEthernet0/0

172.16.0.5        1   FULL/DR         00:00:30    172.16.5.1      FastEthernet0/1

 

点对点类型与广播类型,可以建立邻居

 

测试方法7

R5(config)#inter f0/0

R5(config-if)#ip add 172.16.5.1 255.255.255.252

R5(config-if)#ip ospf network point-to-point

R5(config-if)#exit

R5(config)#router ospf 1

R5(config-router)#router-id 172.16.0.5

R5(config-router)#network 172.16.5.0 0.0.0.3ar 1

R2(config)#interface FastEthernet0/1

R2(config-if)#ip address 172.16.5.2 255.255.255.252

R2(config-if)#ip ospf network non-broadcast

R2(config-if)#exit

测试7的结果:

R2#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface

172.16.0.1        1   FULL/DR         00:00:35    172.16.2.2      FastEthernet0/0

 

点对点类型与非广播类型,不可以建立邻居

 

测试方法8

R5(config)#inter f0/0

R5(config-if)#ip add 172.16.5.1 255.255.255.252

R5(config-if)#ip ospf network point-to-point

R5(config-if)#exit

R5(config)#router ospf 1

R5(config-router)#router-id 172.16.0.5

R5(config-router)#network 172.16.5.0 0.0.0.3ar 1

R2(config)#interface FastEthernet0/1

R2(config-if)#ip address 172.16.5.2 255.255.255.252

R2(config-if)# ip ospf network point-to-multipoint

R2(config-if)#exit

测试8的结果:

 

 

*Mar  1 01:42:18.663: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.0.5 on FastEthernet0/1 from FULL to DOWN, Neighbor Down: Interface down or detached

 

点对点类型与点对多点类型,不可以建立邻居

测试方法9

R5(config)#inter f0/0

R5(config-if)#ip add 172.16.5.1 255.255.255.252

R5(config-if)#ip ospf network broadcast

R5(config-if)#exit

R5(config)#router ospf 1

R5(config-router)#router-id 172.16.0.5

R5(config-router)#network 172.16.5.0 0.0.0.3ar 1

R2(config)#interface FastEthernet0/1

R2(config-if)#ip address 172.16.5.2 255.255.255.252

R2(config-if)#ip ospf network point-to-multipoint

R2(config-if)#exit

测试9的结果:

R5#show ip ospf nei

 

Neighbor ID     Pri   State           Dead Time   Address         Interface

172.16.0.2        1   FULL/BDR        00:00:03    172.16.5.2      FastEthernet0/0

R2#show ip ospf nei

 

Neighbor ID     Pri   State           Dead Time   Address         Interface

172.16.0.1        1   FULL/DR         00:00:34    172.16.2.2      FastEthernet0/0

172.16.0.5        0   FULL/  -        00:00:03    172.16.5.1      FastEthernet0/1

 

广播多路访问类型与点对多点类型,可以建立邻居

 

point-to-point 点对点类型

point-to-multipoint 点对多点类型

broadcast 广播多路访问类型

non-broadcast 非广播多路访问类型

 

网络类型不一致,有可能建立邻居

测试方法10

R5(config)#inter f0/0

R5(config-if)#ip ospf hello-interval 2

R2(config)#interface FastEthernet0/1

R2(config-if)#ip ospf hello-interval 1

测试10的结果:

R5#show ip ospf neighbor

 

*Mar  1 02:05:12.279: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.0.2 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired

 

Hello时间不一致,不能建立邻居

Hello时间<1-65535>s

 

测试方法11

R5(config)#inter f0/0

R5(config-if)# ip ospf dead-interval 10

R2(config)#interface FastEthernet0/1

R2(config-if)# ip ospf dead-interval 15

测试11的结果:

R5#show ip ospf neighbor

 

*Mar  1 02:19:00.255: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.0.2 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired

 

死亡时间不一致,不能建立邻居

死亡时间<1-65535>s

 

预期结果:常见OSPF邻居不能建立的原因

(1)       Area ID不一致;Router-id 重复

(2)       StubNSSA配置不一致

(3)       子网掩码不一致

(4)       网络类型不一致

(5)       Hello时间、Down时间不一致

(6)       DR选举问题

(7)       MTU不一致

(8)       OSPF邻居认证问题

测试结果:

(1)    Area ID不一致;Router-id 重复

(2)    StubNSSA配置不一致

(3)    子网掩码不一致

(4)    Hello时间、Down时间不一致

(5)    DR选举问题

(6)    MTU不一致

(7)    OSPF邻居认证问题

本文出自 “�拇恕⒁葬�” 博客,谢绝转载!

你可能感兴趣的:(问题,测试,项目,休闲,ospf)