Skip to content

lewis262626/wireguard-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

wireguard-config

Simple WireGuard config used on an Ubuntu 22.04 VPS

Install

  1. Install necessary tools
sudo apt-get update
sudo apt-get install wireguard-tools
  1. Generate key pairs
wg genkey | sudo tee /etc/wireguard/private.key
sudo chmod go= /etc/wireguard/private.key
sudo cat /etc/wireguard/private.key | wg pubkey | sudo tee /etc/wireguard/public.key
  1. Enable ipv4 and ipv6 port forwarding
;/etc/sysctl.conf
net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1
  1. Apply changes
sudo sysctl -p
  1. Allow WireGuard on INPUT chain
sudo ufw allow 51820/udp
sudo ufw allow OpenSSH
  1. Copy across wg0.conf to /etc/wireguard/wg0.conf

  2. Start server

sudo wg-quick up wg0
  1. Add a peer to the server
sudo wg set wg0 peer peer_pub_key allowed-ips 10.8.0.2,fd0d:86fa:c3bc::2

Peer Config

[Interface]
PrivateKey = <>
Address = 10.8.0.2/24, fd24:609a:6c18::2/64
DNS = 2606:4700:4700::1111

[Peer]
PublicKey = <>
AllowedIPs = 0.0.0.0/0, ::/0

About

My WireGuard config

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published