路由器故障:OSPF配置错误导致网络无法ping通

运维 网络运维
本文主要向大家介绍了由于OSPF配置错误导致网络无法ping通的故障的解决办法,希望以下的内容能够帮助大家。

OSPF配置错误导致网络无法ping通的故障的解决步骤如下:

网络环境

如下图的网络配置中,PC1-RouterA-RouterB-PC2之间通过2M线路相连,运行OSPF协议,并引入直连、静态路由。PC3-RouterA-RouterB-PC4之间模拟新增加的一条100M链路,运行OSPF协议,也引入直连和静态路由。RouterA和RouterB都在area0。

OSPF组网图

路由器故障:OSPF配置错误导致网络无法ping通

配置完成之后发现PC1与PC2之间能够Ping通,但是PC3与PC4之间却无法Ping通。

#p#

故障分析

步骤 1     在路由器RouterA上执行ping 30.1.1.1命令,能够Ping通,说明路由器A和B之间的物理链路没有问题。

具体RouterA为例:

 

  1. [RouterA] ping 30.1.1.1  
  2. PING 30.1.1.1: 56  data bytes, press CTRL_C to break  
  3. Reply from 30.1.1.1: bytes=56 Sequence=1 ttl=255 time=60 ms  
  4. Reply from 30.1.1.1: bytes=56 Sequence=2 ttl=255 time=80 ms  
  5. Reply from 30.1.1.1: bytes=56 Sequence=3 ttl=255 time=40 ms  
  6. Reply from 30.1.1.1: bytes=56 Sequence=4 ttl=255 time=80 ms  
  7. Reply from 30.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms  
  8. --- 30.1.1.1 ping statistics ---  
  9. 5 packet(s) transmitted  
  10. 5 packet(s) received  
  11. 0.00% packet loss  
  12. round-trip min/avg/max = 20/56/80 ms 

 

步骤 2     在RouterA、RouterB上执行display ospf routing,发现没有RouterB上没有PC3所在网段的路由信息。

以RouterB的具体显示为例。

 

  1. [RouterB] display  ospf routing  
  2.    
  3. OSPF Process 1 with Router ID 100.1.1.2  
  4. Routing Tables  
  5.    
  6. Routing for Network  
  7. Destination        Cost  Type       NextHop         AdvRouter       Area  
  8. 30.1.1.0/24        3124  Stub       20.1.1.2        200.1.1.2       0.0.0.0  
  9. 200.1.1.0/24       3124  Stub       20.1.1.2        200.1.1.2       0.0.0.0  
  10. 20.1.1.0/24        1562  Stub       20.1.1.1        100.1.1.2       0.0.0.0  
  11. 10.1.1.0/24        1562  Stub       10.1.1.2        100.1.1.2       0.0.0.0  
  12.    
  13. Routing for ASEs  
  14. Destination        Cost      Type       Tag         NextHop         AdvRouter  
  15. 20.1.1.1/32        1         Type2      1           20.1.1.2        200.1.1.2  
  16. 30.1.1.2/32        1         Type2      1           20.1.1.2        200.1.1.2  
  17. 200.1.1.1/32       1         Type2      1           20.1.1.2        200.1.1.2  
  18.    
  19. Total Nets: 7  
  20. Intra Area: 4  Inter Area: 0  ASE: 3  NSSA: 0 

 

步骤 3     在RouterA和RouterB上执行display ospf peer命令,发现RouterA和PC3没有建立OSPF邻居。

