Project

General

Profile

Issue #1252

Unable to connect to a Windows Server 2008 commercial VPN

Added by Federico Rossi over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Category:
configuration
Affected version:
5.1.2
Resolution:
No feedback

Description

I am trying to use strongswan directly from linux (no network manager support) to connect to a Windows server 2008 VPN in order to redirect all my internet traffic through a VPN. The commercial VPN supports L2TP/Ipsec through a shared psk plus the standard username/password credential (as far as I have understood L2TP could not be necessary and in any case L2TP protocol sets up after the IPSEC tunnel has been established); I have no problem in connecting from Windows, yet from linux the tunnel is never established. The ipsec.conf, ipsec.secrets and the connection logs are attached, here follows just a brief summary of what happens:

1) If I use leftauth=eap and rightauth=psk the connection fails because the server seems to provide by itself its certificate and strongswan client drops the connection since psk verification has not taken place (constraint requires pre-shared key authentication, but public key was used).

2) If I use leftauth=eap and rightauth=pubkey (so I skip psk) strongswan verifies the server certificate, performs a successful EAP authentication (which works perfecty because if I change either the username or password an error is returned), but then another authentication is made which, unluckily, fails (EAP method EAP_MSCHAPV2 succeeded, MSK established, reinitiating already active tasks,IKE_AUTH task, authentication of 'purevpn0sxxxxxx' (myself) with EAP, parsed IKE_AUTH response 5 [ N(FAIL_CP_REQ) ], [IKE] AUTH payload missing, [ENC] generating INFORMATIONAL request 6 [ N(AUTH_FAILED) ]).

In the log even though the EAP authentication is reported to be successful I can read: EAP-MS-CHAPv2 succeeded: '(null)', which seems quite strange (I would expect a non null string between quotes). Moreover I do not know what option in configuration enables the verification of psk in place of certificate.

Probably it is just a configuration issue, but I was unable to find a working configuration example in https://wiki.strongswan.org/projects/strongswan/wiki/IKEv2Examples.

strongswan.log (160 KB) strongswan.log Federico Rossi, 05.01.2016 12:07
strongswan.log (160 KB) strongswan.log Federico Rossi, 05.01.2016 23:46
log traceroute + wget.txt (55.8 KB) log traceroute + wget.txt Strongswan log Federico Rossi, 05.02.2016 17:37
wget wireshark error.pcapng (29.4 KB) wget wireshark error.pcapng Federico Rossi, 05.02.2016 17:37

History

#1 Updated by Federico Rossi over 9 years ago

#2 Updated by Tobias Brunner over 9 years ago

  • Description updated (diff)
  • Category set to configuration
  • Status changed from New to Feedback

1) If I use leftauth=eap and rightauth=psk the connection fails because the server seems to provide by itself its certificate and strongswan client drops the connection since psk verification has not taken place (constraint requires pre-shared key authentication, but public key was used).

Since the combination of EAP with PSK authentication is not valid for IKEv2 (even though strongSwan supports it) it's likely that Windows does not actually do or support that.

2) If I use leftauth=eap and rightauth=pubkey (so I skip psk) strongswan verifies the server certificate, performs a successful EAP authentication (which works perfecty because if I change either the username or password an error is returned), but then another authentication is made which

No, no other authentication is made. The problem is this:

parsed IKE_AUTH response 5 [ N(FAIL_CP_REQ) ]

The error received is FAILED_CP_REQUIRED, i.e. the server complains that the client has not requested any configuration payloads (virtual IPs, DNS servers). So add leftsourceip=%config to request a virtual IP and DNS servers. You might also want to configure rightsubnet=0.0.0.0/0. An example Linux client configuration may be found at IKEv2ClientConfig.

In the log even though the EAP authentication is reported to be successful I can read: EAP-MS-CHAPv2 succeeded: '(null)', which seems quite strange (I would expect a non null string between quotes).

No that's quite common. The string is a welcome/information string which the server may optionally provide within the EAP-MSCHAPv2 protocol.

#3 Updated by Federico Rossi over 9 years ago

Ok with both leftsourceip and rightsubnet it connects and it does redirect all internet traffic to the vpn endpoint as I can see from a traceroute log. However there are a lot of issues:

1) internet navigation mainly does not work, the browser keeps waiting forever for most of the websites. I tried with a simple wget command to retrieve the main html webpage of a website (e.g. wget -S -T5 http://213.92.16.17), but it goes into timeout and no html headers are returned at all. I have included a wireshark capture (together with the strongswan log), there are some tcp errors in wireshark (unluckily the http request packet is not logged in wireshark - it logs only the encrypted esp payload, still wondering why - whereas the returned http response is logged, but it is empty - only tcp header). I have also tried with a direct telnet to port 80 of a website, the telnet client connects but whatever command I wrote the connection is always aborted (no response from web server).

2) Sometimes even the nslookup does not work (it depends on the connection, if you disconnect and reconnect it might not happen) and in any case wget provided with the direct ip address behaves in the same way as before. Sometimes even if nslookup works, wget is not able to resolve the domain name correctly and so ip address has to be used directly.

3) Very few times I managed to retrieve the google webpage.

Do you have any idea why this could happen ? In the strongswan log I found the following dubious entries:

1) Just after connecting there is an INFORMATIONAL re-request , whose response is retransmitted accordingly.

2) CHILD_SA ESP/0xc455b898/xx.yy.zz.ww not found for delete, after having received a XFRM_MSG_EXPIRE

3) CHILD_SA ESP/0xc2b66928/xx.yy.zz.ww not found for rekey, again after having received a XFRM_MSG_EXPIRE

