This shell scripts improve work experience with Wireguard VPN by easily user management
Warning: this scripts actively using and rewriting wg0.conf
-
Clone this repo
-
Make sure that's your network adapter named
ens3
, if not: change PostUp/PostDown inrestart.sh
-
In headers of
restart.sh
andcreate_user.sh
replace<PRIVATE_KEY_FILENAME>
and<YOU_IP_OR_DOMAIN>
with you own server settings:# restart.sh SERVER_PORT=51820 SERVER_PVKEY=$(cat <PRIVATE_KEY_FILENAME>)
# create_user.sh SERVER_PORT=51820 SERVER_PVKEY=$(cat <PRIVATE_KEY_FILENAME>) ENDPOINT=<YOU_IP_OR_DOMAIN>:$SERVER_PORT
# Create user config in clients/
sh create_user.sh
# Delete user config and restart
# (if you delete config manually, it need to restart)
sh delete_user.sh
# Restart WG interface
sh restart.sh
# Show traffic statistics
sh statistics.sh