gene-git / wg_tool Goto Github PK
View Code? Open in Web Editor NEWTool to administer wireguard VPN (server and user configs)
License: MIT License
Tool to administer wireguard VPN (server and user configs)
License: MIT License
New feature as requested in issue #8
Hi Gene,
In your doc you mentioned an issue with MTU size happened in a hotel. I have encountered this as well. Here is what I am reading and going to do my test:
https://gist.github.com/nitred/f16850ca48c48c79bf422e90ee5b9d95
FYI. Cheers!
Jack
Hi @gene-git,
Not sure if you have considered to add "--version" cmd option to print out:
Ex:
# wg-tool --version
wg-tool version 6.2 (build aabb333, 2024-01-18)
Online documentation: https://github.com/gene-git/wg_tool/
Thanks,
Jack
Currently the default working directory of wg-tool
is ./
, witch makes user to take care of either where the command is called or add the extra -wkd
argument.
How about fixing the location of the config files? This would allow:
wg-tool
from anywhere without fear of mistake/etc/wireguard/wg0.conf
to .../wg-configs/server/wg0.conf
I'm not sure where the location could be. /etc/wireguard/wg-tool/
?
Hi, I'm very new to Wireguard,
Under Archlinux, I've installed wireguard-tools
and wg_tool
packages. Configured nothing and launched wg-tool --init
. I then get the following python error. What do I miss?
> wg-tool --init
Init Mode
Making sample server config - please edit for your setup
Traceback (most recent call last):
File "/usr/bin/wg-tool", line 26, in <module>
main()
File "/usr/bin/wg-tool", line 22, in main
wgtool.doit()
File "/usr/lib/python3.10/site-packages/wg_tool/lib/class_wg.py", line 308, in doit
write_server_config(self)
File "/usr/lib/python3.10/site-packages/wg_tool/lib/write_config.py", line 38, in write_server_config
if wgtool.server.get_changed() :
AttributeError: 'dict' object has no attribute 'get_changed'
I dont understand why there are 2 values for hostnames. Both are "key fields to edit". Do I have to fill both? How can I determine which one of these hostname fields is used as Endpoint for the userconfigs?
In my case the Hostname_Int ends up in my userconfig Endpoint - making it impossible for me to connect to the wireguard-server.
Hello,
The ip address used by my wiregard server will have to be changed.
Modified hostname variable in /etc/wireguard/wg-tool/server/server.conf
, works for all new profiles added, but does not modify existing profiles.
How can I update existing profiles with the new hostname value ?
Hi Gene,
Thank you again for making the useful wg-tool
and sharing it with us! It really saves me a lot of time and brain cells to manage wg
keys. I would like to share the steps I got it to work on Ubuntu 22.04. Feel free to include in your documentation to help others.
$ sudo apt install wireguard qrencode
wg_tool
:$ sudo apt install python3 python-is-python3 python3-poetry python3-build \
python3-installer python3-qrcode python3-tomli-w python3-tomli python3-netaddr
$ git clone https://github.com/gene-git/wg_tool
$ cd wg_tool
$ sudo pip install hatchling
$ /usr/bin/python -m build --wheel --no-isolation
$ sudo ./scripts/do-install /
wg-tool
to work$ sudo -i
# cd /etc/wireguard
# wg-tool --init
# vi config/server/server.conf
wg-tool
# wg-tool --add_user --dns_search Mary:mac,iphone,ipad
# ln -s wg-configs/server/wg0.conf .
# systemctl enable wg-quick@wg0
# systemctl start wg-quick@wg0
# systemctl status wg-quick@wg0
# wg show
# cd /etc/wireguard
# wg-tool --add_user --dns_search Joe:mac,iphone,ipad
# systemctl reload wg-quick@wg0
# wg show
# wg-tool --list_users
# wg-tool -rrpt
Is there a way to have the clients automatically configure with IPv6? The tool seems to only generate IPv4 addresses for the clients.
Awesome work on the tool, it's so good it feels like a suite of tools that should be natively built into the protocol.
Before I start messing with my system installing all dependencies and such, is the script compatible with both Ubuntu/Debian ?
I have been looking for a decent management script and google lead me here <3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.