Setting up wireguard as a VPN

1 min read

Server setup

apt update
apt install wireguard-tools

# On the peer that will act as the "server", enable IPv4 forwarding:
sysctl -w net.ipv4.ip_forward=1

# write the server config to /etc/wireguard/wg0.conf
vim /etc/wireguard/wg0.conf
wg-quick up wg0

# To bring down the network
# wg-quick down wg0

Client set up

MacOS - install the Wireguard app, add the client config.

Making sure things are working

Server

nc -l 8000

Client

nc 10.0.0.1 8000

Source

The excellent guide on ArchWiki. Specifically the section about VPN.