Come Configurare una VPN WireGuard su un VPS Svedese
Gestisci il Tuo Server VPN con WireGuard
Invece di pagare per un servizio VPN commerciale, gestisci il tuo server WireGuard su un VPS. Ottieni il controllo totale, nessun log di terze parti e un indirizzo IP svedese dedicato.
Cosa Ti Serve
- Un VPS con Linux — KVM VPS 1G (€6/mese) è più che sufficiente
- Accesso root (SSH)
- 10 minuti del tuo tempo
Passo 1: Connettiti al Tuo VPS
ssh root@tuo-ip-server
Passo 2: Installa WireGuard
Debian/Ubuntu
apt update && apt install -y wireguard
Rocky Linux/AlmaLinux
dnf install -y epel-release && dnf install -y wireguard-tools
Passo 3: Genera le Chiavi
wg genkey | tee /etc/wireguard/server_private.key | wg pubkey > /etc/wireguard/server_public.key
chmod 600 /etc/wireguard/server_private.key
wg genkey | tee /etc/wireguard/client_private.key | wg pubkey > /etc/wireguard/client_public.key
Passo 4: Configurazione del Server
cat > /etc/wireguard/wg0.conf << EOF
[Interface]
PrivateKey = $(cat /etc/wireguard/server_private.key)
Address = 10.0.0.1/24
ListenPort = 51820
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
[Peer]
PublicKey = $(cat /etc/wireguard/client_public.key)
AllowedIPs = 10.0.0.2/32
EOF
Passo 5: Abilita l’IP Forwarding
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sysctl -p
Passo 6: Avvia WireGuard
systemctl enable --now wg-quick@wg0
Passo 7: Configurazione del Client
Crea client.conf:
[Interface]
PrivateKey = CHIAVE_PRIVATA_CLIENT
Address = 10.0.0.2/24
DNS = 1.1.1.1
[Peer]
PublicKey = CHIAVE_PUBBLICA_SERVER
Endpoint = IP_DEL_TUO_SERVER:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25
Sostituisci i valori segnaposto con le tue chiavi effettive e l’IP del server.
Passo 8: Connettiti
Importa il file di configurazione nell’app WireGuard sul tuo dispositivo:
- Windows/macOS/Linux: wireguard.com/install
- iOS: App Store → WireGuard
- Android: Play Store → WireGuard
Verifica
curl ifconfig.me
Il tuo IP dovrebbe ora mostrare l’indirizzo IP svedese del tuo server VPS.
Perché la Tua VPN È Migliore
| VPN self-hosted | VPN commerciale | |
|---|---|---|
| Costo | €6/mese | €5-10/mese |
| Indirizzo IP | Dedicato (solo tuo) | Condiviso con migliaia |
| Logging | Lo controlli tu | Fiducia nel provider |
| Dispositivi | Illimitati | Solitamente 5-6 |
| Bloccato dai servizi | Raramente | Spesso |
| Velocità | Piena banda del VPS | Variabile |
Piani VPS Consigliati
| Piano | RAM | Disco | Prezzo | Capacità |
|---|---|---|---|---|
| KVM VPS 1G | 1 GB | 15 GB SSD | €6/mese | 5-10 dispositivi |
| KVM VPS 2G | 2 GB | 20 GB SSD | €10/mese | 20+ dispositivi |