IP Masquerading
IP Masquerading
This can be accomplished with a single iptables rule, which may differ slightly based
on your network configuration:
The above command assumes that your private address space is 192.168.0.0/16 and
that your Internet-facing device is ppp0. The syntax is broken down as follows:
Each chain in the filter table (the default table, and where most or all packet filtering
occurs) has a default policy of ACCEPT, but if you are creating a firewall in addition
to a gateway device, you may have set the policies to DROP or REJECT, in which
case your masqueraded traffic needs to be allowed through the FORWARD chain for
the above rule to work:
The above commands will allow all connections from your local network to the
Internet and all traffic related to those connections to return to the machine that
initiated them