Terra guard : Create And Destroy Your Own VPN Service Using Wire Guard

Terra guard’s goal is to be simple to create and destroy your own VPN service using Wire Guard.

Prerequisites

  • Terraform >= 1.0.0
  • Ansible >= 2.10.5

How To Deploy

Terraform

Run with sudo is necessary because we need permission on localhost to install packages, configure a network interface and start a process.

Select your cloud provider AWSDigitalOcean and open the directory

You can change the region or key name in the variable.tf

  • Initialize Terraform

terraform init

  • Plan our modifications

sudo terraform plan

  • Apply the changes

sudo terraform apply

  • For Digital Ocean you need to declare your token(do_token) in variable.tf or command line:

sudo terraform plan -var “do_token=value”
sudo terraform apply -var “do_token=value”

Tests – Checking the IP

  • Test the connection without VPN

curl ipinfo.io/ip

  • Start VPN

sudo systemctl start wg-quick@wg0

  • Test the connection with VPN

curl ipinfo.io/ip

R K

Recent Posts

file Command in Linux: Identify File Types Without Extensions

The file command inspects the actual contents of a file and reports its type — regardless of…

13 hours ago

chattr Command in Linux: Set File Attributes with lsattr

chattr sets and removes special file attributes that operate at the filesystem level, separate from standard…

13 hours ago

env Command in Linux: Show and Set Environment Variables

env prints the current environment, sets or removes variables for a single command, and can start…

13 hours ago

nmap Command in Linux: Port Scanning and Host Discovery Guide

nmap (Network Mapper) discovers live hosts, identifies open ports, and detects which service is running…

13 hours ago

id Command in Linux: Display User and Group Information

The id command prints user and group identity for any account on the system. It shows the…

2 days ago

sed Delete Lines: Remove Lines by Number, Pattern, or Range

sed processes input line by line, applies your commands, and writes the result to standard output.…

2 days ago