Link to home
Start Free TrialLog in
Avatar of tmi_cce
tmi_cce

asked on

Windows 7 L2TP IPSec NAT-T

Hello
I've set up a VPN between Windows 7 clients and a Juniper NS5GT Firewall according the Juniper KB articles http://kb.juniper.net/InfoCenter/index?page=content&id=KB10939  and http://kb.juniper.net/InfoCenter/index?page=content&id=KB16075.
With the first Windows 7 client, it work's just fine. With the second and the third clients, it won't work.

The error message while conecting is:
"Error 810: A network connection between your computer and the VPN server was started, but the VPN connection was not completed. This is typically caused by the use of an incorrect or expired certificate for authentication between the client and the server. Please contact your Administrator to ensure that the certificate being used for authentication is valid"

Debugging the vpn on the juniper firewall while connecting, I get the following difference betwen phase 1 and phase 2:

With the client that is ok:
## 2011-05-16 11:18:47 : IKE<138.188.100.248> responder (pki) constructing remote NAT-D
## 2011-05-16 11:18:47 : IKE<138.188.100.248> Construct [NATD]
## 2011-05-16 11:18:47 : IKE<138.188.100.248> responder (pki) constructing local NAT-D
## 2011-05-16 11:18:47 : IKE<138.188.100.248> Construct [NATD]
## 2011-05-16 11:18:47 : IKE<138.188.100.248> Xmit : [KE] [NONCE] [CERT-REQ] [NATD] [NATD]
## 2011-05-16 11:18:47 : IKE<138.188.100.248> Responder sending IPv4 IP 138.188.100.248/port 357
## 2011-05-16 11:18:47 : IKE<138.188.100.248> Send Phase 1 packet (len=278)
## 2011-05-16 11:18:47 : IKE<138.188.100.248> IKE msg done: PKI state<0> IKE state<2/1017200f>
## 2011-05-16 11:18:49 : IKE<0.0.0.0        >   from FLOAT port.
## 2011-05-16 11:18:49 : IKE<138.188.100.248> ike packet, len 1716, action 0## 2011-05-16 11:18:49 : IKE<138.188.100.248> Catcher: received 1688 bytes from socket.
## 2011-05-16 11:18:49 : IKE<138.188.100.248> ****** Recv packet if <untrust> of vsys <Root> ******
## 2011-05-16 11:18:49 : IKE<138.188.100.248> Catcher: get 1688 bytes. src port 63177
## 2011-05-16 11:18:49 : IKE<0.0.0.0        >   ISAKMP msg: len 1684, nxp 5[ID], exch 2[MM], flag 01  E
## 2011-05-16 11:18:49 : IKE<138.188.100.248> gen_skeyid()


With a client that isn't building up the VPN:
## 2011-05-16 11:43:57 : IKE<138.188.100.226> responder (pki) constructing remote NAT-D
## 2011-05-16 11:43:57 : IKE<138.188.100.226> Construct [NATD]
## 2011-05-16 11:43:57 : IKE<138.188.100.226> responder (pki) constructing local NAT-D
## 2011-05-16 11:43:57 : IKE<138.188.100.226> Construct [NATD]
## 2011-05-16 11:43:57 : IKE<138.188.100.226> Xmit : [KE] [NONCE] [CERT-REQ] [NATD] [NATD]
## 2011-05-16 11:43:57 : IKE<138.188.100.226> Responder sending IPv4 IP 138.188.100.226/port 381
## 2011-05-16 11:43:57 : IKE<138.188.100.226> Send Phase 1 packet (len=278)
## 2011-05-16 11:43:57 : IKE<138.188.100.226> IKE msg done: PKI state<0> IKE state<2/1017200f>
## 2011-05-16 11:43:57 : IKE<0.0.0.0        >   from FLOAT port.
## 2011-05-16 11:43:57 : IKE<138.188.100.226> ike packet, len 116, action 0## 2011-05-16 11:43:57 : IKE<138.188.100.226> Catcher: received 88 bytes from socket.
## 2011-05-16 11:43:57 : IKE<138.188.100.226> ****** Recv packet if <untrust> of vsys <Root> ******
## 2011-05-16 11:43:57 : IKE<138.188.100.226> Catcher: get 88 bytes. src port 14989
## 2011-05-16 11:43:57 : IKE<0.0.0.0        >   ISAKMP msg: len 84, nxp 8[HASH], exch 5[INFO], flag 01  E
## 2011-05-16 11:43:57 : IKE<138.188.100.226> Error: Responder expecting non-floated IKE packets in phase 2, drop pak.
According to the sent packet size I'm tempted to say that the second client isn't sending all the things he should, or he is floating to a different port when he shouldn't.

