在最近的博文中,Carroll使用命令行解决了思科ASA和BGP对等操作问题。在这里,Carroll将会和大家讨论使用思科ASA防火墙实现动态路由协议(DRP)的全冗余。
如果你使用ASA来做冗余,那么当主用设备宕掉时,备用设备就会立即启用。在这种情况下,备用设备会假装活动设备的IP和MAC地址。如果你正在运行路由协议,你就会看到OSPF和EIGRP会被强制重新建立邻接。从而导致漫长的收敛时间和路由抖动。而ASA8.4有一个新功能可以解决这类问题。
实现动态路由协议的全冗余:思科ASA 8.4
在思科ASA 8.4版本中,有一个新的功能可以帮我们实现动态路由协议(DRP)中的全冗余。
全冗余工作在路由协议中, 并且同步冗余设备间的路由信息。这些信息都存储在备份设备的路由表中。
当冗余事件发生时,所有包都可以正常传输,因为第二个ASA和主ASA的规则一样,而且现在变成了主用的。一旦冗余发生,RIB的序列号或戳记就会增加,并且重收敛时间也会在新活动设备上开始。
接下来,该新活动设备和对等路由器形成邻接关系,并从其他对等体那学习到路由信息。这些路由和我们从全冗余上学习到路由差不多;然而,这些路由信息仍然会被加上更新过的戳记号并放在路由表中,替换之前活动设备中的旧路由。换句话说,旧的出去,新的进来。
你可以通过show failover命令来确认冗余设备之间路由信息的发送。从输出地突出部分你可以看到路由信息在活动设备和备份设备间的发送和接受。现在我们可以核实下路由表:
- ciscoasa(config)# show failover
- Failover On
- Failover unit Secondary
- Failover LAN Interface: failover GigabitEthernet0/0 (up)
- Unit Poll frequency 300 milliseconds, holdtime 900 milliseconds
- ……
- …….
- Stateful Failover Logical Update Statistics
- Link : failover GigabitEthernet0/0 (up)
- Stateful Obj xmit xerr rcv rerr
- General 2870 0 2644 0
- sys cmd 2572 0 2572 0
- up time 0 0 0 0
- RPC services 0 0 0 0
- TCP conn 0 0 0 0
- UDP conn 0 0 0 0
- ARP tbl 242 0 33 0
- Xlate_Timeout 0 0 0 0
- IPv6 ND tbl 0 0 0 0
- VPN IKEv1 SA 0 0 0 0
- VPN IKEv1 P2 0 0 0 0
- VPN IKEv2 SA 0 0 0 0
- VPN IKEv2 P2 0 0 0 0
- VPN CTCP upd 0 0 0 0
- VPN SDI upd 0 0 0 0
- VPN DHCP upd 0 0 0 0
- SIP Session 0 0 0 0
- Route Session 56 0 39 0
- SIA data 0 0 0 0
- Logical Update Queue Information
- Cur Max Total
- Recv Q: 0 7 4304
- Xmit Q: 0 1 23765
那如果想要查看路由表的序列号,以及增加的路由信息应该用什么样的命令呢?#p#
下面我们将介绍通过其他命令查看路由表的序列号,以及增加的路由等。
如果我们使用show route failover命令,我们可以看到路由表的序列号。
- ciscoasa(config)# show route failover
- Codes: C - connected, S - static, I - IGRP, 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, E - EGP
- i - IS-IS, 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
- Gateway of last resort is 10.104.54.129 to network 0.0.0.0
- Routing table seq num 5
- Reconvergence timer expired
- D 20.20.210.0 255.255.255.0 [90/28416] via 192.101.1.30, 0:13:14, outside, seq 5
- D 20.20.249.0 255.255.255.0 [90/30976] via 192.101.1.30, 0:13:14, outside, seq 5
- D 20.20.250.0 255.255.255.0 [90/33536] via 192.101.1.30, 0:13:14, outside, seq 5
- O IA 172.198.40.0 255.255.255.0 [110/30] via 192.168.32.2, 0:12:37, inside, seq 5
- O IA 172.168.34.0 255.255.255.0 [110/20] via 192.168.32.2, 0:12:37, inside, seq 5
- O IA 172.188.36.0 255.255.255.0 [110/30] via 192.168.32.2, 0:12:37, inside, seq 5
- O IA 172.16.30.0 255.255.255.0 [110/20] via 192.168.32.2, 0:12:40, inside, seq 5
- C 10.104.54.0 255.255.255.0 is directly connected, mgmt, seq 4
- C 192.101.1.0 255.255.255.0 is directly connected, outside, seq 5
- C 192.168.253.0 255.255.255.0 is directly connected, failover, seq 0
- C 192.168.32.0 255.255.255.0 is directly connected, inside, seq 5
- S* 0.0.0.0 0.0.0.0 [1/0] via 10.104.54.129, mgmt, seq 5
如果我们使用debug route ha命令,我们将看到下面增加的路由:
- ROUTE HA: RIB Epoch number 5 assigned to NDB: 192.168.32.0
- ROUTE HA: Sending Message Version: 1 Action: add Object: route Address: 192.168.32.0 Mask: 255.255.255.0
- ROUTE HA: RIB Epoch number 5 assigned to NDB: 172.16.0.0
- ROUTE HA: Sending Message Version: 1 Action: add Object: route Address: 172.16.30.0 Mask: 255.255.255.0
- ROUTE HA: RIB epoch number 5 assigned to SDB: 172.16.30.0
- ROUTE HA: RIB Epoch number 5 assigned to NDB: 172.168.0.0
- ROUTE HA: Sending Message Version: 1 Action: add Object: route Address: 172.168.34.0 Mask: 255.255.255.0
- ROUTE HA: RIB epoch number 5 assigned to SDB: 172.168.34.0
- ROUTE HA: RIB Epoch number 5 assigned to NDB: 172.188.0.0
- ROUTE HA: Sending Message Version: 1 Action: add Object: route Address: 172.188.36.0 Mask: 255.255.255.0
- ROUTE HA: RIB epoch number 5 assigned to SDB: 172.188.36.0
- ROUTE HA: RIB Epoch number 5 assigned to NDB: 172.198.0.0
- ROUTE HA: Sending Message Version: 1 Action: add Object: route Address: 172.198.40.0 Mask: 255.255.255.0
- ROUTE HA: RIB epoch number 5 assigned to SDB: 172.198.40.0
该功能在ASA上早已开启,所以你只需要在ASA上设置冗余和路由就可以了。
【编辑推荐】