[strongSwan] VPN for iOS 10, "deleting half open IKE_SA after timeout"
Klaus Bernpaintner
klaus at bernpaintner.com
Thu Mar 16 15:08:19 CET 2017
I am trying to set up StrongSwan VPN on Ubuntu for iPhone (iOS 10) road warriors. I want my iOS clients to authenticate with username and password. After a couple of days of trial-and-error I believe I am close, but the client is not completing the connection. This is the end of the log:
charon: 13[IKE] received ESP_TFC_PADDING_NOT_SUPPORTED, not using ESPv3 TFC padding
charon: 13[IKE] peer supports MOBIKE
charon: 13[IKE] authentication of 'server' (myself) with RSA signature successful
charon: 13[ENC] generating IKE_AUTH response 1 [ IDr AUTH EAP/REQ/MSCHAPV2 ]
charon: 13[NET] sending packet: from x.x.x.x[4500] to y.y.y.y[26349] (384 bytes)
charon: 10[NET] sending packet: from x.x.x.x[4500] to y.y.y.y[26349]
charon: 14[JOB] deleting half open IKE_SA after timeout
charon: 14[IKE] IKE_SA ios10[1] state change: CONNECTING => DESTROYING
Below is my setup.
Key and certificate generation
# ipsec pki --gen > caKey.der
# ipsec pki --self --in caKey.der --dn "C=CH, O=strongSwan, CN=strongSwan CA" --ca > caCert.der
# ipsec pki --gen > peerKey.der
# ipsec pki --pub --in peerKey.der | ipsec pki --issue --cacert caCert.der --cakey caKey.der --san server --dn "C=CH, O=strongSwan, CN=peer" > peerCert.der
# mv caCert.der /etc/ipsec.d/cacerts/
# mv peerKey.der /etc/ipsec.d/private/
# mv peerCert.der /etc/ipsec.d/certs/
StrongSwan configuration
—————
# ipsec.conf - strongSwan IPsec configuration file
config setup
charondebug="cfg 2, dmn 2, ike 2, net 2"
conn %default
keyexchange=ikev2
ikelifetime=60m
keylife=20m
rekeymargin=3m
keyingtries=1
conn ios10
leftid=server
leftcert=peerCert.der
rightauth=eap-mschapv2
leftsubnet=0.0.0.0/0
auto=add
—————
# ipsec.secrets
: RSA peerKey.der
myusername : EAP "abc123xyz"
—————
iPhone client configuration
Type: IKEv2
Description: "My VPN Server"
Server: <IP address of server>
Remote ID: "server"
Local ID: "client"
User Authentication: Username
Username: "myusername"
Password: "abc123xyz"
Server log at startup
charon: 00[DMN] signal of type SIGINT received. Shutting down
charon: 00[DMN] Starting IKE charon daemon (strongSwan 5.3.5, Linux 4.4.0-66-generic, x86_64)
charon: 00[CFG] loading ca certificates from '/etc/ipsec.d/cacerts'
charon: 00[CFG] loaded ca certificate "C=CH, O=strongSwan, CN=strongSwan CA" from '/etc/ipsec.d/cacerts/caCert.der'
charon: 00[CFG] loading aa certificates from '/etc/ipsec.d/aacerts'
charon: 00[CFG] loading ocsp signer certificates from '/etc/ipsec.d/ocspcerts'
charon: 00[CFG] loading attribute certificates from '/etc/ipsec.d/acerts'
charon: 00[CFG] loading crls from '/etc/ipsec.d/crls'
charon: 00[CFG] loading secrets from '/etc/ipsec.secrets'
charon: 00[CFG] loaded RSA private key from '/etc/ipsec.d/private/peerKey.der'
charon: 00[CFG] loaded EAP secret for myusername
charon: 00[CFG] opening triplet file /etc/ipsec.d/triplets.dat failed: No such file or directory
charon: 00[CFG] loaded 0 RADIUS server configurations
charon: 00[LIB] loaded plugins: charon test-vectors aes rc2 sha1 sha2 md4 md5 random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem openssl fips-prf gmp agent xcbc hmac gcm attr kernel-netlink resolve socket-default connmark farp stroke updown eap-identity eap-sim eap-sim-pcsc eap-aka eap-aka-3gpp2 eap-simaka-pseudonym eap-simaka-reauth eap-md5 eap-gtc eap-mschapv2 eap-dynamic eap-radius eap-tls eap-ttls eap-peap eap-tnc xauth-generic xauth-eap xauth-pam xauth-noauth tnc-tnccs tnccs-20 tnccs-11 tnccs-dynamic dhcp lookip error-notify certexpire led addrblock unity
charon: 00[LIB] dropped capabilities, running as uid 0, gid 0
charon: 00[JOB] spawning 16 worker threads
charon: 06[NET] waiting for data on sockets
charon: 10[CFG] received stroke: add connection 'ios10'
charon: 10[CFG] conn ios10
charon: 10[CFG] left=%any
charon: 10[CFG] leftsubnet=0.0.0.0/0
charon: 10[CFG] leftid=server
charon: 10[CFG] leftcert=peerCert.der
charon: 10[CFG] right=%any
charon: 10[CFG] rightauth=eap-mschapv2
charon: 10[CFG] ike=aes128-sha1-modp2048,3des-sha1-modp1536
charon: 10[CFG] esp=aes128-sha1,3des-sha1
charon: 10[CFG] dpddelay=30
charon: 10[CFG] dpdtimeout=150
charon: 10[CFG] mediation=no
charon: 10[CFG] keyexchange=ikev2
charon: 10[CFG] loaded certificate "C=CH, O=strongSwan, CN=peer" from 'peerCert.der'
charon: 10[CFG] added configuration 'ios10'
Server log at connection attempt
charon: 06[NET] received packet: from x.x.x.x[17279] to y.y.y.y[500]
charon: 06[NET] waiting for data on sockets
charon: 05[NET] received packet: from x.x.x.x[17279] to y.y.y.y[500] (604 bytes)
charon: 05[ENC] parsed IKE_SA_INIT request 0 [ SA KE No N(REDIR_SUP) N(NATD_S_IP) N(NATD_D_IP) N(FRAG_SUP) ]
charon: 05[CFG] looking for an ike config for y.y.y.y...x.x.x.x
charon: 05[CFG] candidate: %any...%any, prio 28
charon: 05[CFG] found matching ike config: %any...%any with prio 28
charon: 05[IKE] x.x.x.x is initiating an IKE_SA
charon: 05[IKE] IKE_SA (unnamed)[1] state change: CREATED => CONNECTING
charon: 05[CFG] selecting proposal:
charon: 05[CFG] no acceptable ENCRYPTION_ALGORITHM found
charon: 05[CFG] selecting proposal:
charon: 05[CFG] no acceptable ENCRYPTION_ALGORITHM found
charon: 05[CFG] selecting proposal:
charon: 05[CFG] no acceptable ENCRYPTION_ALGORITHM found
charon: 05[CFG] selecting proposal:
charon: 05[CFG] no acceptable DIFFIE_HELLMAN_GROUP found
charon: 05[CFG] selecting proposal:
charon: 05[CFG] no acceptable ENCRYPTION_ALGORITHM found
charon: 05[CFG] selecting proposal:
charon: 05[CFG] no acceptable ENCRYPTION_ALGORITHM found
charon: 05[CFG] selecting proposal:
charon: 05[CFG] no acceptable ENCRYPTION_ALGORITHM found
charon: 05[CFG] selecting proposal:
charon: 05[CFG] no acceptable ENCRYPTION_ALGORITHM found
charon: 05[CFG] selecting proposal:
charon: 05[CFG] no acceptable ENCRYPTION_ALGORITHM found
charon: 05[CFG] selecting proposal:
charon: 05[CFG] no acceptable DIFFIE_HELLMAN_GROUP found
charon: 05[CFG] selecting proposal:
charon: 05[CFG] proposal matches
charon: 05[CFG] received proposals: IKE:AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/MODP_2048, IKE:AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/ECP_256, IKE:AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/MODP_1536, IKE:AES_CBC_128/HMAC_SHA1_96/PRF_HMAC_SHA1/MODP_1024, IKE:3DES_CBC/HMAC_SHA1_96/PRF_HMAC_SHA1/MODP_1024
charon: 05[CFG] configured proposals: IKE:AES_CBC_128/HMAC_SHA1_96/PRF_HMAC_SHA1/MODP_2048, IKE:3DES_CBC/HMAC_SHA1_96/PRF_HMAC_SHA1/MODP_1536, IKE:AES_CBC_128/AES_CBC_192/AES_CBC_256/3DES_CBC/CAMELLIA_CBC_128/CAMELLIA_CBC_192/CAMELLIA_CBC_256/HMAC_MD5_96/HMAC_SHA1_96/HMAC_SHA2_256_128/HMAC_SHA2_384_192/HMAC_SHA2_512_256/AES_XCBC_96/PRF_HMAC_MD5/PRF_HMAC_SHA1/PRF_HMAC_SHA2_256/PRF_HMAC_SHA2_384/PRF_HMAC_SHA2_512/PRF_AES128_XCBC/MODP_2048/MODP_2048_224/MODP_2048_256/MODP_1536/MODP_3072/MODP_4096/MODP_8192/MODP_1024/MODP_1024_160/ECP_256/ECP_384/ECP_521/ECP_224/ECP_192/ECP_224_BP/ECP_256_BP/ECP_384_BP/ECP_512_BP, IKE:AES_GCM_8_128/AES_GCM_8_192/AES_GCM_8_256/AES_GCM_12_128/AES_GCM_12_192/AES_GCM_12_256/AES_GCM_16_128/AES_GCM_16_192/AES_GCM_16_256/PRF_HMAC_MD5/PRF_HMAC_SHA1/PRF_HMAC_SHA2_256/PRF_HMAC_SHA2_384/PRF_HMAC_SHA2_512/PRF_AES128_XCBC/MODP_2048/MODP_2048_224/MODP_2048_256/MODP_1536/MODP_3072/MODP_4096/MODP_8192/MODP_1024/MODP_1024_160/ECP_256/ECP_384/ECP_521/ECP_224/ECP_192/ECP_224_BP/ECP_256_BP/ECP_384_BP/ECP_512_BP
charon: 05[CFG] selected proposal: IKE:AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/MODP_2048
charon: 05[IKE] remote host is behind NAT
charon: 05[IKE] sending cert request for "C=CH, O=strongSwan, CN=strongSwan CA"
charon: 05[ENC] generating IKE_SA_INIT response 0 [ SA KE No N(NATD_S_IP) N(NATD_D_IP) CERTREQ N(MULT_AUTH) ]
charon: 05[NET] sending packet: from y.y.y.y[500] to x.x.x.x[17279] (465 bytes)
charon: 09[NET] sending packet: from y.y.y.y[500] to x.x.x.x[17279]
charon: 06[NET] received packet: from x.x.x.x[26601] to y.y.y.y[4500]
charon: 06[NET] waiting for data on sockets
charon: 12[NET] received packet: from x.x.x.x[26601] to y.y.y.y[4500] (496 bytes)
charon: 12[ENC] parsed IKE_AUTH request 1 [ IDi N(INIT_CONTACT) N(MOBIKE_SUP) IDr CPRQ(ADDR DHCP DNS MASK ADDR6 DHCP6 DNS6) N(ESP_TFC_PAD_N) N(NON_FIRST_FRAG) SA TSi TSr ]
charon: 12[CFG] looking for peer configs matching y.y.y.y[server]...x.x.x.x[client]
charon: 12[CFG] candidate "ios10", match: 20/1/28 (me/other/ike)
charon: 12[CFG] selected peer config 'ios10'
charon: 12[IKE] initiating EAP_MSCHAPV2 method (id 0x24)
charon: 12[IKE] processing INTERNAL_IP4_ADDRESS attribute
charon: 12[IKE] processing INTERNAL_IP4_DHCP attribute
charon: 12[IKE] processing INTERNAL_IP4_DNS attribute
charon: 12[IKE] processing INTERNAL_IP4_NETMASK attribute
charon: 12[IKE] processing INTERNAL_IP6_ADDRESS attribute
charon: 12[IKE] processing INTERNAL_IP6_DHCP attribute
charon: 12[IKE] processing INTERNAL_IP6_DNS attribute
charon: 12[IKE] received ESP_TFC_PADDING_NOT_SUPPORTED, not using ESPv3 TFC padding
charon: 12[IKE] peer supports MOBIKE
charon: 12[IKE] authentication of 'server' (myself) with RSA signature successful
charon: 12[ENC] generating IKE_AUTH response 1 [ IDr AUTH EAP/REQ/MSCHAPV2 ]
charon: 12[NET] sending packet: from y.y.y.y[4500] to x.x.x.x[26601] (384 bytes)
charon: 09[NET] sending packet: from y.y.y.y[4500] to x.x.x.x[26601]
And 30 seconds later…
charon: 13[JOB] deleting half open IKE_SA after timeout
charon: 13[IKE] IKE_SA ios10[1] state change: CONNECTING => DESTROYING
It behaves the exact same way if I try to connect from my Mac.
What is missing to make it work?
Thanks,
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strongswan.org/pipermail/users/attachments/20170316/f7e08e72/attachment-0001.html>
More information about the Users
mailing list