

# don't delete the 'COMMIT' line or these nat table rules won't # Forward traffic through eth0 - Change to match you out-interface


Add the following to /etc/ufw/les just before the filter rules. The final step is to add NAT to ufw’s configuration. In the file /etc/default/ufw change the parameter DEFAULT_FORWARD_POLICY DEFAULT_FORWARD_POLICY="ACCEPT"Īlso configure /etc/ufw/nf to allow ipv4 forwarding (the parameters is commented out by default). If you needed ufw to NAT the connections from the external interface to the internal the solution is pretty straight forward. If ufw is not installed by default be sure to install it first. I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.
