https://www.wireguardconfig.com
/etc/wireguard/wg0.conf
Код: Выделить всё
[Interface]
Address = 10.168.4.1/24
ListenPort = 51820
PrivateKey =
PostUp = iptables -t nat -A POSTROUTING -s 10.168.4.0/24 ! -d 10.168.4.0/24 -o tun0 -j MASQUERADE # SNAT --to-source 192.168.43.4
PostDown = iptables -t nat -D POSTROUTING -s 10.168.4.0/24 ! -d 10.168.4.0/24 -o tun0 -j MASQUERADE #SNAT --to-source 192.168.43.4
[Peer]
PublicKey =
AllowedIPs = 10.168.4.2/32
wg-quick up wg0
Останов:
wg-quick down wg0