VPN 2025-06-24
WireGuard VPN Server Setup
Install WireGuard
sudo apt install wireguard
wg genkey | tee privatekey | wg pubkey > publickeyServer Config
# /etc/wireguard/wg0.conf
[Interface]
PrivateKey = SERVER_PRIVATE_KEY
Address = 10.0.0.1/24
ListenPort = 51820
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT
[Peer]
PublicKey = CLIENT_PUBLIC_KEY
AllowedIPs = 10.0.0.2/32sudo wg-quick up wg0
sudo systemctl enable wg-quick@wg0
#Sudofree#WireGuard