Well get iptables package take it to /usr/src/
then unpack it change dir to iptables
then
#make most-of-pom KERNEL_DIR=/usr/src/linux
//This will ask you to patch kernel say yes to all if patch fails say no next time
#make KERNEL_DIR=/usr/src/linux
#make install KERNEL_DIR=/usr/src/linux
then go to /usr/src/linux head up to Networking Options Choose (Network packet filtering (replaces ipchains) )
Then scroll down enter IP:Netfilter configuration choose everything until you reach ipchains but dont choose "realm support"
Reboot. Well know you got iptables installed now all you need a firewall script. Here is my firewall script to give you an idea
iptables -F // Reset all rules
iptables -A INPUT -p tcp -s ! 127.0.0.1 --dport 631 -j REJECT --reject-with tcp-reset // If someone try to access port 631 from outside dont let them but let localhost access my cups port
iptables -A INPUT -p tcp -s ! 127.0.0.1 --dport 1234 -j REJECT --reject-with tcp-reset // No access to port 1234 from outside my proxy port
iptables -A INPUT -p udp -s ! 127.0.0.1 --dport 3130 -j DROP // No access to udp 3130 port from outside my udp port for proxy
iptables -A INPUT -m psd -j DROP //Stop port scanning attemps yes this works!
You can get nmap from
www.insecure.org/nmap
to see what ports you have open and create a firewall rule set and put them in /etc/rc.d/rc.local so that firewall starts everytime you reboot. Btw there are lots of how-tos on the net
Cheers cartman