Windows 7 and newer

Windows 7 and newer releases fully support the IKEv2 (RFC 4306) and MOBIKE (RFC 4555) standards through Microsoft's Agile VPN functionality and is therefore able to interoperate with a strongSwan VPN gateway using these protocols.

strongSwan currently can authenticate Windows 7 clients either on the basis of X.509 Machine Certificates using RSA signatures (case A), X.509 User Certificates using EAP-TLS (case B), or Username/Password using EAP-MSCHAP v2 (case C).

Make sure to fulfill the certificate requirements to successfully authenticate peers with Windows 7.

Windows 7 supports IKEv1 fragmentation, but not IKEv2 fragmentation.

A) Authentication using X.509 Machine Certificates

The strongSwan VPN gateway and each Windows 7 client need an X.509 certificate issued by a Certification Authority (CA). OpenSSL or pki can be used to generate these certificates.

On the Windows 7 Client

On the strongSwan VPN Gateway

B) Authentication using X.509 User Certificates

This is very similar to case A, but certificates are stored in a user specific keystore (using smart cards is also possible in this case). The client authentication has to be done with EAP-TLS in this case. As an EAP identity exchange is needed, make sure to have the eap-identity plugin loaded.

On the Windows 7 Client

  • Storing the user certificate is basically the same as storing a Windows 7 machine certificate simply select My user account instead of Computer account in the Certificates MMC snap-in. Actually, since this keystore is used by default, you can simply double click the certificate to install it.
  • Please note that the CA certificate used to authenticate the VPN gateway has still to be installed in the Computer account keystore.
  • Configuring a Windows 7 Agile VPN connection

On the strongSwan VPN Gateway

C) Authentication using EAP-MSCHAP v2

In order to prevent man-in-the-middle attacks the strongSwan VPN gateway always authenticates itself with an X.509 certificate using a strong RSA/ECDSA signature. After a secure communication channel has been set up by the IKEv2 protocol, the Windows 7 clients authenticate themselves using the EAP-MSCHAPv2 protocol based on user name, optional windows domain and user password. As an EAP identity exchange is needed for this to work, make sure to have the eap-identity plugin loaded.

EAP-MSCHAPv2 requires MD4 to generate the NT-Hashes, so either the md4 plugin or one of the crypto library wrappers (OpenSSL, Gcrypt) is required. This is not needed if the authentication is delegated to an AAA server via EAP-RADIUS.

Some Windows clients will always send a domain part in the user name field (e.g. Windows Phone\User). Depending on the backend used to authenticate the users the domain part may have to be stripped away (see #612-3 for an example regarding FreeRADIUS), or be included when defining the credentials (e.g. in EAP secrets in ipsec.secrets).

Important: strongSwan releases before 4.3.1 are not compatible with Windows 7 RC (Build 7100) or later, because Microsoft's EAP-MSCHAPv2 implementation changed from Beta to Release Candidate.

On the Windows 7 Client

On the strongSwan VPN Gateway

Rekeying behavior

IKE_SA rekeying

The Windows 7 client supports IKE_SA rekeying, but can't handle unsupported Diffie Hellman groups. If a strongSwan gateway initiates IKE_SA rekeying, it must use modp1024 as the DH group in the first attempt, otherwise rekeying fails. You can achieve this by setting modp1024 as the first (or only) DH group in the gateways ike proposal.

CHILD_SA rekeying

Rekeying CHILD_SAs is also supported by the Windows 7 client. For some reason, a client behind NAT does not accept a rekeying attempt and rejects it with a Microsoft specific notify 12345, containing an error code ERROR_IPSEC_IKE_INVALID_SITUATION.

To work around the issue, let the client initiate the rekeying (set rekey=no on the server). It will do so about every 58 minutes and 46 seconds, so set the gateway rekey time a little higher. There is no way known to change the rekey time (the netsh.ras.ikev2saexpiry options affect the Windows Server implementation only).

Another option is to set no rekey time, but only a hard lifetime to delete the CHILD_SA. The client will renegotiate the SA when required.


Windows doesn't add IPv6 route by default. There are two workarounds:

  • Add a permanent default route manually using the following or similar command:
    netsh interface ipv6 add route ::/0 interface=27
    Where 27 is your IKEv2 interface ID.
  • Configure and use router advertisement daemon (see #817)


  • MoPo users at the University of Freiburg can connect to a strongSwan VPN gateway using Windows 7 (in German).


Many thanks go to Edward Chang and Gleb Sechenov from the Information Security Institute (ISI) of the Queensland University of Technology (QUT) who provided the initial Windows 7 Beta and Ubuntu Linux test setup.