====WireGuard====
Easy to setup VPN
===Install===
== Linux==
This install may replace the kernel, if so, reboot afterward.
apt update
apt full-upgrade
apt install wireguard
===Setup===
==Configure VPN==
__Host 1 and Host 2__
ip link add dev wg0 type wireguard
__Host 1__
ip address add dev wg0 192.168.44.10 peer 192.168.44.11
__Host 2__
ip address add dev wg0 192.168.44.11 peer 192.168.44.10
__Host 1 and Host 2__
cd /etc/wireguard
wg genkey | tee private-key | wg pubkey > public-key
touch wg0.conf
chmod 600 *
ls -1
private-key
public-key
wg0.conf
/etc/wireguard/wg.conf
[Interface]
ListenPort = 1234
PrivateKey = PRIVATE-KEY
[Peer]
PublicKey = PUBLIC-KEY
AllowedIPs = 0.0.0.0/0
Endpoint x.x.x.x:1234
==Create VPN==
__Host 1 and Host 2__
wg setconf wg0 /etc/wireguard/wg0.conf
ip link set up dev wg0
__Host 1__
ping -c 1 192.168.44.11
PING 192.168.44.11 (192.168.44.11) 56(84) bytes of data.
64 bytes from 192.168.44.11: icmp_seq=1 ttl=64 time=30.4 ms
--- 192.168.44.11 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 30.409/30.409/30.409/0.000 ms
__Host 2__
ping -c 1 192.168.44.10
PING 192.168.44.10 (192.168.44.10) 56(84) bytes of data.
64 bytes from 192.168.44.10: icmp_seq=1 ttl=64 time=30.4 ms
--- 192.168.44.10 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 30.359/30.359/30.359/0.000 ms
==Destroy VPN==
__Host 1 and Host 2__
ip link delete dev wg0
===Resources===
[[https://www.wireguard.com/quickstart/|Setup guide]].
[[https://www.wireguard.com/install/|Install guide]]