The VPN provider states it supports both an IKEV2 and L2TP vpn (https://support.purevpn.com/vpn-servers) . I do not know if this could be a provider issue, but on Windows there isn't any issue with the same vpn (I am quite sure it's a Windows 2008 server). If you are interested in debugging this vpn I can "borrow" you my credentials for some time.

compile@LupinIII-LINUX:~/strongswan-5.3.5$ traceroute www.google.com
traceroute to www.google.com (66.102.1.103), 30 hops max, 60 byte packets
 1  swe-net-ip.as51430.net (37.46.122.3)  38.872 ms  40.513 ms  40.892 ms
 2  nld-net-ip.as51430.net (79.142.74.3)  40.837 ms  40.743 ms  41.060 ms
 3  nld-net-ip.as51430.net (37.46.123.249)  40.867 ms * *
 4  178.21.17.20 (178.21.17.20)  43.574 ms  43.915 ms  43.799 ms
 5  core1.ams.net.google.com (80.249.208.247)  68.046 ms  69.440 ms  68.107 ms
 6  209.85.143.181 (209.85.143.181)  43.607 ms  40.821 ms 209.85.143.183 (209.85.143.183)  45.591 ms
 7  209.85.248.247 (209.85.248.247)  45.476 ms 209.85.255.41 (209.85.255.41)  44.992 ms 209.85.255.49 (209.85.255.49)  45.577 ms
 8  216.239.41.95 (216.239.41.95)  74.613 ms 216.239.41.116 (216.239.41.116)  53.009 ms 216.239.40.253 (216.239.40.253)  48.398 ms
 9  66.249.95.250 (66.249.95.250)  48.324 ms 209.85.251.231 (209.85.251.231)  48.229 ms 72.14.236.139 (72.14.236.139)  47.782 ms
10  * * *
11  wb-in-f103.1e100.net (66.102.1.103)  48.289 ms  45.096 ms  45.076 ms

compile@LupinIII-LINUX:~$ nslookup www.repubblica.it
Server:        37.46.122.62
Address:    37.46.122.62#53

Non-authoritative answer:
Name:    www.repubblica.it
Address: 213.92.16.171
Name:    www.repubblica.it
Address: 213.92.16.191

compile@LupinIII-LINUX:~$ wget -S -T5 http://www.repubblica.it
--2016-02-05 17:02:42--  http://www.repubblica.it/
Resolving www.repubblica.it (www.repubblica.it)... failed: Connection timed out.
wget: unable to resolve host address ‘www.repubblica.it’

compile@LupinIII-LINUX:~$ wget -S -T5 http://213.92.16.191
--2016-02-05 17:02:50--  http://213.92.16.191/
Connecting to 213.92.16.191:80... connected.
HTTP request sent, awaiting response... Feb  5 17:02:52 LupinIII-LINUX charon: 14[KNL] querying policy 37.46.122.26/32 === 0.0.0.0/0 out  (mark 0/0x00000000)
Read error (Connection timed out) in headers.
Retrying.

--2016-02-05 17:02:56--  (try: 2)  http://213.92.16.191/
Connecting to 213.92.16.191:80... connected.
HTTP request sent, awaiting response... Read error (Connection timed out) in headers.

#4 Updated by Federico Rossi over 9 years ago

Sorry I forgot to tell that meanwhile I had updated strongswan to the latest version 5.3.5, so all the previous tests apply to the latest version.

#5 Updated by Tobias Brunner over 9 years ago

1) Just after connecting there is an INFORMATIONAL re-request , whose response is retransmitted accordingly.

This Informational request and its retransmits are received at 16:51:51, 16:51:53, 16:51:56, 16:52:00 respectively. That's because there is a delay of 14 seconds between installing the first and the second received DNS server:

Feb  5 16:51:51 LupinIII-LINUX charon: 13[IKE] processing INTERNAL_IP4_DNS attribute
Feb  5 16:51:51 LupinIII-LINUX charon: 13[IKE] installing DNS server 37.46.122.62 via resolvconf
...
Feb  5 16:52:05 LupinIII-LINUX charon: 13[IKE] processing INTERNAL_IP4_DNS attribute
Feb  5 16:52:05 LupinIII-LINUX charon: 13[IKE] installing DNS server 8.8.4.4 via resolvconf
Feb  5 16:52:05 LupinIII-LINUX charon: 13[KNL] 192.168.72.139 is on interface eth0
Feb  5 16:52:05 LupinIII-LINUX charon: 13[IKE] installing new virtual IP 37.46.122.26

Perhaps a problem with resolvconf (however, the second time there does not seem to be a delay).

2) CHILD_SA ESP/0xc455b898/xx.yy.zz.ww not found for delete, after having received a XFRM_MSG_EXPIRE
3) CHILD_SA ESP/0xc2b66928/xx.yy.zz.ww not found for rekey, again after having received a XFRM_MSG_EXPIRE

It's possible that these are old SAs from an earlier run where you didn't terminate the daemon properly. These SAs will expire sometime later, if the daemon is running again at that time this will cause these messages, as it has no knowledge of these SAs. Check if you see any SAs in ip xfrm state after stopping the daemon (you may flush these with ip xfrm state flush).

If you are interested in debugging this vpn I can "borrow" you my credentials for some time.

I'm not. Ask your provider for support with their service.

#6 Updated by Tobias Brunner over 9 years ago

  • Status changed from Feedback to Closed
  • Assignee set to Tobias Brunner
  • Resolution set to No feedback