Iptables is in short a Linux based packet filtering firewall. Iptables interfaces to the Linux netfilter module to perform filtering of network packets. This can be to deny/allow traffic filter or perform Network Address Translation (NAT). With careful configuration iptables can be a very cost effective, powerful and flexible firewall or gateway solution. Iptables is available from http://www.netfilter.org/ or via your Linux distribution.
This tutorial expects iptables to be already installed. Please follow your distributions method for installing iptables. For NAT you will need two network adapters.
A basic rule of thumb is that you want to block all inbound traffic and then specify which traffic you want to receive. Depending on levels of security needed this policy could also be applied to outgoing traffic. With iptables you first set rules to allow traffic you want to get through the firewall then set a rule to deny all traffic.