RouterA具体显示。

 

  1. [RouterA] display ospf peer  
  2.    
  3. OSPF Process 1 with Router ID 100.1.1.2  
  4. Neighbors  
  5.    
  6. Area 0.0.0.0 interface 10.1.1.2(Gigabitethernet 1/0/0)'s neighbors  
  7. Router ID: 10.1.1.1         Address: 10.1.1.1  
  8. State: Full  Mode:Nbr is  Slave  Priority: 1  
  9. DR: None   BDR: None   MTU: 0  
  10. Dead timer due in 41  sec  
  11. Neighbor is up for 00:46:52  
  12. Authentication Sequence: [ 0 ]  
  13.    
  14. Neighbors  
  15.    
  16. Area 0.0.0.0 interface 20.1.1.1(Gigabitethernet1/0/1)'s neighbors  
  17. Router ID: 200.1.1.2        Address: 20.1.1.2  
  18. State: Full  Mode:Nbr is  Master  Priority: 1  
  19. DR: None   BDR: None   MTU: 0  
  20. Dead timer due in 36  sec  
  21. Neighbor is up for 00:42:29  
  22. Authentication Sequence: [ 0 ] 

 

步骤 4     在RouterA和RouterB上分别执行display current-configuration configuration ospf命令,对比发现在RouterA上没有用network命令将PC4所在100.1.1.0/24网段发布出去。

RouterA具体显示。

 

  1. [RouterA] display current-configuration configuration ospf  
  2. #  
  3. ospf 1  
  4. import-route direct  
  5. import-route static  
  6. area 0.0.0.0  
  7. network 10.1.1.0 0.0.0.255  
  8. network 20.1.1.0 0.0.0.255  

 

RouterB具体显示。

 

  1. [RouterB] display current-configuration configuration ospf  
  2. #  
  3. ospf 1  
  4. import-route direct  
  5. import-route static  
  6. area 0.0.0.0  
  7. network 20.1.1.0 0.0.0.255  
  8. network 30.1.1.0 0.0.0.255  
  9. network 200.1.1.0 0.0.0.255  
  10. #  
  11. return 

 

步骤 5     在RouterA上配置network 100.1.1.0 0.0.0.255,然后执行display ospf peer命令,和PC3的OSPF邻居建立,在PC3上Ping PC4的IP地址200.1.1.1,能够Ping通。

具体PC3的显示。

 

  1. [RouterA] display ospf peer  
  2. OSPF Process 1 with Router ID 100.1.1.1  
  3.  
  4. Neighbors  
  5.  
  6. Area 0.0.0.0 interface 100.1.1.1(Gigabitethernet6/0/0)'s neighbors  
  7. Router ID: 100.1.1.2        Address: 100.1.1.2  
  8. State: Full  Mode:Nbr is  Master  Priority: 1  
  9. DR: None   BDR: None   MTU: 0  
  10. Dead timer due in 34  sec  
  11. Neighbor is up for 00:09:36  
  12. Authentication Sequence: [ 0 ]  
  13. [PC3] ping 200.1.1.1  
  14. PING 200.1.1.1: 56  data bytes, press CTRL_C to break  
  15. Reply from 200.1.1.1: bytes=56 Sequence=1 ttl=253 time=70 ms  
  16. Reply from 200.1.1.1: bytes=56 Sequence=2 ttl=253 time=40 ms  
  17. Reply from 200.1.1.1: bytes=56 Sequence=3 ttl=253 time=100 ms  
  18. Reply from 200.1.1.1: bytes=56 Sequence=4 ttl=253 time=70 ms  
  19. Reply from 200.1.1.1: bytes=56 Sequence=5 ttl=253 time=100 ms  
  20.  
  21. --- 200.1.1.1 ping statistics ---  
  22. 5 packet(s) transmitted  
  23. 5 packet(s) received  
  24. 0.00% packet loss  
  25. round-trip min/avg/max = 40/76/100 ms 

 

故障解决。

在构建OSPF网络时,只有对链路的正确宣告,路由器才会建立邻居关系,根据LSA计算得出转发路径。

----结束

#p#

处理步骤

在RouterA执行以下操作:

步骤 1     执行命令system-view,进入系统视图。

步骤 2     执行命令ospf [ process-id ],进入OSPF进程视图。

步骤 3     执行命令area area-id,进入OSPF区域视图。

步骤 4     执行命令network ip-address wildcard-mask,配置区域所包含的网段。

