本文顯示兩個開放最短路徑優先(OSPF)路由器,它們通過編號的點對點鏈路連線。
本文件沒有特定需求。
本文件所述內容不限於特定軟體和硬體版本。
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
本節提供用於設定本文件中所述功能的資訊。
注意:要查詢有關本文檔中使用的命令的其他資訊,請使用命令查詢工具(僅限註冊客戶)。
本檔案會使用下圖中所示的網路設定。
本文檔使用此處顯示的配置。
路由器1.1.1.1 |
---|
Current configuration: hostname r1.1.1.1 interface Loopback0 ip address 1.1.1.1 255.0.0.0 interface Ethernet2/0/0 ip address 4.0.0.1 255.0.0.0 interface Serial2/1/0 ip address 5.0.0.1 255.0.0.0 router ospf 1 network 4.0.0.0 0.255.255.255 area 0 network 5.0.0.0 0.255.255.255 area 0 end |
路由器2.2.2.2 |
---|
Current configuration: hostname r2.2.2.2 interface Loopback0 ip address 2.2.2.2 255.0.0.0 interface Ethernet0/0/4 ip address 6.0.0.2 255.0.0.0 interface Serial2/1/0 ip address 5.0.0.2 255.0.0.0 router ospf 2 network 6.0.0.0 0.255.255.255 area 0 network 5.0.0.0 0.255.255.255 area 0 end |
本節提供的資訊可用於確認您的組態是否正常運作。
輸出直譯器工具(僅供註冊客戶使用)支援某些show命令,此工具可讓您檢視show命令輸出的分析。
show ip ospf database — 顯示鏈路狀態通告(LSA)清單並將它們鍵入到鏈路狀態資料庫中。此清單僅顯示LSA報頭中的資訊。
show ip ospf database [router] [link-state-id] — 顯示資料庫中路由器的所有LSA的清單。LSA由每台路由器生成。這些基本LSA列出了所有路由器的鏈路或介面,以及鏈路的狀態和傳出成本。它們也只被淹沒在它們的源頭地區。
要檢視OSPF資料庫在此網路環境中的外觀,請檢視show ip ospf database 命令的輸出。
r2.2.2.2#show ip ospf database OSPF Router with ID (2.2.2.2) (Process ID 2) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 1.1.1.1 1.1.1.1 522 0x80000002 0x96D3 3 2.2.2.2 2.2.2.2 401 0x80000003 0x9FC2 3 r2.2.2.2#show ip ospf database router 1.1.1.1 OSPF Router with ID (2.2.2.2) (Process ID 2) Router Link States (Area 0) LS age: 540 Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 1.1.1.1 !--- For router links, the Link State Id is always the same !--- as the Advertising Router (the next line). Advertising Router: 1.1.1.1 !--- This is the router ID of the router that !--- created this LSA. LS Seq Number: 80000002 Checksum: 0x96D3 Length: 60 Number of Links: 3 Link connected to: another Router (point-to-point) !--- This entry shows that this router (1.1.1.1) is a neighbor !--- with 2.2.2.2. (Link ID) Neighboring Router ID: 2.2.2.2 (Link Data) Router Interface address: 5.0.0.1 !--- Interface on this router (1.1.1.1) which connects the !--- neighbor (2.2.2.2). Number of TOS metrics: 0 TOS 0 Metrics: 64 !--- The OSPF cost of the link is 64. Link connected to: a Stub Network !--- This represents the subnet of the serial link 5.0.0.0/8. (Link ID) Network/subnet number: 5.0.0.0 (Link Data) Network Mask: 255.0.0.0 Number of TOS metrics: 0 TOS 0 Metrics: 64 !--- The OSPF cost of the link is 64. Link connected to: a Stub Network !--- This represents the subnet of the !--- Ethernet segment 4.0.0.0/8. (Link ID) Network/subnet number: 4.0.0.0 (Link Data) Network Mask: 255.0.0.0 Number of TOS metrics: 0 TOS 0 Metrics: 10 !--- The OSPF cost of the link is 10. r2.2.2.2#show ip ospf database router 2.2.2.2 OSPF Router with ID (2.2.2.2) (Process ID 2) Router Link States (Area 0) LS age: 424 Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 2.2.2.2 Advertising Router: 2.2.2.2 LS Seq Number: 80000003 Checksum: 0x9FC2 Length: 60 Number of Links: 3 Link connected to: a Stub Network (Link ID) Network/subnet number: 6.0.0.0 (Link Data) Network Mask: 255.0.0.0 Number of TOS metrics: 0 TOS 0 Metrics: 10 Link connected to: another Router (point-to-point) (Link ID) Neighboring Router ID: 1.1.1.1 (Link Data) Router Interface address: 5.0.0.2 Number of TOS metrics: 0 TOS 0 Metrics: 64 Link connected to: a Stub Network (Link ID) Network/subnet number: 5.0.0.0 (Link Data) Network Mask: 255.0.0.0 Number of TOS metrics: 0 TOS 0 Metrics: 64
本節從路由器2.2.2.2的角度計算最短路徑樹。
路由器2.2.2.2在自己的LSA中查詢,發現路由器1.1.1.1是鄰居。路由器2.2.2.2檢視1.1.1.1的路由器LSA,檢驗1.1.1.1將2.2.2.2視為鄰居。如果兩台路由器都視彼此為鄰居,則認為它們是可到達的。
每台路由器還檢查其本地鄰居表(可以使用show ip ospf neighbor命令檢查該表),以檢驗其介面和鄰居的介面是否位於公用IP子網中。如果是,則路由器為其鄰居的路由器LSA中列出的任何末節網路安裝路由。
在本例中,路由器2.2.2.2在其路由表中安裝4.0.0.0/8的路由,因為路由器1.1.1.1在其自己的路由器LSA中將4.0.0.0/8列為末節網路。路由器1.1.1.1還將5.0.0.0/8列為末節網路。但是,Router 2.2.2.2沒有為5.0.0.0/8安裝OSPF路由,因為它有為5.0.0.0/8連線的路由。連線的路由總是比動態獲知的路由更好。
Router 2_2_2_2# show ip route ospf O 4.0.0.0/8 [110/74] via 5.0.0.1, 00:09:26, Serial0/1/0 Router 1_1_1_1#show ip route ospf O 6.0.0.0/8 [110/74] via 5.0.0.2, 00:00:49, Serial2/1/0
目前尚無適用於此組態的具體疑難排解資訊。
修訂 | 發佈日期 | 意見 |
---|---|---|
1.0 |
10-Aug-2005 |
初始版本 |