PassioniInformaticaNetworking

Guida: Configurare WireGuard VPN su Linux

04/03/2026

VPN moderna e veloce per il tuo homelab

WireGuard è una VPN leggera e performante, ideale per connettere in sicurezza le reti del homelab. In questa guida configuriamo un tunnel punto-punto tra due server Linux.

1. Installazione

apt update && apt install wireguard -y

2. Generare le chiavi

wg genkey | tee /etc/wireguard/private.key | wg pubkey > /etc/wireguard/public.key
chmod 600 /etc/wireguard/private.key

3. Configurazione server (/etc/wireguard/wg0.conf)

[Interface]
Address = 10.66.66.1/24
ListenPort = 51820
PrivateKey = CHIAVE_PRIVATA_SERVER

[Peer]
PublicKey = CHIAVE_PUBBLICA_CLIENT
AllowedIPs = 10.66.66.2/32

4. Configurazione client

[Interface]
Address = 10.66.66.2/24
PrivateKey = CHIAVE_PRIVATA_CLIENT

[Peer]
PublicKey = CHIAVE_PUBBLICA_SERVER
Endpoint = IP_SERVER:51820
AllowedIPs = 10.66.66.0/24
PersistentKeepalive = 25

5. Avvio e abilitazione

wg-quick up wg0
systemctl enable wg-quick@wg0

6. Verifica

wg show
ping 10.66.66.1

WireGuard è estremamente efficiente: latenza minima, throughput elevato e configurazione semplice rispetto a OpenVPN o IPSec.

Guida: UFW — firewall semplice ed efficace →
← Torna all'elenco