Buradaki senaryoda VPS uzerinde kurlu bir wireguard serverim var ve raspberryi client olarak ayarlayip WIFI ap uzerinden kullanicilarimizin internete cikmasini saglamak.
Ilk olarak diepi kurulumunu yapin.
dietpi icinde wireguardi client olrak kurun
kurulumdan sonra clienti secin
daha sonra
#nano /etc/wireguard/wg0.conf
komutu ile wireguard client bilgilerinizi girin dosya su sekilde olmali
[Interface]
Address = buraya local vpn address/32
# The use of DNS below effectively expands to:
# PostUp = echo nameserver buraya local dns server | resolvconf -a tun.%i -m 0 -x
# PostDown = resolvconf -d tun.%i
# If the use of resolvconf is not desirable, simply remove the DNS line
# and use a variant of the PostUp/PostDown lines above.
# The IP address of the DNS server that is available via the encrypted
# WireGuard interface is x.x.x.x
DNS = 1buraya local dns server
PrivateKey = server client key
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i $
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %$

[Peer]
PublicKey = client public key
PresharedKey = varsa presahred key
AllowedIPs = 0.0.0.0/0,::/0
Endpoint = endpoint server adre:port
bundan sonra restart edip
ls -Al /etc/wireguard/ calisip calismadigini kontrol edin

wg komutu ile wireguard clientin baglandigini kontrol edin
bundan sonra diet pi menusunden dietpi wifi HotSpot kurulumunu yapin
kurulum bittikten sonra
dietpi-config
burada networking Options—Adapters–Wifi ile ayarlarinizi yapin kanali 12-13 e almaniz yarariniza olur
dha sonra iptablesdan wireguard trafigini yonledirmeniz gerekir

sudo iptables -F
sudo iptables -t nat -F
sudo iptables -X
Daha sonra eskileri temizleyin
sudo iptables -t nat -A POSTROUTING -o wg0 -j MASQUERADE
sudo iptables -A FORWARD -i wg0 -o wlan0 -m state –state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o wg0 -j ACCEPT
ve bunu kaydedin
sudo sh -c “iptables-save > /etc/iptables.ipv4.nat”
hersey yolunda ise wifiden baglanna clientlariniz vpn uzerinden internete cikis yapacaktir.

Bir yanıt yazın

Bu site, istenmeyenleri azaltmak için Akismet kullanıyor. Yorum verilerinizin nasıl işlendiği hakkında daha fazla bilgi edinin.