How to replicate a NAT to use a WireGuard server as a VPN outgoing gateway.
NAT wireguard connection
snippetopsHow to replicate a NAT to use a WireGuard server as a VPN outgoing gateway.
# From your WireGuard network, on wg0
# To your external network on eth0
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# If your IPTables does not support the following command just ignore it
/sbin/iptables -A FORWARD -i eth0 -o wg0 -m state --state RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A FORWARD -i wg0 -o eth0 -j ACCEPT