mirror of https://github.com/dadevel/wg-netns
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ab3688e5ad | 4 years ago | |
---|---|---|
.gitignore | 4 years ago | |
LICENSE | 4 years ago | |
README.md | 4 years ago | |
wg-netns.py | 4 years ago |
README.md
wg-netns
wg-quick for linux network namespaces. A simple python script that implements the steps described at wireguard.com/netns.
Setup
Requirements:
- Linux
- Python 3.8 or newer
ip
fromiproute2
wg
fromwireguard-tools
Just download the script and make it executable.
mkdir -p ~/.local/bin/ && curl -o ~/.local/bin/wg-netns https://raw.githubusercontent.com/dadevel/wg-netns/master/wg-netns.py && chmod 0755 ~/.local/bin/wg-netns
Usage
usage: wg-netns [-h] [--wg-dir DIRECTORY] [--netns-dir DIRECTORY] {up,down,status} ...
positional arguments:
{up,down,status}
up set up interface
down tear down interface
status show status info
optional arguments:
-h, --help show this help message and exit
--wg-dir DIRECTORY override WGNETNS_WG_DIR
--netns-dir DIRECTORY override WGNETNS_NETNS_DIR
environment variables:
WGNETNS_WG_DIR wireguard config directory, default: /etc/wireguard
WGNETNS_NETNS_DIR network namespace config directory, default: /etc/netns
WGNETNS_DEBUG print stack traces