路由器故障:OSPF配置錯(cuò)誤導(dǎo)致網(wǎng)絡(luò)無法ping通
OSPF配置錯(cuò)誤導(dǎo)致網(wǎng)絡(luò)無法ping通的故障的解決步驟如下:
網(wǎng)絡(luò)環(huán)境
如下圖的網(wǎng)絡(luò)配置中,PC1-RouterA-RouterB-PC2之間通過2M線路相連,運(yùn)行OSPF協(xié)議,并引入直連、靜態(tài)路由。PC3-RouterA-RouterB-PC4之間模擬新增加的一條100M鏈路,運(yùn)行OSPF協(xié)議,也引入直連和靜態(tài)路由。RouterA和RouterB都在area0。
OSPF組網(wǎng)圖
配置完成之后發(fā)現(xiàn)PC1與PC2之間能夠Ping通,但是PC3與PC4之間卻無法Ping通。
#p#
故障分析
步驟 1 在路由器RouterA上執(zhí)行ping 30.1.1.1命令,能夠Ping通,說明路由器A和B之間的物理鏈路沒有問題。
具體RouterA為例:
- [RouterA] ping 30.1.1.1
- PING 30.1.1.1: 56 data bytes, press CTRL_C to break
- Reply from 30.1.1.1: bytes=56 Sequence=1 ttl=255 time=60 ms
- Reply from 30.1.1.1: bytes=56 Sequence=2 ttl=255 time=80 ms
- Reply from 30.1.1.1: bytes=56 Sequence=3 ttl=255 time=40 ms
- Reply from 30.1.1.1: bytes=56 Sequence=4 ttl=255 time=80 ms
- Reply from 30.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms
- --- 30.1.1.1 ping statistics ---
- 5 packet(s) transmitted
- 5 packet(s) received
- 0.00% packet loss
- round-trip min/avg/max = 20/56/80 ms
步驟 2 在RouterA、RouterB上執(zhí)行display ospf routing,發(fā)現(xiàn)沒有RouterB上沒有PC3所在網(wǎng)段的路由信息。
以RouterB的具體顯示為例。
- [RouterB] display ospf routing
- OSPF Process 1 with Router ID 100.1.1.2
- Routing Tables
- Routing for Network
- Destination Cost Type NextHop AdvRouter Area
- 30.1.1.0/24 3124 Stub 20.1.1.2 200.1.1.2 0.0.0.0
- 200.1.1.0/24 3124 Stub 20.1.1.2 200.1.1.2 0.0.0.0
- 20.1.1.0/24 1562 Stub 20.1.1.1 100.1.1.2 0.0.0.0
- 10.1.1.0/24 1562 Stub 10.1.1.2 100.1.1.2 0.0.0.0
- Routing for ASEs
- Destination Cost Type Tag NextHop AdvRouter
- 20.1.1.1/32 1 Type2 1 20.1.1.2 200.1.1.2
- 30.1.1.2/32 1 Type2 1 20.1.1.2 200.1.1.2
- 200.1.1.1/32 1 Type2 1 20.1.1.2 200.1.1.2
- Total Nets: 7
- Intra Area: 4 Inter Area: 0 ASE: 3 NSSA: 0
步驟 3 在RouterA和RouterB上執(zhí)行display ospf peer命令,發(fā)現(xiàn)RouterA和PC3沒有建立OSPF鄰居。
RouterA具體顯示。
- [RouterA] display ospf peer
- OSPF Process 1 with Router ID 100.1.1.2
- Neighbors
- Area 0.0.0.0 interface 10.1.1.2(Gigabitethernet 1/0/0)'s neighbors
- Router ID: 10.1.1.1 Address: 10.1.1.1
- State: Full Mode:Nbr is Slave Priority: 1
- DR: None BDR: None MTU: 0
- Dead timer due in 41 sec
- Neighbor is up for 00:46:52
- Authentication Sequence: [ 0 ]
- Neighbors
- Area 0.0.0.0 interface 20.1.1.1(Gigabitethernet1/0/1)'s neighbors
- Router ID: 200.1.1.2 Address: 20.1.1.2
- State: Full Mode:Nbr is Master Priority: 1
- DR: None BDR: None MTU: 0
- Dead timer due in 36 sec
- Neighbor is up for 00:42:29
- Authentication Sequence: [ 0 ]
步驟 4 在RouterA和RouterB上分別執(zhí)行display current-configuration configuration ospf命令,對比發(fā)現(xiàn)在RouterA上沒有用network命令將PC4所在100.1.1.0/24網(wǎng)段發(fā)布出去。
RouterA具體顯示。
- [RouterA] display current-configuration configuration ospf
- #
- ospf 1
- import-route direct
- import-route static
- area 0.0.0.0
- network 10.1.1.0 0.0.0.255
- network 20.1.1.0 0.0.0.255
- #
RouterB具體顯示。
- [RouterB] display current-configuration configuration ospf
- #
- ospf 1
- import-route direct
- import-route static
- area 0.0.0.0
- network 20.1.1.0 0.0.0.255
- network 30.1.1.0 0.0.0.255
- network 200.1.1.0 0.0.0.255
- #
- return
步驟 5 在RouterA上配置network 100.1.1.0 0.0.0.255,然后執(zhí)行display ospf peer命令,和PC3的OSPF鄰居建立,在PC3上Ping PC4的IP地址200.1.1.1,能夠Ping通。
具體PC3的顯示。
- [RouterA] display ospf peer
- OSPF Process 1 with Router ID 100.1.1.1
- Neighbors
- Area 0.0.0.0 interface 100.1.1.1(Gigabitethernet6/0/0)'s neighbors
- Router ID: 100.1.1.2 Address: 100.1.1.2
- State: Full Mode:Nbr is Master Priority: 1
- DR: None BDR: None MTU: 0
- Dead timer due in 34 sec
- Neighbor is up for 00:09:36
- Authentication Sequence: [ 0 ]
- [PC3] ping 200.1.1.1
- PING 200.1.1.1: 56 data bytes, press CTRL_C to break
- Reply from 200.1.1.1: bytes=56 Sequence=1 ttl=253 time=70 ms
- Reply from 200.1.1.1: bytes=56 Sequence=2 ttl=253 time=40 ms
- Reply from 200.1.1.1: bytes=56 Sequence=3 ttl=253 time=100 ms
- Reply from 200.1.1.1: bytes=56 Sequence=4 ttl=253 time=70 ms
- Reply from 200.1.1.1: bytes=56 Sequence=5 ttl=253 time=100 ms
- --- 200.1.1.1 ping statistics ---
- 5 packet(s) transmitted
- 5 packet(s) received
- 0.00% packet loss
- round-trip min/avg/max = 40/76/100 ms
故障解決。
在構(gòu)建OSPF網(wǎng)絡(luò)時(shí),只有對鏈路的正確宣告,路由器才會建立鄰居關(guān)系,根據(jù)LSA計(jì)算得出轉(zhuǎn)發(fā)路徑。
----結(jié)束
#p#
處理步驟
在RouterA執(zhí)行以下操作:
步驟 1 執(zhí)行命令system-view,進(jìn)入系統(tǒng)視圖。
步驟 2 執(zhí)行命令ospf [ process-id ],進(jìn)入OSPF進(jìn)程視圖。
步驟 3 執(zhí)行命令area area-id,進(jìn)入OSPF區(qū)域視圖。
步驟 4 執(zhí)行命令network ip-address wildcard-mask,配置區(qū)域所包含的網(wǎng)段。
步驟 5 執(zhí)行命令return退回到用戶視圖,執(zhí)行命令save,保存對配置的修改。
具體以RouterA的顯示為例。
- [RouterA] ospf 1
- [RouterA-ospf-1] area 0
- [RouterA-ospf-1-area-0.0.0.0] network 100.1.1.0 0.0.0.255
- [RouterA-ospf-1-area-0.0.0.0] quit
- [RouterA-ospf-1] quit
- [RouterA] display ospf peer
- OSPF Process 1 with Router ID 100.1.1.2
- Neighbors
- Area 0.0.0.0 interface 10.1.1.2(Gigabitethernet1/0/0)'s neighbors
- Router ID: 10.1.1.1 Address: 10.1.1.1
- State: Full Mode:Nbr is Slave Priority: 1
- DR: None BDR: None MTU: 0
- Dead timer due in 38 sec
- Neighbor is up for 01:05:56
- Authentication Sequence: [ 0 ]
- Neighbors
- Area 0.0.0.0 interface 20.1.1.1(Gigabitethernet1/0/1)'s neighbors
- Router ID: 200.1.1.2 Address: 20.1.1.2
- State: Full Mode:Nbr is Master Priority: 1
- DR: None BDR: None MTU: 0
- Dead timer due in 41 sec
- Neighbor is up for 01:01:33
- Authentication Sequence: [ 0 ]
- Neighbors
- Area 0.0.0.0 interface 100.1.1.2(Gigabitethernet1/0/2)'s neighbors
- Router ID: 100.1.1.1 Address: 100.1.1.1
- State: Full Mode:Nbr is Slave Priority: 1
- DR: None BDR: None MTU: 0
- Dead timer due in 31 sec
- Neighbor is up for 00:00:06
- Authentication Sequence: [ 0 ]
----結(jié)束
完成上述操作后,PC3能夠PING通PC4,故障排除。
案例總結(jié)
在構(gòu)建OSPF網(wǎng)絡(luò)時(shí),只有對鏈路的正確宣告,路由器才會建立鄰居關(guān)系,根據(jù)LSA計(jì)算得出轉(zhuǎn)發(fā)路徑。
直連路由的引入只能發(fā)生在網(wǎng)絡(luò)的末端,即葉節(jié)點(diǎn),它不作為SPF計(jì)算的一部分,因此不能誤認(rèn)為直連路由的引入就等同于對鏈路的宣告。
【編輯推薦】