IKEv1 第 2 阶段失败,出现 NO_PROPOSAL_CHOSEN,但 ESP 提议正确。还有什么原因可能导致此失败?

IKEv1 第 2 阶段失败,出现 NO_PROPOSAL_CHOSEN,但 ESP 提议正确。还有什么原因可能导致此失败?

尝试排除与 Strongswan 的 IPSec/IKEv1 VPN 连接故障,该连接因 NO_PROPOSAL_CHOSEN 而无法完成第 2 阶段。

我知道这个错误的解决方案几乎总是“仔细检查你的第 2 阶段提案”,但我 100%确定 ESP 提案是正确的——它正在使用 NCP Secure Entry Client 的 Windows 机器上运行(见下面的屏幕截图)。

这里我发现此错误可能是由于加密、身份验证、PFS 或偶尔的终身提案不匹配造成的。但我的是正确的。 还有什么其他因素可能导致 NO_PROPOSAL_CHOSEN? (遗憾的是我无法访问响应器,因此无法检查日志或在那里更改配置)。

ipsec.conf:

config setup
conn VDI
        left=%any
        leftauth=psk
        leftauth2=xauth
        leftid=userfqdn:VDI
        leftsourceip=%config
        right=163.x.y.z
        rightauth=psk
        aggressive=yes
        auto=add
        dpdaction=restart
        dpddelay=20s
        keyexchange=ikev1
        lifetime=8h
        ikelifetime=8h
        modeconfig=pull
        xauth_identity=DR400
        ike=aes256-sha1-modp2048
        esp=aes256-sha2_256-modp2048

ipsec.秘密:

: PSK "zzzzzzzzzzzzzz"
DR400 : XAUTH "xxxxxxxxxx"

卡戎输出:

~$ sudo ipsec up VDI
initiating Aggressive Mode IKE_SA VDI[1] to 163.x.y.z
generating AGGRESSIVE request 0 [ SA KE No ID V V V V V ]
sending packet: from 192.168.1.214[500] to 163.x.y.z[500] (547 bytes)
received packet: from 163.x.y.z[500] to 192.168.1.214[500] (556 bytes)
parsed AGGRESSIVE response 0 [ SA KE No ID V V NAT-D NAT-D V V HASH ]
received DPD vendor ID
received draft-ietf-ipsec-nat-t-ike-02\n vendor ID
received XAuth vendor ID
received unknown vendor ID: bf:c2:2e:98:56:ba:99:36:11:c1:1e:48:a6:d2:08:07:a9:5b:ed:b3:93:02:6a:49:e6:0f:ac:32:7b:b9:60:1b:56:6b:34:39:4d:54:49:75:4e:53:34:79:49:45:4a:4f:50:54:59:77:4f:54:59:79:4f:41:3d:3d
local host is behind NAT, sending keep alives
generating AGGRESSIVE request 0 [ HASH NAT-D NAT-D ]
sending packet: from 192.168.1.214[4500] to 163.x.y.z[4500] (108 bytes)
received packet: from 163.x.y.z[4500] to 192.168.1.214[4500] (124 bytes)
parsed TRANSACTION request 3540227287 [ HASH CPRQ(X_USER X_PWD X_MSG) ]
XAuth message: Please Enter Your User Name and Password :
generating TRANSACTION response 3540227287 [ HASH CPRP(X_USER X_PWD) ]
sending packet: from 192.168.1.214[4500] to 163.x.y.z[4500] (92 bytes)
received packet: from 163.x.y.z[4500] to 192.168.1.214[4500] (124 bytes)
parsed TRANSACTION request 3540227287 [ HASH CPS(ADDR MASK DNS DNS U_DEFDOM X_STATUS) ]
XAuth authentication of 'DR400' (myself) successful
IKE_SA VDI[1] established between 192.168.1.214[VDI]...163.x.y.z[163.x.y.z]
scheduling reauthentication in 27760s
maximum IKE_SA lifetime 28300s
generating TRANSACTION response 3540227287 [ HASH CPA(X_STATUS) ]
sending packet: from 192.168.1.214[4500] to 163.x.y.z[4500] (76 bytes)
generating TRANSACTION request 4217090559 [ HASH CPRQ(ADDR DNS) ]
sending packet: from 192.168.1.214[4500] to 163.x.y.z[4500] (76 bytes)
received packet: from 163.x.y.z[4500] to 192.168.1.214[4500] (92 bytes)
parsed TRANSACTION response 4217090559 [ HASH CPRP(ADDR DNS DNS) ]
installing DNS server 10.132.0.10 via resolvconf
installing DNS server 10.132.0.11 via resolvconf
installing new virtual IP 192.168.246.61
generating QUICK_MODE request 167394241 [ HASH SA No KE ID ID ]
sending packet: from 192.168.1.214[4500] to 163.x.y.z[4500] (444 bytes)
received packet: from 163.x.y.z[4500] to 192.168.1.214[4500] (92 bytes)
parsed INFORMATIONAL_V1 request 3483337871 [ HASH N(NO_PROP) ]
received NO_PROPOSAL_CHOSEN error notify
establishing connection 'VDI' failed

工作窗口连接: NCP 安全入口客户端连接工作时的配置截图

我尝试过其他各种 ESP 方案,结果相同,包括:

  • 沒有esp=
  • esp=aes256-sha2_256-modp2048!
  • esp=aes256-sha2_256
  • esp=aes256-sha2_256!
  • esp=aes256-sha1-modp2048

我也尝试过设置sha256_96 = yesipsec.conf仍然没有任何效果。

答案1

您尚未配置远程流量选择器(右子网)。因此它将默认为对等方的 IP 地址。这可能不是它所期望的(对于 IKEv1,流量选择器必须完全匹配)。

对于其他设置(例如虚拟 IP 地址和 XAuth 身份验证)指示的 roadwarrior 连接,所有内容通常都是通过隧道传输的。因此正确的设置应该是rightsubnet=0.0.0.0/0

对于这种流量选择器不匹配的情况,响应方发送的错误通知(NO_PROPOSAL_CHOSEN)是错误的,它应该发送INVALID_ID_INFORMATIONRFC 2409,第 5.5 节)。

答案2

确保用加密替换左子网您的第二个域这里是一个例子

leftid= 5.99.0.99
leftsubnet= 6.92.22.0/32

对我有用

相关内容