I use these rules in iptables to block any new connections
Just remember to set your variables
#Location of iptables???
$IPTABLES=/sbin/iptables
$EXTIP="ppp0" #Change to your external interface
$INTIF="eth1" #Change to your internal interface
#Stops new connections on FORWARD chain
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
#Stops new connections on INPUT chain
$IPTABLES -A INPUT -i $EXTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
#Allows anything from Internal LAN into Linux box
$IPTABLES -A INPUT -i $INTIF -j ACCEPT
#Allows anything out of Internal LAN to Internet
$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
Put these at the end of your scripts
If you want to allow certain ports into your machine from outside put an ACCEPT rule before these
Set your default rules for INPUT, OUTPUT, FORWARD to DROP and lo and behold you disappear from the internet and your set.