Siber Güvenlik
1 dakika okuma
WireGuard VPN Sunucu Kurulumu
WireGuard VPN sunucu kurulumu, peer yapilandirmasi ve mobil istemci baglantisi.
E
Emre Cihan WireGuard Neden
OpenVPN ve IPSec'e gore cok daha basit, hizli ve modern. Kernel seviyesinde calisir, 4000 satir kod (OpenVPN 600K+).
Sunucu Kurulumu
sudo apt install wireguard -y
# Anahtar uret
wg genkey | tee /etc/wireguard/sunucu_ozel.key |
wg pubkey > /etc/wireguard/sunucu_acik.key
chmod 600 /etc/wireguard/sunucu_ozel.key
/etc/wireguard/wg0.conf
[Interface]
Address = 10.10.10.1/24
PrivateKey = <sunucu_ozel_anahtar>
ListenPort = 51820
# Yonlendirme
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
# Istemci 1: Telefon
[Peer]
PublicKey = <telefon_acik_anahtar>
AllowedIPs = 10.10.10.2/32
# Istemci 2: Laptop
[Peer]
PublicKey = <laptop_acik_anahtar>
AllowedIPs = 10.10.10.3/32
# IP forwarding aktif
echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf
sysctl -p
# Baslar ve otomatik basla
systemctl enable --now wg-quick@wg0
# Durum
wg show
Istemci Yapilandirma
[Interface]
Address = 10.10.10.2/32
PrivateKey = <istemci_ozel_anahtar>
DNS = 1.1.1.1
[Peer]
PublicKey = <sunucu_acik_anahtar>
Endpoint = sunucu_ip:51820
AllowedIPs = 0.0.0.0/0 # Tum trafigi VPN uzerinden gonder
PersistentKeepalive = 25
QR Kod ile Mobil Baglanti
cat istemci.conf | qrencode -t ansiutf8
# WireGuard mobil uygulamasi ile QR kodu okutun
WireGuard, basitligi ve performansiyla modern VPN ihtiyaclari icin ideal bir cozumdur.
Paylaş:
Twitter / X
E
Emre Cihan
Sistem Yöneticisi · Maker · Elektronik Meraklısı
İlgili yazılar