Skip to main content

Netlink connector to WireGuard

Project description


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,
assert peer in wg.get_interface(interface).peers

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

Requires pyroute2.

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

License: MIT

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 wgnlpy, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size wgnlpy-0.0.1-py3-none-any.whl (8.7 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size wgnlpy-0.0.1.tar.gz (5.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page