Skip to main content
7 of 9
added 780 characters in body

IPSec IKEv2 on pfSense: "parsed INFORMATIONAL request 2 [ N(AUTH_FAILED) ]"

I am trying to setup an IPSec IKEv2 VPN Network on a pfSense. The pfsense is situated directly behind the modem. I connect to it by a static IP address. There is no double NAT. I followed this tutorial:

netgate IKEv2 Tutorial

The connection doesn't work. The log on the pfSense for an android trying to connect to the firewall:

    Sep 6 07:59:03  charon  97494   07[NET] <1> received packet: from 109.42.113.240[49837] to xxx.xxx.xxx.xxx[500] (650 bytes)
Sep 6 07:59:03  charon  97494   07[ENC] <1> parsed IKE_SA_INIT request 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) N(HASH_ALG) N(REDIR_SUP) ]
Sep 6 07:59:03  charon  97494   07[CFG] <1> looking for an IKEv2 config for xxx.xxx.xxx.xxx...109.42.113.240
Sep 6 07:59:03  charon  97494   07[CFG] <1> candidate: xxx.xxx.xxx.xxx...0.0.0.0/0, ::/0, prio 1052
Sep 6 07:59:03  charon  97494   07[CFG] <1> found matching ike config: xxx.xxx.xxx.xxx...0.0.0.0/0, ::/0 with prio 1052
Sep 6 07:59:03  charon  97494   07[IKE] <1> 109.42.113.240 is initiating an IKE_SA
Sep 6 07:59:03  charon  97494   07[IKE] <1> IKE_SA (unnamed)[1] state change: CREATED => CONNECTING
Sep 6 07:59:03  charon  97494   07[CFG] <1> selecting proposal:
Sep 6 07:59:03  charon  97494   07[CFG] <1> proposal matches
Sep 6 07:59:03  charon  97494   07[CFG] <1> received proposals: IKE:AES_CBC_256/AES_CBC_128/HMAC_SHA2_512_256/HMAC_SHA2_384_192/HMAC_SHA2_256_128/HMAC_SHA1_96/PRF_HMAC_SHA2_512/PRF_HMAC_SHA2_384/PRF_HMAC_SHA2_256/PRF_HMAC_SHA1/MODP_2048_256/ECP_384/ECP_256/MODP_2048/MODP_1536, IKE:AES_GCM_16_256/AES_GCM_16_128/PRF_HMAC_SHA2_512/PRF_HMAC_SHA2_384/PRF_HMAC_SHA2_256/PRF_HMAC_SHA1/MODP_2048_256/ECP_384/ECP_256/MODP_2048/MODP_1536
Sep 6 07:59:03  charon  97494   07[CFG] <1> configured proposals: IKE:AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/MODP_2048
Sep 6 07:59:03  charon  97494   07[CFG] <1> selected proposal: IKE:AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/MODP_2048
Sep 6 07:59:03  charon  97494   07[CFG] <1> received supported signature hash algorithms: sha256 sha384 sha512
Sep 6 07:59:03  charon  97494   07[IKE] <1> remote host is behind NAT
Sep 6 07:59:03  charon  97494   07[IKE] <1> DH group MODP_2048_256 unacceptable, requesting MODP_2048
Sep 6 07:59:03  charon  97494   07[ENC] <1> generating IKE_SA_INIT response 0 [ N(INVAL_KE) ]
Sep 6 07:59:03  charon  97494   07[NET] <1> sending packet: from xxx.xxx.xxx.xxx[500] to 109.42.113.240[49837] (38 bytes)
Sep 6 07:59:03  charon  97494   07[IKE] <1> IKE_SA (unnamed)[1] state change: CONNECTING => DESTROYING
Sep 6 07:59:03  charon  97494   07[NET] <2> received packet: from 109.42.113.240[49837] to xxx.xxx.xxx.xxx[500] (650 bytes)
Sep 6 07:59:03  charon  97494   07[ENC] <2> parsed IKE_SA_INIT request 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) N(HASH_ALG) N(REDIR_SUP) ]
Sep 6 07:59:03  charon  97494   07[CFG] <2> looking for an IKEv2 config for xxx.xxx.xxx.xxx...109.42.113.240
Sep 6 07:59:03  charon  97494   07[CFG] <2> candidate: xxx.xxx.xxx.xxx...0.0.0.0/0, ::/0, prio 1052
Sep 6 07:59:03  charon  97494   07[CFG] <2> found matching ike config: xxx.xxx.xxx.xxx...0.0.0.0/0, ::/0 with prio 1052
Sep 6 07:59:03  charon  97494   07[IKE] <2> 109.42.113.240 is initiating an IKE_SA
Sep 6 07:59:03  charon  97494   07[IKE] <2> IKE_SA (unnamed)[2] state change: CREATED => CONNECTING
Sep 6 07:59:03  charon  97494   07[CFG] <2> selecting proposal:
Sep 6 07:59:03  charon  97494   07[CFG] <2> proposal matches
Sep 6 07:59:03  charon  97494   07[CFG] <2> received proposals: IKE:AES_CBC_256/AES_CBC_128/HMAC_SHA2_512_256/HMAC_SHA2_384_192/HMAC_SHA2_256_128/HMAC_SHA1_96/PRF_HMAC_SHA2_512/PRF_HMAC_SHA2_384/PRF_HMAC_SHA2_256/PRF_HMAC_SHA1/MODP_2048/MODP_2048_256/ECP_384/ECP_256/MODP_1536, IKE:AES_GCM_16_256/AES_GCM_16_128/PRF_HMAC_SHA2_512/PRF_HMAC_SHA2_384/PRF_HMAC_SHA2_256/PRF_HMAC_SHA1/MODP_2048/MODP_2048_256/ECP_384/ECP_256/MODP_1536
Sep 6 07:59:03  charon  97494   07[CFG] <2> configured proposals: IKE:AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/MODP_2048
Sep 6 07:59:03  charon  97494   07[CFG] <2> selected proposal: IKE:AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/MODP_2048
Sep 6 07:59:03  charon  97494   07[CFG] <2> received supported signature hash algorithms: sha256 sha384 sha512
Sep 6 07:59:03  charon  97494   07[IKE] <2> remote host is behind NAT
Sep 6 07:59:03  charon  97494   07[CFG] <2> sending supported signature hash algorithms: sha256 sha384 sha512 identity
Sep 6 07:59:03  charon  97494   07[IKE] <2> sending cert request for "CN=CApfSense, C=DE, ST=SH, L=Kiel"
Sep 6 07:59:03  charon  97494   07[ENC] <2> generating IKE_SA_INIT response 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) CERTREQ N(HASH_ALG) N(CHDLESS_SUP) N(MULT_AUTH) ]
Sep 6 07:59:03  charon  97494   07[NET] <2> sending packet: from xxx.xxx.xxx.xxx[500] to 109.42.113.240[49837] (489 bytes)
Sep 6 07:59:03  charon  97494   07[NET] <2> received packet: from 109.42.113.240[58932] to xxx.xxx.xxx.xxx[4500] (352 bytes)
Sep 6 07:59:03  charon  97494   07[ENC] <2> parsed IKE_AUTH request 1 [ IDi CPRQ(ADDR DNS) SA TSi TSr N(MOBIKE_SUP) N(ADD_6_ADDR) N(ADD_6_ADDR) N(MULT_AUTH) N(EAP_ONLY) N(MSG_ID_SYN_SUP) ]
Sep 6 07:59:03  charon  97494   07[CFG] <2> looking for peer configs matching xxx.xxx.xxx.xxx[%any]...109.42.113.240[mobile]
Sep 6 07:59:03  charon  97494   07[CFG] <2> candidate "con-mobile", match: 1/1/1052 (me/other/ike)
Sep 6 07:59:03  charon  97494   07[CFG] <con-mobile|2> selected peer config 'con-mobile'
Sep 6 07:59:03  charon  97494   07[IKE] <con-mobile|2> initiating EAP_IDENTITY method (id 0x00)
Sep 6 07:59:03  charon  97494   07[IKE] <con-mobile|2> processing INTERNAL_IP4_ADDRESS attribute
Sep 6 07:59:03  charon  97494   07[IKE] <con-mobile|2> processing INTERNAL_IP4_DNS attribute
Sep 6 07:59:03  charon  97494   07[IKE] <con-mobile|2> peer supports MOBIKE
Sep 6 07:59:03  charon  97494   07[IKE] <con-mobile|2> got additional MOBIKE peer address: 2a00:20:7001:d583:88d0:45b0:8275:ddf7
Sep 6 07:59:03  charon  97494   07[IKE] <con-mobile|2> got additional MOBIKE peer address: 2a00:20:70ce:7c05:b6b3:d5fb:adc5:c902
Sep 6 07:59:03  charon  97494   07[IKE] <con-mobile|2> authentication of 'xxx.xxx.xxx.xxx' (myself) with RSA_EMSA_PKCS1_SHA2_256 successful
Sep 6 07:59:03  charon  97494   07[IKE] <con-mobile|2> sending end entity cert "CN=pfSense, C=DE, ST=SH, L=Kiel"
Sep 6 07:59:03  charon  97494   07[ENC] <con-mobile|2> generating IKE_AUTH response 1 [ IDr CERT AUTH EAP/REQ/ID ]
Sep 6 07:59:03  charon  97494   07[NET] <con-mobile|2> sending packet: from xxx.xxx.xxx.xxx[4500] to 109.42.113.240[58932] (1472 bytes)
Sep 6 07:59:03  charon  97494   07[NET] <con-mobile|2> received packet: from 109.42.113.240[58932] to xxx.xxx.xxx.xxx[4500] (80 bytes)
Sep 6 07:59:03  charon  97494   07[ENC] <con-mobile|2> parsed INFORMATIONAL request 2 [ N(AUTH_FAILED) ]
Sep 6 07:59:03  charon  97494   07[ENC] <con-mobile|2> generating INFORMATIONAL response 2 [ N(AUTH_FAILED) ]
Sep 6 07:59:03  charon  97494   07[NET] <con-mobile|2> sending packet: from xxx.xxx.xxx.xxx[4500] to 109.42.113.240[58932] (80 bytes)
Sep 6 07:59:03  charon  97494   07[IKE] <con-mobile|2> IKE_SA con-mobile[2] state change: CONNECTING => DESTROYING 

