Skip to content

Instantly share code, notes, and snippets.

@diegograssato
Last active December 19, 2022 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diegograssato/16615f44e98a056d7aaee41fd656417d to your computer and use it in GitHub Desktop.
Save diegograssato/16615f44e98a056d7aaee41fd656417d to your computer and use it in GitHub Desktop.
VPN

How use

Update your system:

sudo apt update && sudo apt upgrade

Install WireGuard:

apt install wireguard net-tools curl wget git

Install the config file to the WireGuard configuration directory on your

Linux client:

install -o root -g root -m 600 <username>.conf /etc/wireguard/wg0.conf

Start the WireGuard VPN:

systemctl start wg-quick@wg0

Check that it started properly:

systemctl status wg-quick@wg0

Verify the connection to the AlgoVPN:

wg

See that your client is using the IP address of your AlgoVPN:

curl ipv4.icanhazip.com

Optionally configure the connection to come up at boot time:

systemctl enable wg-quick@wg0
https://www.duckdns.org/domains

How use

Installation

apt install wireguard net-tools curl wget git
git clone https://github.com/pprometey/wireguard_aws.git wireguard_aws
cd wireguard_aws
./initial.sh

The initial.sh script removes the previous Wireguard installation (if any) using the remove.sh script. It then installs and configures the Wireguard service using the install.sh script. And then creates a client using the add-client.sh script.

Add new customer

add-client.sh - Script to add a new VPN client. As a result of the execution, it creates a configuration file ($CLIENT_NAME.conf) on the path ./clients/$CLIENT_NAME/, displays a QR code with the configuration.

./add-client.sh
#OR
./add-client.sh oracle
./add-client.sh pi

Reset customers

reset.sh - script that removes information about clients. And stopping the VPN server Winguard

sudo ./reset.sh

Delete Wireguard

sudo ./remove.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment