在MSR56主动触发IPSec时,通过查看debug,发现有如下错误提示
*Oct 15 01:14:01:989 2015 LYLib-MSR3640 IKE/7/PACKET:
I-Cookie: 2ce171c987f33ed4
R-Cookie: 40394e66a03b10e8
next payload: ID
version: ISAKMP Version 1.0
exchange mode: Main
flags: ENCRYPT
message ID: 0
length: 60
*Oct 15 01:14:01:989 2015 LYLib-MSR3640 IKE/7/EVENT: IKE thread 1099131478688 processes a job.
*Oct 15 01:14:01:989 2015 LYLib-MSR3640 IKE/7/PACKET: Decrypt the packet.
*Oct 15 01:14:01:989 2015 LYLib-MSR3640 IKE/7/PACKET: Received ISAKMP Identification Payload.
*Oct 15 01:14:01:989 2015 LYLib-MSR3640 IKE/7/ERROR: 2th byte of the structure ISAKMP Identification Payload must be 0.
*Oct 15 01:14:01:989 2015 LYLib-MSR3640 IKE/7/PACKET: Received ISAKMP Key Exchange Payload.
*Oct 15 01:14:01:989 2015 LYLib-MSR3640 IKE/7/ERROR: 2th byte of the structure ISAKMP Key Exchange Payload must be 0.
*Oct 15 01:14:01:989 2015 LYLib-MSR3640 IKE/7/ERROR: Failed to parse phase 1 packet. Reason INVALID_PAYLOAD_TYPE.
*Oct 15 01:14:01:990 2015 LYLib-MSR3640 IKE/7/PACKET: Encrypt the packet.
*Oct 15 01:14:01:990 2015 LYLib-MSR3640 IKE/7/PACKET: Construct notification packet: INVALID_PAYLOAD_TYPE.
*Oct 15 01:14:01:990 2015 LYLib-MSR3640 IKE/7/PACKET: Sending packet to 61.136.81.107 remote port 500, local port 500.
由于深信服主动触发IPSec ,建立成功,因此两端配置的算法密钥等都相同。
查看RFC,确认IKE的第五个报文中的ike Identification 第二字节确实是要求为0 ,通过在MSR56测抓包,发现第二字节不为零。
协调深信服工程师排查,确认深信服发送的IKE的第五个报文中的ike Identification 第二字节为零。
配置正确,对端发送的报文正常,剩下的最后可能性就只有一个:IKE的第五个报文MSR56解密失败。
排查ike proposal,发现设备配置中有两个算法相同的ike proposal。配置如下:
#
ike profile 1
keychain 1
match remote identity address 1.1.1.1 255.255.255.255
proposal 2
#
ike proposal 1
encryption-algorithm 3des-cbc
dh group2
authentication-algorithm md5
#
ike proposal 2
encryption-algorithm 3des-cbc
dh group2
authentication-algorithm md5
#
由于MSR收到的IKE第一个报文时,是从全局匹配ike proposal的,因此,可能MSR回复IKE第二个报文时,选用的是ike proposal 1,但是解密IKE第五个报文时,使用的是ike profile下引用的ike proposal 2,因此导致解密失败。
修改ike proposal配置的算法各不相同后,IPSec建立成功。
修改ike proposal配置的算法组合各不相同,保证所有的ike proposal中的算法组合全局唯一。
1.非模板方式时ipsec策略下必须配置remote-address;
2.当系统配置了多个ike keychain时,ike keychain中pre-shared-key address配置地址范围不能有交集。
3.当系统配置了多个ike profile时,ike profile中match remote identity address配置地址范围不能有交集。
4.当系统配置了多个ike profile时,并在profile下引用了ike keychain,那么需要保证在全局通过pre-shared-key address匹配的ike keychain和ike profile下引用的ike keychain是一致的。
5.ike协商第一阶段中,ike profile和ike keychain均是在全局下匹配的,需要保证ike协商第二阶段中找到的ipsec policy中引用的ike profile和第一阶段匹配的ike profile是一致的。
6.如果在ipsec policy下面配置了local-address,那么这个地址需要与收到的协商报文的目的地址是一样的。