Skip to main content

Wireguard Utilities

Project description

This is a helper module for creating configs for WireGuard VPN for both the server side and the client side.

Quick Start

Setup a WireGuard server:

from wireguard import Server

server = Server('myvpnserver.com', '192.168.24.0/24', address='192.168.24.1')

# Write out the server config to the default location: /etc/wireguard/wg0.conf
server.config().write()

Create a client within the previously created server:

peer = server.peer('my-client')

# Output this peer's config for copying to the peer device
print(peer.config().local_config)

# Rewrite the server config file including the newly created peer
server.config().write()

Create a standalone client:

from wireguard import Peer

peer = Peer('my-client', '192.168.24.0/24', address='192.168.24.45')

# Write out the peer config to the default location: /etc/wireguard/wg0.conf
peer.config().write()

Note: Both the server and peer config files are named the same by default. This is because they would typically be on different machines and would not interfere with one another. Be aware of this when generating peer configs on a server node, or on any node that has a pre-existing wireguard config at the default file location.

Project details


Download files

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

Source Distribution

wireguard-0.2.5.tar.gz (15.1 kB view details)

Uploaded Source

File details

Details for the file wireguard-0.2.5.tar.gz.

File metadata

  • Download URL: wireguard-0.2.5.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.7

File hashes

Hashes for wireguard-0.2.5.tar.gz
Algorithm Hash digest
SHA256 284ea62f9ef2fe35710083ea8780f7e0f67832ed02ade5ded4343547c9570605
MD5 6f7ccbe7ebee9c490cb36f51e710c9bf
BLAKE2b-256 76710364cfcde3f718bbc6df3a157240275e792108c92c077ba5880a42e1fa09

See more details on using hashes here.

Supported by

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