The issue seems to be in these lines:

Sep 6 07:59:03  charon  97494   07[ENC] <con-mobile|2> parsed INFORMATIONAL request 2 [ N(AUTH_FAILED) ]
Sep 6 07:59:03  charon  97494   07[ENC] <con-mobile|2> generating INFORMATIONAL response 2 [ N(AUTH_FAILED) ]

What does it mean and where should I look for setup mistakes? Apparently it is an authentification issue. Is there something wrong with the certificates? What else could be the reason? (The certificates are installed on my phone as well of course) I also tried to connect with a windows client which also failed.

It looks like that the key exchange first fails ("generating IKE_SA_INIT response 0 [ N(INVAL_KE) ]") and then succeeds at the second attempt. Why?

The RFC5996 states: "All errors that occur in an IKE_AUTH exchange, causing the authentication to fail for whatever reason (invalid shared secret, invalid ID, untrusted certificate issuer, revoked or expired certificate, etc.) SHOULD result in an AUTHENTICATION_FAILED notification."

What is meant by ID and shared secret?

My config:

Phase 1: Key exchange version: IKEv2 Internet Protocol: IPv4 Interface: WAN Authentification Method: EAP-MSChapv2 My Identifier: IP-Address IP: xxx.xxx.xxx.xxx Peer identifier: any My certificate: the correct one Encryption alghorithm: AES 256bit, SHA 256, DH Group 14 MOBIKE enabled DPD enabled

Phase 2: Mode: Tunnel IPv4 Local Network: Network, 0.0.0.0/0 NAT translation: None Protocol: ESP Encryption Alghoritm: AES 256 bits, AES-GCM256 Auto Hash Algorithm: SHA256, SHA384, SHA512

Mobile Client: Enabled User Authentification: Local Database Provide a virtual IP address to clients: enabled, 10.169.90.0/24 Provide a list of accessible networks to clients enabled

Pre-shared key: Identifier: mobile Type: EAP Key: xxxxxxx

Firewall: IPsec all open

Phase 1 setting (1) Phase 1 setting (2)

Phase 2: Phase 2 setting

Mobile client: Mobile client

Pre-shared Key: Pre-shared key

Firewall: Firewall