Cum configurezi un VPN WireGuard pe Ubuntu
Pasul 1: Instaleaza WireGuard
sudo apt update
sudo apt install wireguard -yPasul 2: Genereaza cheile serverului
cd /etc/wireguard
umask 077
wg genkey | tee server-private.key | wg pubkey > server-public.keyPasul 3: Creaza configuratia serverului
sudo nano /etc/wireguard/wg0.conf[Interface]
PrivateKey = <cheia-privata-server>
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 = <cheia-publica-client>
AllowedIPs = 10.0.0.2/32Pasul 4: Activeaza IP forwarding
Pasul 5: Configureaza firewall-ul
Pasul 6: Porneste WireGuard
Pasul 7: Configureaza un client (Linux desktop sau laptop)
Pasul 8: Adauga cheia publica a clientului pe server
Pasul 9: Conecteaza clientul
Gestionarea WireGuard
Probleme comune
Concluzie
Last updated