此产品的文档集力求使用非歧视性语言。在本文档集中,非歧视性语言是指不隐含针对年龄、残障、性别、种族身份、族群身份、性取向、社会经济地位和交叉性的歧视的语言。由于产品软件的用户界面中使用的硬编码语言、基于 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间隔的值必须相同。同样,网络中所有停顿间隔的值必须相同。
OSPF快速问候数据包是指以小于1秒的间隔发送的问候数据包。要启用OSPF快速呼叫数据包,请输入ospf dead-interval命令。对于亚秒hello数据包,dead间隔设置为1秒或最小,hello-multiplier值设置为在此1秒内发送的hello数据包的数量。例如,如果dead间隔设置为1秒,hello-multiplier设置为4,则hello间隔每0.25秒发送一次。
在接口上配置快速问候数据包时,从此接口发出的问候数据包中通告的问候间隔设置为0。将忽略通过此接口接收的呼叫数据包中的hello间隔。请务必注意,网段上的dead间隔必须一致。无论是设置为1秒(对于快速呼叫数据包)还是设置为任何其他值,该网段内的邻居必须保持一致。只要在dead间隔内至少发送一个呼叫数据包,则呼叫乘数对于整个网段不必相同。
要以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(这些命令是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)和最短路径优先(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 |
初始版本 |