Iptables masquarading simple and working rule
This is a simple masquerading rule, to allow computers behind a Unix machine to access Internet.
These three lines stand for:
– allow “IP” forwarding
– flush the “-t nat” table to ensure that there are no other rules that apply to your policy
– masquerade the traffic generated by the 192.168.1.0-192.168.1.255 network
You can add these three lines at the bottom of your “/etc/rc.local” file to ensure that after a reboot your machine will continue to masquerade.