This is the file I wrote. It is a Firewall and is also meant to link a second computer to the internet through the first:
!/sbin/sh
#firewall.sh
/sbin/iptables -P INPUT DROP
/sbin/iptables -P FORWARD DROP
/sbin/iptables --flush
/sbin/iptables --delete-chain
/sbin/iptables -P FORWARD DROP
/sbin/iptables -P INPUT DROP
/sbin/iptables -A INPUT -i lo --source 127.0.0.1 --destination 127.0.0.1 -j ACCEPT
/sbin/iptables -A INPUT -m state --state "ESTABLISHED,RELATED"-j ACCEPT
/sbin/iptables -A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT
/sbin/iptables -A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT
/sbin/iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
/sbin/iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables -t nat -A POSTROUTING -o eth0 -J MASQUERADE
echo 1> /proc/sys/net/ipv4/ip_forward
/sbin/iptables -A INPUT -j LOG -m limit --limit 40/minute
/sbin/iptables -A INPUT -J DROP
/sbin/iptables-save > /etc/sysconfig/iptables
echo "$0: Done."