On booth machines, MS kb926179 (How to configure an L2TP/IPsec server behind a NAT-T)  is applied, AssumeUDPEncapsulationContextOnSendRule has value 2.

Any Idea ?
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

I asssume you did this on the non-working machinesOn a Windows XP setup, configuring the firewall to use the "COMPATIBLE" phase 2 proposal (on page 32 of the Application Note) will work fine. However on the Windows 7 and Windows Vista client this will end up with an error and the phase 2 never completes.

To fix this, when you get to page 32 of the Application Note, configure a phase 2 custom proposal on the firewall and apply it to the VPN configuration:

Create two new proposals as follows:
set ike p2-proposal "nopfs-esp-3des-sha-windows7" no-pfs esp 3des sha-1 second 3600 kbyte 250000
set ike p2-proposal "nopfs-esp-aes128-sha-windows7" no-pfs esp aes128 sha-1 second 3600 kbyte 250000
Then change the IPsec config as follows to reference these two p2 proposals (p.33 of the Application Note):
set vpn "WindowsVPN-vpn" gateway "WindowsVPN-gateway" no-replay transport idletime 0 proposal "nopfs-esp-3des-sha-windows7"  "nopfs-esp-3des-md5"  "nopfs-esp-aes128-sha-windows7"  "nopfs-esp-des-md5"
Important note: The LIFE SIZE has to be set for a value 250000; if LIFE SIZE is not set to 250000, it will not work.   All built-in P2 proposals set on the Juniper firewall are set to a LIFE SIZE of 0.
SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tmi_cce
tmi_cce

ASKER

Yes I created and applied the 2 new proposals on the Juniper Firewall like described in http://kb.juniper.net/InfoCenter/index?page=content&id=KB16075 and it worked fine for the first windows 7 client.
I also issued the certificates  and put them in the riight certificate stores, for alle the clients. I checked that the private key of the clients certificate was present.
For one windows 7 client it just works fine ( see Firewall debug "With the client that is ok")
For the two others, it messes up between Phase 1 and 2 ( see Firewall debug "With a client that isn't building up the VPN")

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tmi_cce

ASKER

I mad it several times.
I have compared the certifcate from the bad machines with that of the good machine. They are of the same type, with the same template, the private key is in the certificate store (local computer) and so on, everything is ok. The Root Certificate (public key) is also on every machine.
I have compared the data in the certificate of the bad machines with the data in the Firewall and they are right.
While buidling up the VPN with the good machine, I can see the Firewall making the match between the certificate of the client and the data stored in the firewall. This happens in Phase 2.
While building up the VPN with the bad machine, the problem appears before Phase 2, see the comparison between the two logs up here. So I don't believe this  is a certificate issue.
At one point with the bad machine, the firewall is expecting a non-floated IKE packets in phase 2. It looks like the bad machine doesnt sent all he the things he should or he is sending it on the wrong port.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tmi_cce

ASKER

The question was misplaced, it's definitely not a NAT-T problem. it's a certficate problem with windows vista and 7 clients requiring certificates from a windows 2008 (non enterprise) server.
Beside talking of requesting the certifcates again, the expert didn't give any advice on how to do it in this case. That's why a c grade is enough.