Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create/Connect VPN connection through C#.Net

I have a URL, a username, and a password. I want to establish a VPN connection in C# .Net WinForms.

Can you please tell me from where I can get started? Any third party API's ?

Code samples will be highly appreciated...

like image 902
xtremist Avatar asked Oct 27 '11 08:10

xtremist


People also ask

Can I create my own VPN network?

To create your own VPN for personal use, you have a few specific hosting options: Run the software on a cloud virtual private server. All cloud providers, from titans like Amazon Web Services to smaller operations like Vultr, offer cloud-hosted servers called VPSs.

Which VPN protocols are natively supported on iOS?

iOS devices natively support the L2TP, IPSec, and IKEv2 protocols. To configure a VPN on your iPhone or iPad, go to: Settings > General > VPN > Add VPN Configuration > Type. Here you can select IKEv2, IPSec (by itself), or L2TP (which includes IPSec encryption, even though it doesn't say so).

Where should I put VPN on network?

Placing a VPN server in front of the firewall can lead to greater security in some cases. Remember that a VPN allows users who are external to the network to feel like they are sitting on a machine inside the network.


2 Answers

You can launch external application like in this sample. This probably is easiest way to do it, but it depends on external applications.

Or you can try to use Windows API with some wrapper like DotRas. This could be a bit harder, but you won't have any dependancies on particular external apps.

like image 76
PiRX Avatar answered Sep 19 '22 11:09

PiRX


You can use the rasdial executable to accomplish this:

System.Diagnostics.Process.Start("rasdial.exe", "VPNConnectionName VPNUsername VPNPassword");

Rasdial is Windows 7.. from memory its RasPhone for XP.

like image 42
chemicalNova Avatar answered Sep 18 '22 11:09

chemicalNova