本產品的文件集力求使用無偏見用語。針對本文件集的目的,無偏見係定義為未根據年齡、身心障礙、性別、種族身分、民族身分、性別傾向、社會經濟地位及交織性表示歧視的用語。由於本產品軟體使用者介面中硬式編碼的語言、根據 RFP 文件使用的語言,或引用第三方產品的語言,因此本文件中可能會出現例外狀況。深入瞭解思科如何使用包容性用語。
思科已使用電腦和人工技術翻譯本文件,讓全世界的使用者能夠以自己的語言理解支援內容。請注意,即使是最佳機器翻譯,也不如專業譯者翻譯的內容準確。Cisco Systems, Inc. 對這些翻譯的準確度概不負責,並建議一律查看原始英文文件(提供連結)。
本文檔介紹自適應安全裝置(ASA)軟體版本9.2.1中引入的與開放最短路徑優先(OSPF)協定相關的新功能和命令。
本文件沒有特定需求。
本文檔中的資訊基於運行Cisco ASA軟體版本9.2.(1)及更高版本的Cisco ASA 5500-X系列防火牆。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
注意:使用命令查詢工具(僅供註冊客戶使用)可獲取有關此部分中所用命令的更多資訊。
OSPF Hello資料包是OSPF進程向其OSPF鄰居傳送的資料包,用於維護與這些鄰居的連線。這些hello資料包按可配置的間隔(以秒為單位)傳送。乙太網鏈路的預設值是10秒,非廣播鏈路的預設值是30秒。Hello資料包包括已在dead間隔內收到hello資料包的所有鄰居的清單。Dead間隔也是一個可配置的間隔(以秒為單位),預設為hello間隔值的四倍。網路中所有hello間隔的值必須相同。同樣,網路中所有dead間隔的值必須相同。
OSPF快速hello資料包是指以小於1秒的間隔傳送的hello資料包。要啟用OSPF快速hello資料包,請輸入ospf dead-interval命令。對於亞秒hello,dead間隔設定為1秒或最小,hello-multiplier值設定為您希望在此1秒中傳送的hello資料包數。例如,如果dead間隔設定為1秒,而hello-multiplier設定為4,則每0.25秒傳送一次hello。
在介面上配置快速hello資料包時,從此介面傳送的hello資料包中通告的hello間隔設定為0。將忽略透過此介面接收的hello資料包中的hello間隔。必須注意的是,資料段上的dead間隔必須一致。無論是設定為1秒(對於快速hello資料包)還是設定為任何其他值,該網段中所有鄰居都必須保持一致。只要在dead間隔內至少傳送一個hello資料包,整個網段的呼叫乘數就不必相同。
要以4的倍數啟用快速hello資料包,請在適當的介面配置下輸入ospf dead-interval minimal hello-multiplier 4命令。
interface GigabitEthernet0/0
nameif inside
security-level 100
ip address 198.51.100.1 255.255.255.0
ospf dead-interval minimal hello-multiplier 4
router ospf 1
network 198.51.100.0 255.255.255.0 area 0
使用show ospf interface 命令進行驗證。
asa(config)# show ospf interface
inside is up, line protocol is up
Internet Address 198.51.100.1 mask 255.255.255.0, Area 0
Process ID 928, Router ID 198.51.100.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 198.51.100.1, Interface address 198.51.100.1
No backup designated router on this network
Timer intervals configured, Hello 250 msec, Dead 1, Wait 1, Retransmit 5
Hello due in 48 msec
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 0
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
ASA 9.2.1版及更高版本中引入了以下命令:timers lsa arrival、timers pacing、timers throttle lsa和timers throttle spf spf,這些命令是OSPF路由器配置的一部分。
asa(config-router)# timers ?
router mode commands/options:
lsa OSPF LSA timers
pacing OSPF pacing timers
throttle OSPF throttle timers
已刪除以下命令:timers spf 和timers lsa-grouping-pacing。
有關鏈路狀態通告(LSA)和Shortest Path First (SPF)限制優勢的詳細資訊,請參閱以下文檔:
現在支援使用存取控制清單(ACL)的路由過濾。這是透過distribute-list命令過濾路由來實現的。
例如,要過濾10.20.20.0/24的路由,配置將如下所示:
access-list ospf standard deny host 10.20.20.0
access-list ospf standard permit any4
!
router ospf 1
network 198.51.100.0 255.255.255.0 area 0
log-adj-changes
distribute-list ospf in interface inside
檢查關聯ACL時,表示其命中計數增加:
asa(config)# show access-list ospf
access-list ospf; 2 elements; name hash: 0xb5dd06eb
access-list ospf line 1 standard deny host 10.20.20.0 (hitcnt=1) 0xe29503b8
access-list ospf line 2 standard permit any4 (hitcnt=2) 0x51ff4e67
此外,還可以檢查ASA上的路由資訊庫(RIB)以進一步驗證功能。輸入show ospf rib detail命令以報告OSPF路由器進程的完整路由資訊資料庫。與每個路由關聯的「標誌」指示它是否已安裝在RIB中。
asa(config)# show ospf rib detail
OSPF Router with ID (198.51.100.10) (Process ID 1)
OSPF local RIB
Codes: * - Best, > - Installed in global RIB
*> 172.18.124.0/32, Intra, cost 11, area 0
SPF Instance 13, age 0:13:59
Flags: RIB, HiPrio
via 198.51.100.2, inside, flags: RIB
LSA: 1/198.51.100.2/198.51.100.2
* 10.20.20.0/32, Intra, cost 11, area 0
SPF Instance 13, age 0:13:59
Flags: HiPrio
via 198.51.100.2, inside, flags: none
LSA: 1/198.51.100.2/198.51.100.2
*> 192.168.10.0/32, Intra, cost 11, area 0
SPF Instance 13, age 0:13:59
Flags: RIB, HiPrio
via 198.51.100.2, inside, flags: RIB
LSA: 1/198.51.100.2/198.51.100.2
* 198.51.100.0/24, Intra, cost 10, area 0
SPF Instance 13, age 0:52:52
Flags: Connected
via 198.51.100.10, inside, flags: Connected
LSA: 2/198.51.100.2/192.151.100.10
在上面的輸出中,已經安裝了帶有標誌「RIB」的路由器,而帶有標誌「none」的路由尚未安裝。這也應該反映在全局路由表中。使用show route命令檢查。
asa(config)# show route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, + - replicated route
Gateway of last resort is 10.106.44.1 to network 0.0.0.0
S* 0.0.0.0 0.0.0.0 [1/0] via 10.106.44.1, tftp
O 172.18.124.0 255.255.255.0 [110/11] via 198.51.100.2, 00:00:03, inside
O 192.168.10.0 255.255.255.0 [110/11] via 198.51.100.2, 00:00:03, inside
O 10.20.20.0 255.255.255.0 [110/11] via 198.51.100.2, 00:00:03, inside
S 10.76.76.160 255.255.255.255 [1/0] via 10.106.44.1, tftp
C 10.86.195.0 255.255.255.0 is directly connected, management
L 10.86.195.1 255.255.255.255 is directly connected, management
引入這些命令是為了幫助監控和觀察OSPF路由器進程。這些指令的輸出範例僅供參考。
show ospf interface brief
輸入show ospf interface brief命令可獲取此ASA上現有鄰接關係的快速快照。
asa(config)# show ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
inside 1 0 198.51.100.2/255.255.255.0 10 DR 1/1
show ospf statistics [Detail]
show ospf statistics detail命令提供有關SPF上次運行的時間及運行次數的簡要說明。它還指示向資料庫增加的新LSA數量。
asa(config)# show ospf statistics detail
OSPF Router with ID (198.51.100.10) (Process ID 1)
Area 0: SPF algorithm executed 12 times
SPF 3 executed 00:32:56 ago, SPF type Full
SPF calculation time (in msec):
SPT Intra D-Intr Summ D-Summ Ext7 D-Ext7 Total
0 0 0 0 0 0 00
LSIDs processed R:2 N:1 Stub:1 SN:0 SA:0 X7:0
Change record 0x0
LSIDs changed 1
Changed LSAs. Recorded is LS ID and LS type:
198.51.100.2(R)
SPF 4 executed 00:28:16 ago, SPF type Full
SPF calculation time (in msec):
SPT Intra D-Intr Summ D-Summ Ext7 D-Ext7 Total
0 0 0 0 0 0 00
LSIDs processed R:1 N:1 Stub:0 SN:0 SA:0 X7:0
Change record 0x0
LSIDs changed 2
Changed LSAs. Recorded is LS ID and LS type:
198.51.100.2(R) 198.51.100.10(R)
SPF 5 executed 00:28:06 ago, SPF type Full
SPF calculation time (in msec):
SPT Intra D-Intr Summ D-Summ Ext7 D-Ext7 Total
0 0 0 0 0 0 00
LSIDs processed R:2 N:1 Stub:1 SN:0 SA:0 X7:0
Change record 0x0
LSIDs changed 1
Changed LSAs. Recorded is LS ID and LS type:
198.51.100.2(R)
SPF 6 executed 00:26:40 ago, SPF type Full
SPF calculation time (in msec):
SPT Intra D-Intr Summ D-Summ Ext7 D-Ext7 Total
0 0 0 0 0 0 00
LSIDs processed R:1 N:1 Stub:0 SN:0 SA:0 X7:0
Change record 0x0
LSIDs changed 2
Changed LSAs. Recorded is LS ID and LS type:
198.51.100.2(R) 198.51.100.10(R)
show ospf events neighbor
這是一個用於檢查OSPF鄰居狀態的命令,特別是在OSPF抖動的情況下。它為每個鄰居提供事件和狀態轉換的清單以及這些事件的時間戳。在本示例中,鄰居10.10.40.1透過狀態DOWN轉換到FULL。
asa(config)# show ospf events neighbor
OSPF Router with ID (198.51.100.10) (Process ID 1)
279 May 15 13:07:31.737: Neighbor 198.51.100.2, Interface inside state changes from
LOADING to FULL
280 May 15 13:07:31.737: Neighbor 198.51.100.2, Interface inside state changes from
EXCHANGE to LOADING
281 May 15 13:07:31.737: Neighbor 198.51.100.2, Interface inside state changes from
EXSTART to EXCHANGE
290 May 15 13:07:31.737: Neighbor 198.51.100.2, Interface inside state changes from
2WAY to EXSTART
296 May 15 13:07:31.738: Neighbor 198.51.100.2, Interface inside state changes from
INIT to 2WAY
297 May 15 13:07:31.728: Neighbor 198.51.100.2, Interface inside state changes from
DOWN to INIT
show ospf events lsa
此命令對於檢查已生成並接收了哪些LSA很有用。這些功能在鏈路抖動和LSA泛洪時非常有用。
asa(config)# show ospf events lsa
OSPF Router with ID (198.51.100.10) (Process ID 1)
253 May 15 13:07:49.167: Rcv Changed Type-1 LSA, LSID 198.51.100.2,
Adv-Rtr 198.51.100.2, Seq# 80000002, Age 1, Area 0
271 May 15 13:07:32.237: Generate New Type-2 LSA, LSID 198.51.100.1,
Seq# 80000001, Age 0, Area 0
275 May 15 13:07:32.238: Generate Changed Type-1 LSA, LSID 198.51.100.10,
Seq# 80000002, Age 0, Area 0
276 May 15 13:07:32.228: Rcv New Type-1 LSA, LSID 198.51.100.2,
Adv-Rtr 198.51.100.2, Seq# 80000001, Age 1, Area 0
show ospf events neighbor rib
此命令提供有關增加到RIB中的路由和安裝的路由型別(內部/內部)的資訊。
asa(config)# show ospf events neighbor rib
255 May 15 13:07:54.168: RIB Update, dest 172.18.124.0, mask 255.255.255.255,
gw 198.51.100.2, via inside, source 198.51.100.2, type Intra
287 May 15 13:07:31.738: Neighbor 198.51.100.2, Interface inside state changes from
LOADING to FULL
288 May 15 13:07:31.738: Neighbor 198.51.100.2, Interface inside state changes from
EXCHANGE to LOADING
289 May 15 13:07:31.738: Neighbor 198.51.100.2, Interface inside state changes from
EXSTART to EXCHANGE
298 May 15 13:07:31.738: Neighbor 198.51.100.2, Interface inside state changes from
2WAY to EXSTART
304 May 15 13:07:31.738: Neighbor 198.51.100.2, Interface inside state changes from
INIT to 2WAY
305 May 15 13:07:31.728: Neighbor 198.51.100.2, Interface inside state changes from
DOWN to INIT
show ospf events spf
運行SPF計算後,生成的運行時和LSA機會將記錄在SPF事件清單中。
asa(config)# show ospf events spf
235 May 15 13:07:54.167: End of SPF, SPF time 0ms, next wait-interval 10000ms
240 May 15 13:07:54.167: Starting External processing in area 0
241 May 15 13:07:54.167: Starting External processing
244 May 15 13:07:54.167: Starting summary processing, Area 0
250 May 15 13:07:54.167: Starting Intra-Area SPF, Area 0, spf_type Full
251 May 15 13:07:54.167: Starting SPF, wait-interval 5000ms
254 May 15 13:07:49.167: Schedule SPF, Area 0, spf-type Full, Change in LSA
Type RLSID 198.51.100.2, Adv-Rtr 198.51.100.2
255 May 15 13:07:37.227: End of SPF, SPF time 0ms, next wait-interval 10000ms
260 May 15 13:07:37.228: Starting External processing in area 0
261 May 15 13:07:37.228: Starting External processing
264 May 15 13:07:37.228: Starting summary processing, Area 0
268 May 15 13:07:37.228: Starting Intra-Area SPF, Area 0, spf_type Full
269 May 15 13:07:37.228: Starting SPF, wait-interval 5000ms
272 May 15 13:07:32.238: Schedule SPF, Area 0, spf-type Full, Change in LSA
Type NLSID 198.51.100.1, Adv-Rtr 198.51.100.10
274 May 15 13:07:32.238: Schedule SPF, Area 0, spf-type Full, Change in LSA
Type RLSID 198.51.100.10, Adv-Rtr 198.51.100.10
277 May 15 13:07:32.228: Schedule SPF, Area 0, spf-type Full, Change in LSA
Type RLSID 198.51.100.2, Adv-Rtr 198.51.100.2
show ospf events generic
此輸出包含泛型進程範圍事件,例如指定路由器(DR)選舉和鄰接關係更改。
asa(config)# show ospf events generic
236 May 15 13:07:54.167: Generic: ospf_external_route_sync0x0
237 May 15 13:07:54.167: Generic: ospf_external_route_sync0x0
238 May 15 13:07:54.167: Generic: ospf_external_route_sync0x0
239 May 15 13:07:54.168: Generic: ospf_external_route_sync0x0
242 May 15 13:07:54.168: Generic: ospf_inter_route_sync0x0
243 May 15 13:07:54.168: Generic: ospf_inter_route_sync0x0
245 May 15 13:07:54.168: Generic: post_spf_intra0x0
246 May 15 13:07:54.168: Generic: ospf_intra_route_sync0x0
248 May 15 13:07:54.168: Generic: ospf_intra_route_sync0x0
249 May 15 13:07:54.168: DB add: 172.18.124.00x987668 204
252 May 15 13:07:51.668: Timer Exp: if_ack_delayed0xcb97dfe0
256 May 15 13:07:37.228: Generic: ospf_external_route_sync0x0
257 May 15 13:07:37.228: Generic: ospf_external_route_sync0x0
258 May 15 13:07:37.228: Generic: ospf_external_route_sync0x0
259 May 15 13:07:37.228: Generic: ospf_external_route_sync0x0
262 May 15 13:07:37.228: Generic: ospf_inter_route_sync0x0
263 May 15 13:07:37.228: Generic: ospf_inter_route_sync0x0
265 May 15 13:07:37.228: Generic: post_spf_intra0x0
266 May 15 13:07:37.228: Generic: ospf_intra_route_sync0x0
267 May 15 13:07:37.228: Generic: ospf_intra_route_sync0x0
270 May 15 13:07:34.728: Timer Exp: if_ack_delayed0xcb97dfe0
273 May 15 13:07:32.238: DB add: 198.51.100.100x987848 206
278 May 15 13:07:32.228: DB add: 198.51.100.20x987938 205
283 May 15 13:07:31.738: Elect DR: inside198.51.100.10
284 May 15 13:07:31.738: Elect BDR: inside198.51.100.2
285 May 15 13:07:31.736: i/f state nbr chg: inside0x5
287 May 15 13:07:31.736: Elect DR: inside198.51.100.10
288 May 15 13:07:31.736: Elect BDR: inside198.51.100.2
289 May 15 13:07:31.736: i/f state nbr chg: inside0x5
291 May 15 13:07:31.736: nbr state adjok: 198.51.100.20x3
293 May 15 13:07:31.736: Elect DR: inside198.51.100.10
294 May 15 13:07:31.736: Elect BDR: inside198.51.100.2
295 May 15 13:07:31.736: i/f state nbr chg: inside0x5
show ospf rib detail
此命令(之前已提及)允許管理員檢視已從對等體獲取了哪些路由,以及這些路由是否已安裝到RIB中。由於路由過濾(之前列出),可能未在RIB中安裝路由。
asa(config)# show ospf rib detail
OSPF Router with ID (198.51.100.1) (Process ID 1)
OSPF local RIB
Codes: * - Best, > - Installed in global RIB
*> 172.18.124.0/32, Intra, cost 11, area 0
SPF Instance 13, age 0:13:59
Flags: RIB, HiPrio
via 198.51.100.2, inside, flags: RIB
LSA: 1/198.51.100.2/198.51.100.2
* 10.20.20.0/32, Intra, cost 11, area 0
SPF Instance 13, age 0:13:59
Flags: HiPrio
via 198.51.100.2, inside, flags: none
LSA: 1/198.51.100.2/198.51.100.2
*> 192.168.10.0/32, Intra, cost 11, area 0
SPF Instance 13, age 0:13:59
Flags: RIB, HiPrio
via 198.51.100.2, inside, flags: RIB
LSA: 1/198.51.100.2/198.51.100.2
* 198.51.100.0/24, Intra, cost 10, area 0
SPF Instance 13, age 0:52:52
Flags: Connected
via 198.51.100.10, inside, flags: Connected
LSA: 2/198.51.100.2/192.151.100.10
show ospf neighbor detail
show ospf neighbor detail命令可讓您詳細瞭解OSPF鄰接的狀態。
asa(config)# show ospf neighbor detail
Neighbor 198.51.100.2, interface address 198.51.100.2
In the area 0 via interface ISP
Neighbor priority is 1, State is FULL, 6 state changes
DR is 198.51.100.10 BDR is 198.51.100.2
Options is 0x12 in Hello (E-bit, L-bit)
Options is 0x52 in DBD (E-bit, L-bit, O-bit)
Dead timer due in 0:00:16
Neighbor is up for 00:02:45
Index 1/1, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
為了支援邊界網關協定(BGP)重分配在其他路由協定中的進出,OSPF路由器配置中引入了redistribute bgp命令。輸入以下命令可將透過BGP獲知的路由重新分配到正在運行的OSPF進程中。
asa(config)# router ospf 1
asa(config-router)# redistribute bgp ?
router mode commands/options:
100 Autonomous system number
ASA-1(config-router)# redistribute bgp 100
目前沒有適用於此組態的驗證程序。
目前尚無適用於此組態的具體疑難排解資訊。
修訂 | 發佈日期 | 意見 |
---|---|---|
1.0 |
04-Sep-2014 |
初始版本 |