Print

【MVS】思科 ASA Failover 配置

2026-08-20 发表

问题描述

 

过程分析

 


  1. 故障切换类型

  • Active/Standby Failover:主备故障切换是 ASA 故障切换中最常见的一种类型。在这种部署方式中,主设备负责主动处理所有网络流量,而备用设备保持在待机状态。当主设备发生故障时,备用设备会无缝接管业务,从而确保用户受到的影响和业务中断时间最小化。
  • Active/Active Failover:主主故障切换的配置中,两台 ASA 设备可以同时主动处理网络流量。借助负载均衡能力,Active/Active Failover 可以优化资源利用率,并确保即使在流量高峰期间也能够保持高可用性。
 
Primary/Secondary 状态与 Active/Standby 状态根据配置中指定的主设备从设备,两台设备之间存在以下差异:
  • 如果两台设备同时启动,并且两台设备的运行健康状态相同,则主设备始终会成为 Active 设备
  • 主设备设备的 MAC 地址始终与 Active 状态使用的 IP 地址绑定。有一个例外:当从设备处于 Active 状态,并且无法通过 Failover 链路获取主设备的 MAC 地址时,此时会使用从设备自身的 MAC 地址。--- 不懂

  1. 软硬件需求

硬件要求 Failover 配置中的两台设备必须具有相同的硬件配置。两台设备必须是相同型号,具有相同数量和类型的接口,并且具有相同容量的 RAM。
 
许可证要求 早版本的 ASA 软件要求两台设备的许可证保持一致。从 8.3(1) 版本开始,不再要求安装完全相同的许可证。
License 逻辑:通常情况下,只需要为主设备购买许可证;对于 Active/Standby 故障切换,当备用设备切换为 Active 状态时,它会继承主设备的许可证。如果两台设备上都配置了许可证,这些许可证会合并为一个正在运行的故障切换集群许可证。例:
Security Context:有两台 ASA5510, 一台20 contexts 另一台10 contexts,合计 30 contexts. 双活状态,一台设备使用了 18 context,另一台只能使用 12 contexts,failover cluster license 不能超过两台设备的总和。
Botnet Traffic Filter license :每台设备 Botnet Traffic Filter license 剩余 48 weeks,那么 cluster 剩余的就是 96 周.
SSL VPN sessions:每台 ASA 5520 上有 500 SSL VPN sessions,由于平台限制该 license 的数量为 750, cluster SSL VPN sessions 为 750.

  1. 故障切换触发

当主设备或备用设备检测到以下情况时,会触发设备故障切换:
  • 硬件或电源故障 - 例如设备断电、电源模块故障、主板或关键硬件异常。
  • 软件故障 - 例如 ASA 系统进程异常、软件崩溃、设备无法正常运行。
  • 监控接口故障数量过多 - Failover 会持续监控指定接口状态。如果超过允许的故障阈值,设备会认为自身不可用并触发切换。
  • 管理员手动触发 Failover
    • no failover active 在当前 Active 设备执行,使其主动退出 Active 状态,触发切换。
    • failover active 在 Standby 设备执行,强制备用设备成为 Active。

 

解决方法

  1. Failover 配置步骤

ASA1 ! Bring up the interfaces that will be used for lan failover (G3) and state failover (G4) interface GigabitEthernet3 no shutdown ! interface GigabitEthernet4 no shutdown ! Apply the IP address along with the keword "standby" and ! the standby address that will be used by the unit in standby mode interface GigabitEthernet0 nameif OUTSIDE security-level 0 ip address 192.168.1.1 255.255.255.0 standby 192.168.1.2 ! interface GigabitEthernet1 nameif INSIDE security-level 100 ip address 172.16.0.1 255.255.255.0 standby 172.16.0.2 ! interface GigabitEthernet2 nameif DMZ security-level 50 ip address 10.0.0.1 255.255.255.0 standby 10.0.0.2 ! Tell the ASA that G3 will be named "LAN_FAIL" and that it will be used ! to replicate the configuration between ASA1 and ASA2 failover lan interface LAN_FAIL GigabitEthernet3 ! Use the failover command to assign "LAN_FAIL" the active ! and standby IP addresses failover interface ip LAN_FAIL 10.1.1.1 255.255.255.252 standby 10.1.1.2 ! Tell the ASA that G4 will be named "LINK_FAIL" and assign the IP address for active ! and standby. Note that the word 'link' is the clue to identify this as the stateful connection failover link LINK_FAIL GigabitEthernet4 failover interface ip LINK_FAIL 10.2.2.1 255.255.255.252 standby 10.2.2.2 ! Tell this ASA that it's title will be "PRIMARY" failover lan unit primary ! Enable failover failover ASA2 On standby unit, just need to do the following configuration, and the rest will be automatically replicated from the Active device. interface GigabitEthernet3 no shutdown ! failover lan interface LAN_FAIL GigabitEthernet3 failover interface ip LAN_FAIL 10.1.1.1 255.255.255.252 standby 10.1.1.2 ! failover
 
可选配置
failover replication http //replicate the HTTP sessions prompt hostname priority state //efault hostname will be the same for both active and standby units, due to the configuration being replicated. 配置之后会显示 ASA1/pri/act# 或者 ASA1/sec/stby# failover key ***** // 配置密码