NAT wireguard connection

snippetops

%3 cluster_eaf4b1ea_c0ba_4c17_b038_852ff4ad7d91 NAT wireguard connection _2813a24c_e58b_4f57_ae87_48bdfac11704 WireGuard __0:cluster_eaf4b1ea_c0ba_4c17_b038_852ff4ad7d91->_2813a24c_e58b_4f57_ae87_48bdfac11704

How 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