Skip to main content

Use vpnc from Python

Project description

https://badge.fury.io/py/vpnc.svg

Use vpnc from Python.

Installation

First you need to install vpnc. On Debian/Ubuntu:

apt-get install vpnc

On OSX:

brew install vpnc

Then install pyvpnc using pip:

pip install vpnc

Usage

from vpnc import VPNC

vpnc = VPNC(config={
    "IPSec_ID": "my IPSec ID",
    "IPSec_gateway": "my.gateway.com",
    "IPSec_secret": "my IPSec secret",
    "Xauth_username": "my Xauth username",
    "Xauth_password": "my Xauth password",
    "IKE_Authmode": "psk",
    "IKE_DH_Group": "dh2",
    "DNSUpdate": "no",
    "NAT_Traversal_Mode": "force-natt",
    "Local_Port": 0,
    "Cisco_UDP_Encapsulation_Port": 0
})

with vpnc.vpn():
    # do stuff on the VPN!

Tests

Unit tests are in the test/ directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for vpnc, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size vpnc-0.1.0.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page