路由器故障:OSPF配置错误导致网络无法ping通
创始人
2024-07-25 22:41:46
0

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  

相关内容

热门资讯

如何允许远程连接到MySQL数... [[277004]]【51CTO.com快译】默认情况下,MySQL服务器仅侦听来自localhos...
如何利用交换机和端口设置来管理... 在网络管理中,总是有些人让管理员头疼。下面我们就将介绍一下一个网管员利用交换机以及端口设置等来进行D...
施耐德电气数据中心整体解决方案... 近日,全球能效管理专家施耐德电气正式启动大型体验活动“能效中国行——2012卡车巡展”,作为该活动的...
20个非常棒的扁平设计免费资源 Apple设备的平面图标PSD免费平板UI 平板UI套件24平图标Freen平板UI套件PSD径向平...
德国电信门户网站可实时显示全球... 德国电信周三推出一个门户网站,直观地实时提供其安装在全球各地的传感器网络检测到的网络攻击状况。该网站...
为啥国人偏爱 Mybatis,... 关于 SQL 和 ORM 的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行...
《非诚勿扰》红人闫凤娇被曝厕所... 【51CTO.com 综合消息360安全专家提醒说,“闫凤娇”、“非诚勿扰”已经被黑客盯上成为了“木...
2012年第四季度互联网状况报... [[71653]]  北京时间4月25日消息,据国外媒体报道,全球知名的云平台公司Akamai Te...