Skip to main content

wgnlpy

Python netlink connector to WireGuard

A simple control interface for WireGuard via Netlink, written in Python.

from wgnlpy import WireGuard

interface = "wg0"
peer = b'...'

wg = WireGuard()

wg.set_peer(interface, peer,
	endpoint="203.0.113.0:51820",
	allowedips=["2001:db8::/32"],
	)
assert peer in wg.get_interface(interface).peers

wg.remove_peers(interface, peer)
assert peer not in wg.get_interface(interface).peers

Requires

Also useful: the sockaddr_in and sockaddr_in6 utility classes for sockaddr manipulation.

License: MIT

Download files

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

Source Distribution

wgnlpy-0.1.5.tar.gz (8.7 kB view details)

Uploaded Source

File details

Details for the file wgnlpy-0.1.5.tar.gz.

File metadata

  • Download URL: wgnlpy-0.1.5.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

File hashes

Hashes for wgnlpy-0.1.5.tar.gz
Algorithm Hash digest
SHA256 bdf6068d5ac6fd890684d3ba8eaf3d28d4dffe10afebef85966fcb1f8eae2e8c
MD5 debfb483288371d9029eb941c03f70bf
BLAKE2b-256 64be2cbdf0cc726d5452863b0ec386fa589d57a0210a9a146c23a31a78ad28de

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.5 This release

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page