Wireguard ubuntu

From Teknologisk videncenter
Revision as of 09:33, 1 August 2024 by Heth (talk | contribs) (Created page with "Wireguard VPN between two Ubuntu hosts - one behind NAT =Host A: Public access= <source lang=bash> sudo bash apt install wireguard cd /etc/wireguard umask 077 wg genkey > priv...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Wireguard VPN between two Ubuntu hosts - one behind NAT

Host A: Public access

sudo bash
apt install wireguard
cd /etc/wireguard
umask 077
wg genkey > privatekey
wg pubkey < privatekey > publickey
ip link add dev wg0 type wireguard
ip address add dev wg0 172.31.0.1/24
wg set wg0 listen-port 8172  private-key privatekey peer 9WDOCVCJ6dbcSofc2Ho1qbBBeiD6dBWWoyIyk+nxFxo=  allowed-ips 0.0.0.0/0 endpoint 192.168.1.98:51820
wg-quick save wg0