Some troubles with RRAS IKEv2 with EAP or MSCHAPv2 with MAC/Iphone, Android and linux machines

Pierre-Yves M 20 Reputation points
2023-06-27T08:09:38.0066667+00:00

I built an RRAS server on Windows 2016 (tested in 2022 too) for the purpose of using IKEv2 service.

So I prepared the certificate template from my authority with the following parameters:

  • The desired duration
  • Authority compatibility => Windows Server 2016
  • Recipient compatibility => Windows 10 / Windows Server 2016
  • Extensions:
    • Application Policies: Server Auth / IPSEC IKE intermediate / Client Auth / non-critical extension
    • Key Usage: Digital signature / Allow key exchange only with key encryption / extension critical
  • Security: Give access to my RRAS computer object to make the enrollment
  • Cryptography:
    • Maximum key size: 2048 Determined by CSP
    • Requests must use one of the following: MS RSA SChannel Crypto Provider

I was then able to request a certificate by positioning the correct common name (external and internal DNS names) and associating it in the RRAS config, security tab.

Authentication Methods:

  • EAP
  • MS-CHAP v2
  • CHAP
  • Allow machine cert for IKEv2

Then from elevated powershell on server:

Set-VpnServerConfiguration -CustomPolicy -AuthenticationTransformConstants SHA256128 -CipherTransformConstants AES128 -DHGroup Group14 -EncryptionMethod AES128 -IntegrityCheckMethod SHA256 -PFSgroup PFS2048 -SALifeTimeSeconds 28800 -MMSALifeTimeSeconds 86400 -SAData SizeForRenegotiationKilobytes 1024000

$rootcert = ( Get-ChildItem -Path cert:LocalMachine\root | Where-Object -FilterScript { $_.Subject -Like "*CN=myorga*" } )
Set-VpnAuthProtocol -RootCertificateNameToAccept $rootcert -PassThru

Restart-Service RemoteAccess -PassThru

From Windows client in elevated prowershell after created the IKE connection in IKEv2 mode:

Set-VpnConnectionIPsecConfiguration -ConnectionName "IKE" -AuthenticationTransformConstants SHA256128 -CipherTransformConstants AES128 -DHGroup Group14 -EncryptionMethod AES128 -IntegrityCheckMethod SHA256 -PFSgroup PFS2048 -Force

This client is on the same domain so through a GPO the machine already have the root CA certif on his container, and the connection works for my Windows client, but unable to get the connection to work on MacOS, Iphone, Android 12+ and linux.

On each of the cases where it does not work I was able to integrate the root certificate without problem so my concern does not come from there, in the logs of the linux machine I have the following sample:

Root CA has been placed on trusty CA, I downloaded the RRAS certif to use it on the config, select authentication EAP, and specified Ciphers as:

IKE=aes128-sha256-modp2048

For ESP I use:
ESP=aes128-sha256

And same result with :
ESP=aes128-sha256-modp2048

