Skip to content

A Wireguard library for Python based on PyRoute2 but with userspace interface support

License

Notifications You must be signed in to change notification settings

stevekerrison/pyreguard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyreGuard - A wireguard library that uses PyRoute2 or userspace

Userspace tools such as wireguard-go and boringtun use the Wireguard cross-platform userspace implemenation as a control mechanism.

Software that uses pyroute2's WireGuard class cannot use these, because it only supports netlink (kernelspace) interfaces provided by the wireguard kernel module. This makes sense, as pyroute2 interacts with iproute2 and netlink a lot.

However, there's still a valid mixed use-case, where applications still need to use pyroute2 to control routing and other network activities, but against the tun interface of the userland wireguard.

This library, a work in progress, seeks to provide that capability, by replicating the WireGuard interface from pyroute2 and translating it to/from the userspace messaging protocol. It also allows dual-space usage, where both userspace and kernelspace interfaces might exist.

Installation

To install, use pip:

pip install .

Usage

Use it just like pyroute2's wireguard, except instead of:

from pyroute2 import WireGuard

do

from pyreguard import WireGuard

License

As this work is inteded to work with pyroute2, this software has been licensed using the same dual-license approach, of GPLv2 and Apache v2.

Authors

Copyright © 2021 - Steve Kerrison, github:@stevekerrison

About

A Wireguard library for Python based on PyRoute2 but with userspace interface support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages