there is a ton of documentation on line for ipchains. (linuxhq.org - firewall howto)
but this *may* get you started
set the POLICY:
ipchains -P input DENY
ipchains -P output DENY
ipchains -P forward DENY
---
set the rules
ipchains -A input -p tcp --dport 80 -j ACCEPT
ipchains -A input -p udp --dport 53 -j ACCEPT
ipchains -A input -p udp --dport 20 -j ACCEPT
ipchains -A input -p udp --dport 22 -j ACCEPT
etc, etc.
---
easiest thing to do is create a script called rc.firewall (make it executalbe : u+x also hope you know how to make a script. ie #!/bin/bash at top when your typing this into a file you created named rc.firewall) then you can edit the /etc/rc.d/rc.local file and put :
/etc/rc.d/rc.firewall
at the very bottom after everything else and wholla!
BUT
check this link out
i'm lazy and don't want to type anymore :P~
http://www.linux.com/howto/IPCHAINS-HOWTO-2.html