步骤 5     执行命令return退回到用户视图,执行命令save,保存对配置的修改。

具体以RouterA的显示为例。

 

  1. [RouterA] ospf 1  
  2. [RouterA-ospf-1] area 0  
  3. [RouterA-ospf-1-area-0.0.0.0] network 100.1.1.0 0.0.0.255  
  4. [RouterA-ospf-1-area-0.0.0.0] quit  
  5. [RouterA-ospf-1] quit  
  6. [RouterA] display ospf peer  
  7. OSPF Process 1 with Router ID 100.1.1.2  
  8.  
  9. Neighbors  
  10.  
  11. Area 0.0.0.0 interface 10.1.1.2(Gigabitethernet1/0/0)'s neighbors  
  12. Router ID: 10.1.1.1         Address: 10.1.1.1  
  13. State: Full  Mode:Nbr is  Slave  Priority: 1  
  14. DR: None   BDR: None   MTU: 0  
  15. Dead timer due in 38  sec  
  16. Neighbor is up for 01:05:56  
  17. Authentication Sequence: [ 0 ]  
  18.  
  19. Neighbors  
  20.  
  21. Area 0.0.0.0 interface 20.1.1.1(Gigabitethernet1/0/1)'s neighbors  
  22. Router ID: 200.1.1.2        Address: 20.1.1.2  
  23. State: Full  Mode:Nbr is  Master  Priority: 1  
  24. DR: None   BDR: None   MTU: 0  
  25. Dead timer due in 41  sec  
  26. Neighbor is up for 01:01:33  
  27. Authentication Sequence: [ 0 ]  
  28.  
  29. Neighbors  
  30.  
  31. Area 0.0.0.0 interface 100.1.1.2(Gigabitethernet1/0/2)'s neighbors  
  32. Router ID: 100.1.1.1        Address: 100.1.1.1  
  33. State: Full  Mode:Nbr is  Slave  Priority: 1  
  34. DR: None   BDR: None   MTU: 0  
  35. Dead timer due in 31  sec  
  36. Neighbor is up for 00:00:06  
  37. Authentication Sequence: [ 0 ] 

 

----结束

完成上述操作后,PC3能够PING通PC4,故障排除。

案例总结

在构建OSPF网络时,只有对链路的正确宣告,路由器才会建立邻居关系,根据LSA计算得出转发路径。

直连路由的引入只能发生在网络的末端,即叶节点,它不作为SPF计算的一部分,因此不能误认为直连路由的引入就等同于对链路的宣告。

【编辑推荐】

  1. 路由器故障:策略路由配置不生效 
  2. 路由器故障:POS接口修改MTU值无法生效
  3. 路由器故障:POS接口无法收到对端的报文
  4. 路由器故障:ACL反掩码配置错误 策略路由失效
  5. 路由器故障:MP Group成员接口状态频繁Up/Down  
责任编辑:佚名 来源: 51CTO
相关推荐

2011-04-08 18:17:40

路由OSPF

2009-12-16 14:28:56

路由器配置

2011-04-08 18:10:31

路由

2011-04-08 17:24:34

OSPF路由

2011-03-30 16:27:07

POS接口OSPF

2011-04-11 16:29:31

OSPF

2011-04-08 17:42:13

OSPFOSPF邻居

2011-03-30 14:42:02

CPOS接口路由器MTU

2010-08-25 10:24:40

2011-04-11 16:36:45

OSPF路由

2011-04-08 17:53:33

OSPF

2009-12-16 11:01:37

路由器配置

2011-04-08 18:01:58

路由

2011-04-08 17:49:23

OSPF路由

2011-04-08 14:53:55

ACL

2010-09-14 15:15:47

2011-03-30 15:18:22

POS接口

2011-04-11 16:04:38

BGPOSPF

2011-04-08 18:05:31

2011-04-06 17:19:20

ACL
点赞
收藏

51CTO技术栈公众号