AJ-Labz
  • whoami
  • The Lab
    • Building the Lab
      • Physical Hardware
      • ESXi
        • Install ESXi without a keyboard
      • vCenter Server Installation
      • Configure vCenter Datacenter
      • Virtual Networking
      • Install Virtual Machine
      • Install Virtual Firewall
      • Increasing VM Harddrive size
    • Building the Windows Domain
    • Building a Local DNS Server
    • Installing Apache Guacamole
    • Installing WireGuard VPN
    • Industrial Control Systems (ICS)
  • Defensive Cyberz
  • Analytic Repo
    • Beacon Detection
  • Creating an SIEM
    • Installing Security Onion (SO)
    • Splunk
    • Getting the Windows Data You Need
  • Zeek || Bro
    • Bro/Zeek Script
    • Installing Protocol Analyzers
  • Offensive Cyberz
    • Cobalt Strike Red Team Cheat Sheet
    • Defense Evasion
      • Evading Defender with CobaltStrike
      • Disable AV
      • AMSI Bypass
      • Evade Heuristic Behaviors
        • Process Injection
        • Process Hollowing
        • Reflection
        • AppLocker Bypass
        • Powershell CLM Bypass
      • Linux Shellcode Encoders
    • AD Enumeration
      • AD Tools
      • PowerView
      • BloodHound
      • DAFT Commands
      • Enumeration Commands
    • AD Attack
      • Prompt for Credentials
      • LAPS Reader
      • Abusing ACLs
    • Command and Control
      • Covenant Framework
      • Simple HTTPS Server
    • Linux
      • Shells
      • Impacket
      • SSH
      • Kerberos Cache File
      • Ansible
      • Privilege Escalation
    • Phishing
      • LNK Script
    • Wireless Attacks
    • Create a Trojan
  • Cyber Readingz
    • Recommended Readings
Powered by GitBook
On this page
  • Install Dependancies
  • Configure WireGuard Server
  • Set Up Firewall Rules
  • Start WireGuard Service
  • Configure WireGuard Client

Was this helpful?

  1. The Lab

Installing WireGuard VPN

WireGuard® is an extremely simple yet fast and modern VPN that utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPsec, while avoiding the massive hea

PreviousInstalling Apache GuacamoleNextIndustrial Control Systems (ICS)

Last updated 5 years ago

Was this helpful?

Want to watch YouTube TV but your local channels aren't available? Try WireGuard VPN to bypass their location services. They noticed my VPN when using OpenVPN :-(

Or use WireGuard as an alternative way to connect to your home lab with a VPN

Install Dependancies

If Ubuntu >19.10

sudo apt install wireguard

If Ubuntu < 19.10

sudo add-apt-repository ppa:wireguard/wireguard sudo apt-get update sudo apt-get install wireguard

Configure WireGuard Server

Generate a public and private key mkdir -p /etc/wireguard/keys cd /etc/wireguard/keys umask 044 wg genkey | tee privatekey | wg pubkey > publickey Create the WireGuard config file and add the contents below /etc/wireguard/wg0.conf

[Interface]
PrivateKey = <Private Key>
Address = 10.100.100.1/24, 
ListenPort = 51820
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o ens160 -j MASQUERADE; 
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o ens160 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; 
SaveConfig = true

The Address field is the range of IPs you will be assigning to the clients. When the client connects, the iptables rule handles the NAT in order to provide the client the IP address of the server. Saveconfig allows the new peer to be added to the config file when the service is running.

Set Up Firewall Rules

Make sure to port forward 51820 UDP on pfSense under Firewall -> NAT

Allow the server/clients access to the internet Firewall -> Rules

Start WireGuard Service

Start WireGuard wg-quick up wg0 Enable start up on boot systemctl enable wg-quick@wg0 Verify if VPN connection is listening (should see listening connection) wg show

Configure WireGuard Client

You should be able to connect to your home network now. To verify if the connection was successful run wg show on the wireguard server and you should see the peer information.

Install Ubuntu Server Install on Ubuntu Server Install on Client

WireGuard should have been installed on the client by now, if not go to On Windows: Open the application, Click the dropdown next to add tunnel and select empty tunnel. Add the following contents

WireGuard
WireGuard
https://www.wireguard.com/install/