0

I have a soft-ether VPN server and I want to make a custom client application, which will look like other vpn clients (Nord,Hola vpns) in python. The problem is in python I cannot find a way to use windows built-in vpn manager to connect via IPsec protocol programmatically.

In C I can find a RAS API but since I am new to network infrastructure programming so its hard for me to dissolve it properly uderstand how it actually works.

Salman Arshad
  • 343
  • 6
  • 23

1 Answers1

1

You can use Add-VpnConnection and Set-VpnConnectionIPsecConfigurationin Windows PowerShell

See the Example 2 in 2nd link:

PS C:\> Add-VpnConnection -Name "Contoso" -ServerAddress 176.16.1.2 -TunnelType "L2tp"
PS C:\> Set-VpnConnectionIPsecConfiguration -ConnectionName "Contoso" -AuthenticationTransformConstants None -CipherTransformConstants AES128 -EncryptionMethod AES128 -IntegrityCheckMethod SHA256 -PfsGroup None -DHGroup ECP256 -PassThru -Force
AuthenticationTransformConstants : None

CipherTransformConstants         : AES128

DHGroup                          : ECP256

IntegrityCheckMethod             : SHA256

PfsGroup                         : None

EncryptionMethod                 : AES128

And it should also be simple to call the PowerShell from Python.

Drake Wu
  • 6,927
  • 1
  • 7
  • 30