原文链接:https://www.yuque.com/erik.zhao/trouble/oyrug6an1gb3desg?singleDoc
产品型号:AR2240,版本:V200R010
总部(HQ)----- 数据中心(DC),总部与数据中心之间建立IPSec隧道,数据中心AR路由器使用PPPoE拨号接入Internet。总部多个部门使用不同的网段通过IPSec访问数据中心。
上午7:50左右,总部与数据中心之间的IPSec隧道中断,9点之后总部不同部门到数据中心的访问才陆续恢复,至晚上20:00仍未完全恢复。
1、总部AR路由器告警:
Jun 15 2023 07:52:28+08:00 TPHQRWAN01 %IKE/5/IKE_NEGO_FAIL(l)[4117008]:IPSec tunnel negotiation fails. (IfIndex=6, SeqNum=0, PeerAddress=211.24.79.120, PeerPort=500, Reason=malformed message)
Jun 15 2023 15:52:55+08:00 TPHQRWAN01 %IKE/5/IKE_NEGO_FAIL(l)[4119861]:IPSec tunnel negotiation fails. (IfIndex=6, SeqNum=80, PeerAddress=211.24.79.120, PeerPort=500, Reason=rekey fail)
2、数据中心AR路由器告警:
Jun 15 2023 07:49:59+08:00 TPDCRWAN01 %IFNET/4/LINK_STATE(l)[9320741]:The line protocol PPP on the interface Dialer1:0 has entered the DOWN state.
Jun 15 2023 07:49:59+08:00 TPDCRWAN01 %IFNET/4/LINK_STATE(l)[9320742]:The line protocol PPP IPCP on the interface Dialer1:0 has entered the DOWN state.
Jun 15 2023 07:49:59+08:00 TPDCRWAN01 %ADP-IPSEC/5/TunnelStateSwitched(l)[9320743]:The IPSec tunnel state is switched DOWN. (local-ip: 211.24.79.120, remote-ip: 175.138.229.125, OfflineReason: unknown)
Jun 15 2023 07:50:18+08:00 TPDCRWAN01 %IFNET/4/LINK_STATE(l)[9320750]:The line protocol PPP on the interface Dialer1:0 has entered the UP state.
Jun 15 2023 07:50:18+08:00 TPDCRWAN01 %IFNET/4/LINK_STATE(l)[9320751]:The line protocol PPP IPCP on the interface Dialer1:0 has entered the UP state.
1、从上述告警可以明确,07:49:59 数据中心AR路由器WAN链路PPPoE断连,导致IPSec隧道中断,07:50:18时WAN链路恢复。
2、当数据中心AR的WAN链路突然断连,此时不会先对端总部AR发送删除SA的请求,因此总部AR的SA仍然保持,直至SA生存周期到期(现网配置的SA生存周期为36000秒)。
ipsec policy HQ-Branch 80 isakmp
security acl 3080
ike-peer Datacenter
proposal HQ-BRANCH
sa duration time-based 36000
3、数据中心AR的WAN链路恢复后,主动发起IPSec 协商,但总部AR认为对端发送的SA非法,因为本端的SA未到期。从总部AR的告警日志中也可以看出重协商失败。
4、从上午9点之后,不同部门的业务陆续恢复,原因是总部的不同部门使用不同IP地址段,对应ACL 3080的不同rule。不同数据流有各自的IPSec SA,生存周期的老化时间不同,SA陆续老化重协商,业务陆续恢复。
acl name HQ-DC 3080
rule 5 permit ip source 10.72.0.0 0.0.255.255 destination 10.10.2.0 0.0.0.255
rule 10 permit ip source 10.72.0.0 0.0.255.255 destination 192.168.100.0 0.0.0.255
rule 15 permit ip source 10.72.0.0 0.0.255.255 destination 192.168.101.0 0.0.0.255
rule 20 permit ip source 10.72.0.0 0.0.255.255 destination 192.168.102.0 0.0.0.255
rule 25 permit ip source 10.72.0.0 0.0.255.255 destination 192.168.104.0 0.0.0.255
rule 30 permit ip source 10.72.0.0 0.0.255.255 destination 192.168.200.0 0.0.0.255
rule 35 permit ip source 10.72.0.0 0.0.255.255 destination 192.168.201.0 0.0.0.255
rule 36 permit ip source 10.72.222.0 0.0.0.255 destination 192.168.190.0 0.0.0.255
rule 40 permit ip source 192.168.0.0 0.0.0.255 destination 10.10.2.0 0.0.0.255
......
1、IPSec中断的原因是AR路由器WAN链路闪断
2、业务陆续恢复的原因是IPSec SA未达生存周期,陆续老化
1、在总部AR路由器手动复位,执行命令reset ike sa后,两端IPSec隧道建立成功。
2、两端配置IKE对等体DPD检测功能。配置后,IPSec隧道断掉后会自动清除SA,并重新触发SA协商。参考如下:
system-view
[AR] ike dpd msg seq-hash-notify
[AR] ike dpd type periodic
[AR] ike dpd idle-time 20
[AR] ike dpd retransmit-interval 10
[AR] ike dpd retry-limit 4
IPSec隧道一端异常删除SA(如重启、WAN链路异常中断等),对端SA不会清空,将维持到SA生存周期结束,最终导致业务不通。针对这种情况,建议IPSec端口配置IKE对等体DPD检测功能。