當OSPF跨兩個區域運行時,本文檔將檢視開放最短路徑優先(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 unnumbered Ethernet2/0/0 router ospf 1 network 4.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 Serial0/1/0 ip unnumbered Ethernet0/0/4 interface ATM1/0.20 point-to-point ip address 200.0.0.2 255.255.255.0 router ospf 2 network 6.0.0.0 0.255.255.255 area 0 network 200.0.0.0 0.255.255.255 area 1 end |
路由器3.3.3.3 |
---|
Current configuration: hostname r3.3.3.3 interface Loopback0 ip address 3.3.3.3 255.0.0.0 interface ATM2/0.20 point-to-point ip address 200.0.0.3 255.255.255.0 router ospf 2 network 200.0.0.0 0.255.255.255 area 1 end |
本節提供的資訊可用於確認您的組態是否正常運作。
輸出直譯器工具(僅供註冊客戶使用)支援某些show命令,此工具可讓您檢視show命令輸出的分析。
show ip ospf database — 顯示鏈路狀態資料庫中的鏈路狀態通告(LSA)清單。此清單僅顯示LSA報頭中的資訊。
show ip ospf database [router] [link-state-id] — 顯示資料庫中路由器LSA(型別1 LSA)的內容。路由器LSA由每台路由器生成,這些基本LSA列出了路由器的所有鏈路或介面,以及鏈路的狀態和傳出成本。它們只被淹沒在它們的源頭地區。
show ip ospf database summary <link-state id> — 顯示區域邊界路由器(ABR)摘要鏈路。
由於Router 2.2.2.2是ABR,因此它有它所連線的兩個區域的資料庫。這使它成為使用show ip ospf database命令檢視OSPF資料庫的最佳位置。
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 697 0x80000040 0x5A21 2 2.2.2.2 2.2.2.2 696 0x80000045 0xEE82 2 Summary Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 200.0.0.0 2.2.2.2 352 0x80000001 0x2546 Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 2.2.2.2 2.2.2.2 351 0x8000000B 0xCA9D 2 3.3.3.3 3.3.3.3 354 0x80000006 0x71F7 2 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 4.0.0.0 2.2.2.2 689 0x80000001 0xFFE6 6.0.0.0 2.2.2.2 700 0x80000001 0x63C1 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: 773 Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 1.1.1.1 !--- For router links, Link State Id is always the same as the !--- Advertising Router (next line). Advertising Router: 1.1.1.1 !--- This is the router ID of the router that created this LSA. LS Seq Number: 80000040 Checksum: 0x5A21 Length: 48 Number of Links: 2 Link connected to: another Router (point-to-point) !--- This line shows that Router 1.1.1.1 is a neighbor !--- with Router 2.2.2.2. (Link ID) Neighboring Router ID: 2.2.2.2 (Link Data) Router Interface address: 0.0.0.12 !--- The link is unnumbered, so the address starts with !--- zero. In the case of unnumbered links, the interface address !--- displays the MIB II IfIndex value that usually starts with 0. Number of TOS metrics: 0 TOS 0 Metrics: 64 !--- This is the OSPF cost of the link that connects !--- the two routers. Link connected to: a Stub Network !--- This line represents 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 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) !--- This is the router LSA for 2.2.2.2 in area 0. LS age: 789 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: 80000045 Checksum: 0xEE82 Length: 48 Area Border Router !--- Bit B is set in the router LSA. !--- It indicates that this router is an ABR. Number of Links: 2 !--- There are two links in area 0. Link connected to: another Router (point-to-point) (Link ID) Neighboring Router ID: 1.1.1.1 (Link Data) Router Interface address: 0.0.0.10 Number of TOS metrics: 0 TOS 0 Metrics: 64 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 Router Link States (Area 1) !--- This is the router LSA for !--- Router 2.2.2.2 in area 1. LS age: 445 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: 8000000B Checksum: 0xCA9D Length: 48 Area Border Router Number of Links: 2 Link connected to: another Router (point-to-point) (Link ID) Neighboring Router ID: 3.3.3.3 (Link Data) Router Interface address: 200.0.0.2 Number of TOS metrics: 0 TOS 0 Metrics: 1 Link connected to: a Stub Network (Link ID) Network/subnet number: 200.0.0.0 (Link Data) Network Mask: 255.255.255.0 Number of TOS metrics: 0 TOS 0 Metrics: 1 r2.2.2.2#show ip ospf database router 3.3.3.3 OSPF Router with ID (2.2.2.2) (Process ID 2) Router Link States (Area 1) LS age: 465 Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 3.3.3.3 Advertising Router: 3.3.3.3 LS Seq Number: 80000006 Checksum: 0x71F7 Length: 48 Number of Links: 2 Link connected to: another Router (point-to-point) (Link ID) Neighboring Router ID: 2.2.2.2 (Link Data) Router Interface address: 200.0.0.3 Number of TOS metrics: 0 TOS 0 Metrics: 1 Link connected to: a Stub Network (Link ID) Network/subnet number: 200.0.0.0 (Link Data) Network Mask: 255.255.255.0 Number of TOS metrics: 0 TOS 0 Metrics: 1
為了將路由從一個區域通告到另一個區域,ABR會建立總結鏈路,您可以使用show ip ospf database summary <link-state id> 命令檢視該鏈路。
r2.2.2.2#show ip ospf database summary 200.0.0.0 OSPF Router with ID (2.2.2.2) (Process ID 2) Summary Net Link States (Area 0) LS age: 487 Options: (No TOS-capability, DC, Upward) !--- The Upward keyword indicates that this is not an LSA imported !--- from a VPN backbone (from a PE to a CE). LS Type: Summary Links(Network) Link State ID: 200.0.0.0 (summary Network Number) !--- 200.0.0.0/24 is advertised into area 0 by the !--- ABR (Router 2.2.2.2). Advertising Router: 2.2.2.2 LS Seq Number: 80000001 Checksum: 0x2546 Length: 28 Network Mask: /24 TOS: 0 Metric: 1 r2.2.2.2#show ip ospf database summary 4.0.0.0 OSPF Router with ID (2.2.2.2) (Process ID 2) Summary Net Link States (Area 1) LS age: 840 Options: (No TOS-capability, DC, Upward) LS Type: Summary Links(Network) Link State ID: 4.0.0.0 (summary Network Number) !--- 4.0.0.0/8 is advertised into area 1 by !--- the ABR (Router 2.2.2.2). Advertising Router: 2.2.2.2 LS Seq Number: 80000001 Checksum: 0xFFE6 Length: 28 Network Mask: /8 TOS: 0 Metric: 74 r2.2.2.2#show ip ospf database summary 6.0.0.0 OSPF Router with ID (2.2.2.2) (Process ID 2) Summary Net Link States (Area 1) LS age: 861 Options: (No TOS-capability, DC, Upward) LS Type: Summary Links(Network) Link State ID: 6.0.0.0 (summary Network Number) !--- 6.0.0.0/8 is advertised into area 1 by the !--- ABR (Router 2.2.2.2). Advertising Router: 2.2.2.2 LS Seq Number: 80000001 Checksum: 0x63C1 Length: 28 Network Mask: /8 TOS: 0 Metric: 10
本節從路由器3.3.3.3的角度計算最短路徑。
路由器3.3.3.3在自己的LSA中查詢,發現路由器2.2.2.2是鄰居。然後,路由器3.3.3.3檢視路由器2.2.2.2的LSA,以檢驗路由器2.2.2.2是否將路由器3.3.3.3視為鄰居。如果兩台路由器都視彼此為鄰居,則認為它們是可到達的。
每台路由器還檢查其本地鄰居表(可以使用show ip ospf neighbor命令檢視),以檢驗其介面和鄰居的介面是否位於公用IP子網上。
注意:未對未編號的介面執行此檢查。
如果介面位於同一個子網上,則路由器會為其鄰居的LSA中列出的任何末節網路安裝路由。在本示例中,200.0.0.0/24是路由器2.2.2.2的LSA中列出的唯一末節網路,路由器3.3.3.3已直接連線到該末節網路。
檢查區域1中的所有可到達路由器LSA後,路由器3.3.3.3會檢視資料庫中的彙總LSA。它會找到4.0.0.0/8和6.0.0.0/8的彙總LSA。如果Router 3.3.3.3知道如何到達建立彙總LSA的通告路由器,它會將該路由安裝到其路由表中。在本例中,通告路由器是Router 2.2.2.2。由於Router 3.3.3.3知道如何到達Router 2.2.2.2,因此它會將4.0.0.0/8和6.0.0.0/8的路由安裝到其路由表中。這些路由的度量是到達通告路由器的度量加上彙總LSA的度量。根據到達為其生成彙總LSA的區域內或區域間路由的開銷計算彙總LSA的度量。
注意:路由器使用第1類LSA在一個區域內通告它們直接連線的網路和其他路由器,該區域會在同一區域內泛洪。因此,同一區域中的所有路由器都擁有各自區域的完整拓撲資訊。因此,ABR會維護與其直接連線的所有區域的完整拓撲資訊。但是,當ABR將屬於一個區域的網路通告到第二個區域時,它們僅使用第3類LSA通告網路的字首和掩碼。第二個區域中的路由器不知道其他區域的拓撲資訊,但知道其他區域中的網路的可達性資訊。
此輸出顯示了上述每台路由器的路由表中的OSPF路由。
r1.1.1.1# show ip route ospf O IA 200.0.0.0/24 [110/65] via 6.0.0.2, 00:09:00, Serial2/1/0 O 6.0.0.0/8 [110/74] via 6.0.0.2, 00:14:41, Serial2/1/0 r2.2.2.2#show ip route ospf O 4.0.0.0/8 [110/74] via 4.0.0.1, 00:09:16, Serial0/1/0 r3.3.3.3#show ip route ospf O IA 4.0.0.0/8 [110/75] via 200.0.0.2, 00:09:27, ATM2/0.20 O IA 6.0.0.0/8 [110/11] via 200.0.0.2, 00:09:27, ATM2/0.20
有關在路由表中缺少資料庫中的資訊時排除OSPF故障的資訊,請參閱為什麼某些OSPF路由位於資料庫中,但不在路由表中?有關一般OSPF故障排除資訊,請參閱OSPF故障排除。
修訂 | 發佈日期 | 意見 |
---|---|---|
1.0 |
28-Mar-2005 |
初始版本 |