Jun 26 13:35:16 LAP charon-nm: 07[IKE] authentication of 'CN=internal-name, CN=external-name' with RSA signature successful
Jun 26 13:35:16 LAP charon-nm:07[IKE] server requested EAP_IDENTITY (id 0x00), sending 'user-test'
Jun 26 13:35:16 LAP charon-nm: 07[ENC] generating IKE_AUTH request 2 [ EAP/RES/ID ]
Jun 26 13:35:16 LAP charon-nm: 07[NET] sending packet: from IP-LAN[45713] to IP-PUB[4500] (96 bytes)
Jun 26 13:35:16 LAP charon-nm: 16[NET] received packet: from IP-PUB[4500] to IP-LAN[45713] (112 bytes)
Jun 26 13:35:16 LAP charon-nm:16[ENC] parsed IKE_AUTH response 2 [ EAP/REQ/MSCHAPV2 ]
Jun 26 13:35:16 LAP charon-nm:16[IKE] server requested EAP_MSCHAPV2 authentication (id 0x01)
Jun 26 13:35:16 LAP charon-nm: 16[ENC] generating IKE_AUTH request 3 [ EAP/RES/MSCHAPV2 ]
Jun 26 13:35:16 LAP charon-nm: 16[NET] sending packet: from IP-LAN[45713] to IP-PUB[4500] (144 bytes)
Jun 26 13:35:16 LAP charon-nm: 09[NET] received packet: from IP-PUB[4500] to IP-LAN[45713] (128 bytes)
Jun 26 13:35:16 LAP charon-nm:09[ENC] parsed IKE_AUTH response 3 [ EAP/REQ/MSCHAPV2 ]
Jun 26 13:35:16 LAP charon-nm:09[IKE] EAP-MS-CHAPv2 succeeded: '(null)'
Jun 26 13:35:16 LAP charon-nm:09[ENC] generating IKE_AUTH request 4 [ EAP/RES/MSCHAPV2 ]
Jun 26 13:35:16 LAP charon-nm: 09[NET] sending packet: from IP-LAN[45713] to IP-PUB[4500] (80 bytes)
Jun 26 13:35:16 LAP charon-nm: 08[NET] received packet: from IP-PUB[4500] to IP-LAN[45713] (80 bytes)
Jun 26 13:35:16 LAP charon-nm:08[ENC] parsed IKE_AUTH response 4 [ EAP/SUCC ]
Jun 26 13:35:16 LAP charon-nm: 08[IKE] EAP method EAP_MSCHAPV2 succeeded, MSK established
Jun 26 13:35:16 LAP charon-nm:08[IKE] authentication of 'user-test' (myself) with EAP
Jun 26 13:35:16 LAP charon-nm:08[ENC] generating IKE_AUTH request 5 [ AUTH ]
Jun 26 13:35:16 LAP charon-nm: 08[NET] sending packet: from IP-LAN[45713] to IP-PUB[4500] (112 bytes)
Jun 26 13:35:16 LAP charon-nm: 11[NET] received packet: from IP-PUB[4500] to IP-LAN[45713] (80 bytes)
Jun 26 13:35:16 LAP charon-nm: 11[ENC] parsed IKE_AUTH response 5 [ N(FAIL_CP_REQ) ]
Jun 26 13:35:16 LAP charon-nm: 11[IKE] AUTH payload missing
Jun 26 13:35:16 LAP charon-nm: 11[ENC] generating INFORMATIONAL request 6 [ N(AUTH_FAILED) ]
Jun 26 13:35:16 LAP charon-nm: 11[NET] sending packet: from IP-LAN[45713] to IP-PUB[4500] (80 bytes)

Impossible in the state to pass a connection with something other than the Windows machine.

So the question, are we sure that devices other than Windows can access a Windows 2016 or later IKEv2 (EAP / MSChapv2) VPN server?

And if so, does my concern speak to someone?

