用OSPF debug信息定位OSPF鄰居無法建立原因

2015/3/9 10:19:07點擊:
問題描述
我司設備在于CISCO設備對接時(shí),OSPF鄰接無法建立。
告警信息
在我司設備上(shàng)敲指令”display ospf peer brief” ,顯示: 

OSPF Process 10 with Router ID 10.1.1.1 
  Peer Statistic Information 
--------------------------------------------------------------------- 
Area Id          Interface                        Neighbor id      State    
--------------------------------------------------------------------- 
處理(lǐ)過程
以往的案例中,我們一般會(huì)根據産品手冊中提供的排障思路進行(xíng)檢測,在本次案例中我講抛磚引玉用另外一種思路(debug)來(lái)定位 
在系統中依次輸入指令, 
A. terminal monitor                   //使能終端顯示信息中心發送信息的功能 
B. terminal debugging                 //使能終端顯示Debug信息功能 
C. debugging ospf packet              //打開(kāi)ospf的debug開(kāi)關查看報文的收發情況 
我們可(kě)以看到下面的報文收發狀态, 
Mar  4 2015 14:41:26.937.1-05:13 Huawei RM/6/RMDEBUG: 
FileID: 0xd0178024 Line: 2236 Level: 0x20 
OSPF 10: RECV Packet. Interface: GigabitEthernet0/0/0 
Mar  4 2015 14:41:26.937.2-05:13 Huawei RM/6/RMDEBUG:  Source Address: 10.1.1.2 
Mar  4 2015 14:41:26.937.3-05:13 Huawei RM/6/RMDEBUG:  Destination Address: 224.0.0.5 
Mar  4 2015 14:41:26.937.4-05:13 Huawei RM/6/RMDEBUG:  Ver# 2, Type: 1 (Hello) 
Mar  4 2015 14:41:26.937.5-05:13 Huawei RM/6/RMDEBUG:  Length: 44, Router: 10.1.1.2 
Mar  4 2015 14:41:26.937.6-05:13 Huawei RM/6/RMDEBUG:  Area: 0.0.0.0, Chksum:e59c 
Mar  4 2015 14:41:26.937.7-05:13 Huawei RM/6/RMDEBUG:  AuType: 00 
Mar  4 2015 14:41:26.937.8-05:13 Huawei RM/6/RMDEBUG:  Key(ascii): * * * * * * * 
Mar  4 2015 14:41:26.937.9-05:13 Huawei RM/6/RMDEBUG:  Net Mask: 255.255.255.252 
Mar  4 2015 14:41:26.937.10-05:13 Huawei RM/6/RMDEBUG:  Hello Int: 10, Option: _E 
Mar  4 2015 14:41:26.937.11-05:13 Huawei RM/6/RMDEBUG:  Rtr Priority: 1, Dead Int: 40 
Mar  4 2015 14:41:26.937.12-05:13 Huawei RM/6/RMDEBUG:  DR: 10.1.1.2 
Mar  4 2015 14:41:26.937.13-05:13 Huawei RM/6/RMDEBUG:  BDR: 0.0.0.0 
Mar  4 2015 14:41:26.937.14-05:13 Huawei RM/6/RMDEBUG:  # Attached Neighbors: 0 

FileID: 0xd0178025 Line: 559 Level: 0x20 
OSPF 10: SEND Packet. Interface: GigabitEthernet0/0/0 
Mar  4 2015 14:41:35.207.2-05:13 Huawei RM/6/RMDEBUG:  Source Address: 10.1.1.1 
Mar  4 2015 14:41:35.207.3-05:13 Huawei RM/6/RMDEBUG:  Destination Address: 224.0.0.5 
Mar  4 2015 14:41:35.207.4-05:13 Huawei RM/6/RMDEBUG:  Ver# 2, Type: 1 (Hello) 
Mar  4 2015 14:41:35.207.5-05:13 Huawei RM/6/RMDEBUG:  Length: 44, Router: 10.1.1.1 
Mar  4 2015 14:41:35.207.6-05:13 Huawei RM/6/RMDEBUG:  Area: 0.0.0.0, Chksum: e56c 
Mar  4 2015 14:41:35.207.7-05:13 Huawei RM/6/RMDEBUG:  AuType: 00 
Mar  4 2015 14:41:35.207.8-05:13 Huawei RM/6/RMDEBUG:  Key(ascii): * * * * * * * 
Mar  4 2015 14:41:35.207.9-05:13 Huawei RM/6/RMDEBUG:  Net Mask:255.255.255.252 
Mar  4 2015 14:41:35.207.10-05:13 Huawei RM/6/RMDEBUG:  Hello Int: 20, Option: _E 
Mar  4 2015 14:41:35.207.11-05:13 Huawei RM/6/RMDEBUG:  Rtr Priority: 1, Dead Int: 80 
Mar  4 2015 14:41:35.207.12-05:13 Huawei RM/6/RMDEBUG:  DR: 10.1.1.1 
Mar  4 2015 14:41:35.207.13-05:13 Huawei RM/6/RMDEBUG:  BDR: 0.0.0.0 
Mar  4 2015 14:41:35.207.14-05:13 Huawei RM/6/RMDEBUG:  # Attached Neighbors: 0 
Mar  4 2015 14:41:35.207.15-05:13 Huawei RM/6/RMDEBUG: 
我們對比一下收發報文的異同,發現我們接收對端的hello報文間(jiān)隔為10S,我們發送的報文間(jiān)隔為20S,是兩端hello報文發送間(jiān)隔不同導緻鄰居關系無法建立。 
D. undo debuging all                         //關閉debug功能
根因
兩端hello報文發送間(jiān)隔不同導緻鄰居關系無法建立
解決方案
将我司設備hello報文間(jiān)隔調整為20S,問題解決。 

Interface GigabitEthernet0/0/0 
ospf timer hello 20
建議與總結

在處理(lǐ)故障問題時(shí),不防參考以下步驟進行(xíng)排查:

1. 檢查接口網段是否一緻

2. 檢查各接口的優先級是否有(yǒu)非零

3. 檢查各路由器(qì)的route id互不相同

4. 接口的timer等參數(shù)保持一緻

5. 接口的認證信息保持一緻

6. 檢查是否ospf報文能正确接收