本檔案將說明在廣播媒體(例如乙太網路和權杖環)上進行開放最短路徑優先(OSPF)的組態範例。命令show ip ospf interface檢驗OSPF是否預設以廣播網路型別在所有廣播媒體上運行。
本文檔的讀者應瞭解以下主題:
本檔案中的資訊適用於這些軟體和硬體版本。
兩台Cisco 2501路由器
Cisco IOS®軟體版本12.2(27)
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
您還可以將此配置用於至少具有一個乙太網、令牌環或FDDI介面的任何兩台路由器。
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
本節提供可用於設定本檔案中所述功能的資訊。
注意:要查詢有關本文檔使用的命令的其他資訊,請參閱OSPF命令或使用命令查詢工具(僅限註冊客戶)。
本檔案會使用此網路設定。
本檔案會使用這些設定。
Router1 |
---|
interface Loopback0 ip address 192.168.45.1 255.255.255.0 ! interface Ethernet0 ip address 10.10.10.1 255.255.255.0 ! router ospf 1 network 10.10.10.0 0.0.0.255 area 0 !--- OSPF is configured to run on the !--- Ethernet interface with an Area ID of 1. ! |
Router2 |
---|
interface Loopback0 ip address 172.16.10.1 255.255.255.0 ! interface Ethernet0 ip address 10.10.10.2 255.255.255.0 ! router ospf 1 network 10.10.10.0 0.0.0.255 area 0 !--- OSPF is configured to run on the !--- Ethernet interface with an Area ID of 1. ! |
本節提供的資訊可用於確認您的組態是否正常運作。
輸出直譯器工具(僅供註冊客戶使用)支援某些show命令,此工具可讓您檢視show命令輸出的分析。
show ip ospf neighbor — 按介面顯示OSPF鄰居資訊。Router1的輸出如下所示:
Router1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.16.10.1 1 FULL/BDR 00:00:38 10.10.10.2 Ethernet0
根據此輸出,對於Router2的鄰居ID為172.16.10.1的,Router1的鄰居狀態為「Full」。Router2是此廣播網路中的備份指定路由器(BDR)。要瞭解有關show ip ospf neighbor命令顯示的詳細資訊,請參閱show ip ospf neighbor命令顯示什麼內容?
show ip ospf interface — 顯示與OSPF相關的介面資訊。乙太網介面上發出的Router1的輸出如下所示:
Router1#show ip ospf interface ethernet 0 Ethernet0 is up, line protocol is up Internet Address 10.10.10.1/24, Area 0 Process ID 1, Router ID 192.168.45.1, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 192.168.45.1, Interface address 10.10.10.1 Backup Designated router (ID) 172.16.10.1, Interface address 10.10.10.2 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:00 Index 2/2, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 2, maximum is 2 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 172.16.10.1 (Backup Designated Router) Suppress hello for 0 neighbor(s)
從該輸出中,您知道Ethernet 0介面的網路型別是廣播的。要瞭解有關show ip ospf interface命令顯示內容的詳細資訊,請參閱show ip ospf interface命令顯示什麼?
同樣地,這裡顯示了Router2上show命令的輸出結果。
Router2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 192.168.45.1 1 FULL/DR 00:00:31 10.10.10.1 Ethernet0
從show ip ospf neighbor命令輸出中,您知道Router1是此廣播網路中的指定路由器(DR)。
Router2#show ip ospf interface ethernet 0 Ethernet0 is up, line protocol is up Internet Address 10.10.10.2/24, Area 0 Process ID 1, Router ID 172.16.10.1, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State BDR, Priority 1 Designated Router (ID) 192.168.45.1, Interface address 10.10.10.1 Backup Designated router (ID) 172.16.10.1, Interface address 10.10.10.2 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:00 Index 1/1, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 1, maximum is 1 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 192.168.45.1 (Designated Router) Suppress hello for 0 neighbor(s)
Router2的show ip ospf interface ethernet 0命令輸出還顯示Ethernet 0介面的網路型別為廣播。
本節提供的資訊可用於對組態進行疑難排解。
輸出直譯器工具(僅供註冊客戶使用)支援某些show命令,此工具可讓您檢視show命令輸出的分析。
注意:發出debug指令之前,請參閱有關Debug指令的重要資訊。
兩個路由器之間形成鄰接關係時存在多種狀態。您可以使用debug ip ospf adj 命令檢視各種狀態,以及廣播OSPF網路中發生的DR和BDR選舉。在早期的Cisco IOS軟體版本中,您可以使用命令debug ip ospf adjacency。建立鄰居關係之前,需要發出此debug命令。
從Router1的角度來看此輸出。輸出中粗體字的部分是鄰接過程經歷的各種狀態。
Router1#debug ip ospf adj OSPF adjacency events debugging is on *Mar 1 01:41:23.319: OSPF: Rcv DBD from 172.16.10.1 on Ethernet0 seq 0x1F6C opt 0x42 flag 0x7 len 32 mtu 1500 state INIT *Mar 1 01:41:23.323: OSPF: 2 Way Communication to 172.16.10.1 on Ethernet0, state 2WAY *Mar 1 01:41:23.327: OSPF: Neighbor change Event on interface Ethernet0 *Mar 1 01:41:23.327: OSPF: DR/BDR election on Ethernet0 *Mar 1 01:41:23.331: OSPF: Elect BDR 172.16.10.1 *Mar 1 01:41:23.331: OSPF: Elect DR 192.168.45.1 *Mar 1 01:41:23.335: DR: 192.168.45.1 (Id) BDR: 172.16.10.1 (Id) *Mar 1 01:41:23.339: OSPF: Send DBD to 172.16.10.1 on Ethernet0 seq 0x2552 opt 0x42 flag 0x7 len 32 *Mar 1 01:41:23.343: OSPF: First DBD and we are not SLAVE *Mar 1 01:41:23.359: OSPF: Rcv DBD from 172.16.10.1 on Ethernet0 seq 0x2552 opt 0x42 flag 0x2 len 52 mtu 1500 state EXSTART *Mar 1 01:41:23.363: OSPF: NBR Negotiation Done. We are the MASTER *Mar 1 01:41:23.367: OSPF: Send DBD to 172.16.10.1 on Ethernet0 seq 0x2553 opt 0x42 flag 0x3 len 72 *Mar 1 01:41:23.387: OSPF: Rcv DBD from 172.16.10.1 on Ethernet0 seq 0x2553 opt 0x42 flag 0x0 len 32 mtu 1500 state EXCHANGE *Mar 1 01:41:23.391: OSPF: Send DBD to 172.16.10.1 on Ethernet0 seq 0x2554 opt 0x42 flag 0x1 len 32 *Mar 1 01:41:23.411: OSPF: Rcv DBD from 172.16.10.1 on Ethernet0 seq 0x2554 opt 0x42 flag 0x0 len 32 mtu 1500 state EXCHANGE *Mar 1 01:41:23.415: OSPF: Exchange Done with 172.16.10.1 on Ethernet0 *Mar 1 01:41:23.419: OSPF: Synchronized with 172.16.10.1 on Ethernet0, state FULL 01:41:23: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.10.1 on Ethernet0 from LOADING to FULL, Loading Done *Mar 1 01:41:23.879: OSPF: Build router LSA for area 0, router ID 192.168.45.1, seq 0x80000004 *Mar 1 01:41:23.923: OSPF: Build network LSA for Ethernet0, router ID 192.168.45.1 *Mar 1 01:41:25.503: OSPF: Neighbor change Event on interface Ethernet0 *Mar 1 01:41:25.507: OSPF: DR/BDR election on Ethernet0 *Mar 1 01:41:25.507: OSPF: Elect BDR 172.16.10.1 *Mar 1 01:41:25.511: OSPF: Elect DR 192.168.45.1 *Mar 1 01:41:25.511: DR: 192.168.45.1 (Id) BDR: 172.16.10.1 (Id)
發出debug ip ospf events 命令以驗證hello計時器值,如以下示例輸出所示。
Router1#debug ip ospf events OSPF events debugging is on Router1# *Mar 1 04:04:11.926: OSPF: Rcv hello from 172.16.10.1 area 0 from Ethernet0 10.10.10.2 *Mar 1 04:04:11.930: OSPF: End of hello processing *Mar 1 04:04:21.926: OSPF: Rcv hello from 172.16.10.1 area 0 from Ethernet0 10.10.10.2 *Mar 1 04:04:21.930: OSPF: End of hello processing *Mar 1 04:04:31.926: OSPF: Rcv hello from 172.16.10.1 area 0 from Ethernet0 10.10.10.2 *Mar 1 04:04:31.930: OSPF: End of hello processing *Mar 1 04:04:41.926: OSPF: Rcv hello from 172.16.10.1 area 0 from Ethernet0 10.10.10.2 *Mar 1 04:04:41.930: OSPF: End of hello processing *Mar 1 04:04:51.926: OSPF: Rcv hello from 172.16.10.1 area 0 from Ethernet0 10.10.10.2 *Mar 1 04:04:51.930: OSPF: End of hello processing *Mar 1 04:05:01.926: OSPF: Rcv hello from 172.16.10.1 area 0 from Ethernet0 10.10.10.2 *Mar 1 04:05:01.930: OSPF: End of hello processing *Mar 1 04:05:11.926: OSPF: Rcv hello from 172.16.10.1 area 0 from Ethernet0 10.10.10.2 *Mar 1 04:05:11.930: OSPF: End of hello processing *Mar 1 04:05:21.926: OSPF: Rcv hello from 172.16.10.1 area 0 from Ethernet0 10.10.10.2 *Mar 1 04:05:21.930: OSPF: End of hello processing
此輸出顯示hello資料包每10秒交換一次。
修訂 | 發佈日期 | 意見 |
---|---|---|
1.0 |
06-Jul-2007 |
初始版本 |