Thanks for reading me !

Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. Gary Nebbett 6,216 Reputation points
    2023-06-27T12:58:37.33+00:00

    Hello Pierre-Yves,

    Yes, I am sure that non-Windows devices can access Windows 2016 via an IKEv2 (EAP-MSCHAPv2) VPN connection.

    The first sign of the problem in your trace data is the text "[N(FAIL_CP_REQ)]" - this indicates an error code with the full (RFC 5996) name of "FAILED_CP_REQUIRED".

    The IKEv2 packet exchanges should look like this extract from RFC 5996 (appendix C.3):

       first request       --> IDi,
                               [N(INITIAL_CONTACT)],
                               [[N(HTTP_CERT_LOOKUP_SUPPORTED)], CERTREQ+],
                               [IDr],
                               [CP(CFG_REQUEST)],
                               [N(IPCOMP_SUPPORTED)+],
                               [N(USE_TRANSPORT_MODE)],
                               [N(ESP_TFC_PADDING_NOT_SUPPORTED)],
                               [N(NON_FIRST_FRAGMENTS_ALSO)],
                               SA, TSi, TSr,
                               [V+][N+]
    
       first response      <-- IDr, [CERT+], AUTH,
                               EAP,
                               [V+][N+]
    
                         / --> EAP
       repeat 1..N times |
                         \ <-- EAP
    
       last request        --> AUTH
    
       last response       <-- AUTH,
                               [CP(CFG_REPLY)],
                               [N(IPCOMP_SUPPORTED)],
                               [N(USE_TRANSPORT_MODE)],
                               [N(ESP_TFC_PADDING_NOT_SUPPORTED)],
                               [N(NON_FIRST_FRAGMENTS_ALSO)],
                               SA, TSi, TSr,
                               [N(ADDITIONAL_TS_POSSIBLE)],
                               [V+][N+]
    
    

    AlthoughThis trace shows the packets that are typically exchanged in your scenario:

    User's image

    Gary

    0 comments No comments

  2. Pierre-Yves M 20 Reputation points
    2023-06-27T16:17:53.4266667+00:00

    Ok Gary and thanks for your answer,

    I will have a look on that!

    0 comments No comments

  3. Pierre-Yves M 20 Reputation points
    2023-06-27T16:22:04.08+00:00

    Regarding Android or Ipad where I cannot specify much parameters, we only have remote dest, credentials, and tunnel type (IKE EAP/MSCHAP), this problem can not be solved from the RRAS?


  4. Pierre-Yves M 20 Reputation points
    2023-06-27T16:48:30.38+00:00

    A tcpdump extract for the linux attempt :

    IP_DNS.53 > IP-LAN.55258: [udp sum ok] 38237 q: A? remote-VPN. 1/0/1 remote-VPN. A IP-PUB ar: . OPT UDPsize=4096 (72)
    IP_DNS.53 > IP-LAN.34656: [udp sum ok] 10760 q: A? remote-VPN. 1/0/1 remote-VPN. A IP-PUB ar: . OPT UDPsize=4096 (72)
    IP-LAN.60908 > IP-PUB.500: [bad udp cksum 0x9a98 -> 0x8249!] isakmp 2.0 msgid 00000000 cookie 1412d1d2645a4f9f->0000000000000000: parent_sa ikev2_init[I]:
    IP-PUB.500 > IP-LAN.60908: [udp sum ok] isakmp 2.0 msgid 00000000 cookie 1412d1d2645a4f9f->eff776d3d4e46255: parent_sa ikev2_init[R]:
    IP-LAN.51846 > IP-PUB.4500: [bad udp cksum 0x9a3c -> 0x6c6e!] NONESP-encap: isakmp 2.0 msgid 00000001 cookie 1412d1d2645a4f9f->eff776d3d4e46255: child_sa  ikev2_auth[I]:
    IP-PUB.4500 > IP-LAN.51846: NONESP-encap: isakmp 2.0 msgid 00000001 cookie 1412d1d2645a4f9f->eff776d3d4e46255: child_sa  ikev2_auth[R]: [|v2e] (len mismatch: isakmp 2080/ip 1468)
    IP-PUB > IP-LAN: ip-proto-17 IP-LAN.51846 > IP-PUB.4500: [bad udp cksum 0x992c -> 0xcb65!] NONESP-encap: isakmp 2.0 msgid 00000002 cookie 1412d1d2645a4f9f->eff776d3d4e46255: child_sa  ikev2_auth[I]:
    IP-PUB.4500 > IP-LAN.51846: [udp sum ok] NONESP-encap: isakmp 2.0 msgid 00000002 cookie 1412d1d2645a4f9f->eff776d3d4e46255: child_sa  ikev2_auth[R]:
    IP-LAN.51846 > IP-PUB.4500: [bad udp cksum 0x995c -> 0xfdda!] NONESP-encap: isakmp 2.0 msgid 00000003 cookie 1412d1d2645a4f9f->eff776d3d4e46255: child_sa  ikev2_auth[I]:
    IP-PUB.4500 > IP-LAN.51846: [udp sum ok] NONESP-encap: isakmp 2.0 msgid 00000003 cookie 1412d1d2645a4f9f->eff776d3d4e46255: child_sa  ikev2_auth[R]:
    IP-LAN.51846 > IP-PUB.4500: [bad udp cksum 0x991c -> 0xc29b!] NONESP-encap: isakmp 2.0 msgid 00000004 cookie 1412d1d2645a4f9f->eff776d3d4e46255: child_sa  ikev2_auth[I]:
    IP-PUB.4500 > IP-LAN.51846: [udp sum ok] NONESP-encap: isakmp 2.0 msgid 00000004 cookie 1412d1d2645a4f9f->eff776d3d4e46255: child_sa  ikev2_auth[R]:
    IP-LAN.51846 > IP-PUB.4500: [bad udp cksum 0x993c -> 0xa1ed!] NONESP-encap: isakmp 2.0 msgid 00000005 cookie 1412d1d2645a4f9f->eff776d3d4e46255: child_sa  ikev2_auth[I]:
    IP-PUB.4500 > IP-LAN.51846: [udp sum ok] NONESP-encap: isakmp 2.0 msgid 00000005 cookie 1412d1d2645a4f9f->eff776d3d4e46255: child_sa  ikev2_auth[R]:
    IP-LAN.51846 > IP-PUB.4500: [bad udp cksum 0x991c -> 0x52b3!] NONESP-encap: isakmp 2.0 msgid 00000006 cookie 1412d1d2645a4f9f->eff776d3d4e46255: child_sa  inf2[I]:
    IP-PUB.4500 > IP-LAN.51846: [udp sum ok] NONESP-encap: isakmp 2.0 msgid 00000006 cookie 1412d1d2645a4f9f->eff776d3d4e46255: child_sa  inf2[R]:
    
    

  5. Pierre-Yves M 20 Reputation points
    2023-07-03T07:49:23.5366667+00:00

    Another point to check regarding that, the root certificates as well as the RRAS certificate were exported in base 64, it seems that it is necessary for me for at least the Linux machine to have this certificate in hand and not to simply retrieve it by initiating the connection, in any case I have logs that go further in the case of doing this import.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.