PPTP Connection created as L2TP Connection

Jun 9, 2009 at 8:24 PM
Edited Jun 9, 2009 at 8:25 PM

Hey,

I am attemping to create a new phone book entry to connect to a VPN and I am following the code used in the YouTube video, namely:

RasEntry entry = RasEntry.CreateVpnEntry(newConnection.ConnectionName, newConnection.InternetAddress, RasVpnStrategy.Default, RasDevice.GetDeviceByName("(PPTP)", RasDeviceType.Vpn, false));

Where newConnection is a form displayed to the user where they can enter the necessary information. 

The VPN connection creates successuflly but under the device name it says (L2TP).  But, if I dial the connection (manually using Windows or through the RasDialer) the connection is made successfully and the device nation changes to (PPTP).

Is Windows detecting it needs to be PPTP and changing it automatically?  How can I make it so it selects the PPTP device on creation?

Thanks.  Great piece of work by the way.  It is very very helpful.

Nick

 

Coordinator
Jun 9, 2009 at 10:25 PM

You just need to change the VPN strategy to PptpOnly if you only want it to use a PPTP connection. By default Windows uses L2TP connections, which is why you see that showing up under the network connection.

Jun 9, 2009 at 11:52 PM

That makse sense.  But why does it then change to PPTP after I connect once?

Coordinator
Jun 10, 2009 at 2:33 AM

I can only guess the VPN strategy determines what is shown underneath the connection in the Network Connections window. I can't say anything with absolute certainty, you'd need to ask Microsoft about that. PptpOnly or PptpFirst should take care of what you're seeing when you look at the connection.