Procedure is the same in 5.x
This is my kernel cfg
CODE
# Firewall
options IPFIREWALL
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=10
options IPV6FIREWALL
options IPV6FIREWALL_VERBOSE
options IPV6FIREWALL_VERBOSE_LIMIT=10
options DUMMYNET
options HZ=1000
You don't need the ipv6 options unless you really want them. DUMMYNET is for setting up pipes with ipfw to throttle bandwidth.
Here is my ruleset
CODE
add 00001 count ip from any to any in via em0
add 00002 count ip from any to any out via em0
add 00003 deny all from any to 66.139.73.159 # outgoing to ventrilo.com
add 00004 allow all from any to any out via em0
# Banned from life
add 00005 deny all from 221.0.0.0/8 to any # Korea
add 00006 deny all from 218.24.0.0/15 to any # China
add 00007 deny all from 194.88.113.224/28 to any # Brussels University
# Squid
add 65523 allow all from x.x.x.x/16 to x.x.x.x 4000
# Internet Services
add 65524 allow all from any to any 21,22,25,110,587
# HTTP
add 65525 allow all from any to any 80,443
# ftp-data
add 65526 allow all from any to any 49152-65535
# doom3/et/cs:source/ventrilo
add 65527 allow all from any to x.x.x.x 27666,27015,3784,27960
add 65528 allow all from any to x.x.x.x 27960,3784
# shoutcast
add 65530 allow all from any to x.x.x.x 8000,8001
add 65531 allow all from any to x.x.x.x 8000,8001
add 65532 allow icmp from any to any icmptypes 0 # echo
add 65533 allow icmp from any to any icmptypes 8 # ping
add 65534 deny ip from any to any
I save my rules in /etc/rc.firewall.rules
I learned the hard way to use firewall_type="OPEN" in rc.conf and then manually load the rules using sh /etc/rc.firewall /etc/rc.firewall.rules (make sure you include the full paths for this command otherwise you will lock yourself out). Using an OPEN firewall by default has saved me tech support time. Just need to ask for a reboot with it like this. There is nothing quite like locking yourself and all the techs out with a firewall rule, then having to explain why they need to plug a keyboard and monitor into the box and exactly what command they need to run. I'm sure they just love it!