[more=Rules]
<!--#Moderation mode-->
################ Start of IPFW rules file ###############################
# Flush out the list before we begin.
ipfw -q -f flush
# Set rules command prefix
cmd="ipfw -q add"
pif="rl0"
pnet=`ifconfig rl0 |grep "inet " |awk '{print $6}'`
pip=`ifconfig rl0 |grep "inet " |awk '{print $2}'`
#################################################################
# No restrictions on Inside Lan Interface for private network
# Not needed unless you have Lan.
#################################################################
#$cmd 00005 allow all from any to any via rl0
#################################################################
# No restrictions on Loopback Interface
#################################################################
$cmd 00010 allow all from any to any via lo0
#################################################################
# Allow the packet through if it has previous been added to the
# the "dynamic" rules table by a allow keep-state statement.
#################################################################
$cmd 00015 check-state
#################################################################
# Interface facing Public Internet (Outbound Section)
# Interrogate session start requests originating from behind the
# firewall on the private network or from this gateway server
# destine for the public Internet.
#################################################################
# Allow out access to my ISP's Domain name server.
$cmd 00110 allow tcp from any to 212.7.9.34 53 out via $pif setup keep-state
$cmd 00111 allow udp from any to 212.7.9.34 53 out via $pif keep-state
$cmd 00112 allow tcp from any to 212.7.0.1 53 out via $pif setup keep-state
$cmd 00113 allow udp from any to 212.7.0.1 53 out via $pif keep-state
# Allow out access to my ISP's DHCP server for cable/DSL configurations.
#$cmd 00120 allow log udp from any to any 67 out via $pif keep-state
$cmd 00120 allow udp from any to 10.50.14.1 67-68 out via $pif keep-state
$cmd 00121 allow udp from 10.50.14.1 to any 67-68 in via $pif keep-state
$cmd 00122 allow udp from any to 212.7.9.82 67-68 out via $pif keep-state
$cmd 00123 allow udp from 212.7.9.82 to any 67-68 in via $pif keep-state
# Allow traffic in from ISP's DHCP server.
$cmd 00124 allow udp from any to 212.7.9.82 67-68 in via $pif keep-state
$cmd 00125 allow udp from any to 10.50.14.1 67-68 in via $pif keep-state
# Allow established TCP connections
$cmd 00205 allow tcp from any to any via $pif established
# Allow out non-secure standard www function
$cmd 00210 allow tcp from any to any 80 out via $pif setup keep-state
# Allow out secure www function https over TLS SSL
$cmd 00211 allow tcp from any to any 443 out via $pif setup keep-state
# Allow Infonet proxy
$cmd 00220 allow tcp from any to 212.7.9.42 8080 out via $pif setup keep-state
$cmd 00221 allow tcp from any to 212.7.9.46 8080 out via $pif setup keep-state
$cmd 00222 allow tcp from any to 212.7.9.35 8080 out via $pif setup keep-state
$cmd 00223 allow tcp from any to 212.7.9.36 8080 out via $pif setup keep-state
# Allow out send & get email function
$cmd 00230 allow tcp from any to any 25 out via $pif setup keep-state
$cmd 00231 allow tcp from any to any 110 out via $pif setup keep-state
# Allow out FBSD (make install & CVSUP) functions
# Basically give user root "GOD" privileges.
$cmd 00240 allow tcp from me to any out via $pif setup keep-state uid root
# Allow ping, traceroute and some other ICMP types
$cmd 00250 allow icmp from any to any icmptypes 8 out via $pif keep-state
$cmd 00251 allow icmp from any to any icmptypes 0,3,4,11,12 via $pif keep-state
$cmd 00252 allow udp from any to any 33434-33524 out xmit $pif keep-state
$cmd 00253 allow log icmp from 212.7.9.82 to any icmptypes 8 in via $pif keep-state
$cmd 00254 allow log icmp from 212.7.5.250 to any icmptypes 8 in via $pif keep-state
$cmd 00255 allow log icmp from 212.7.5.251 to any icmptypes 8 in via $pif keep-state
$cmd 00256 allow log icmp from 212.7.0.1 to any icmptypes 8 in via $pif keep-state
$cmd 00257 allow log icmp from 212.7.9.194 to any icmptypes 8 in via $pif keep-state
# Allow out Time
$cmd 00260 allow tcp from any to any 37 out via $pif setup keep-state
# Allow out nntp news (i.e. news groups)
$cmd 00270 allow tcp from any to any 119 out via $pif setup keep-state
# Allow out secure FTP, Telnet, and SCP
# This function is using SSH (secure shell)
# Also enable traditional telnet
$cmd 00280 allow tcp from any to any 22 out via $pif setup keep-state
$cmd 00281 allow tcp from any to any 23 out via $pif setup keep-state
# Allow passive FTP control channel 21 & data high ports
$cmd 00282 allow tcp from any to any 21 out via $pif setup keep-state
$cmd 00283 allow tcp from any to any 10000-65000 out via $pif setup keep-state
# Allow out whois
$cmd 00290 allow tcp from any to any 43 out via $pif setup keep-state
# Allow out whois++
$cmd 00291 allow tcp from any to any 63 out via $pif setup keep-state
$cmd 00292 allow udp from any to any 63 out via $pif keep-state
# Allow out IRC
$cmd 00293 allow tcp from any to any 194 out via $pif setup keep-state
$cmd 00294 allow udp from any to any 194 out via $pif keep-state
# Allow out finger
$cmd 00295 allow tcp from any to any 79 out via $pif setup keep-state
$cmd 00296 allow udp from any to any 79 out via $pif keep-state
# deny and log everything else that.s trying to get out.
# This rule enforces the block all by default logic.
#$cmd 00299 deny log all from any to any out via $pif
#################################################################
# Interface facing Public Internet (Inbound Section)
# Interrogate packets originating from the public Internet
# destine for this gateway server or the private network.
#################################################################
# Deny public pings
$cmd 00310 deny log icmp from any to any in via $pif
# Deny ident
$cmd 00315 deny tcp from any to any 113 in via $pif
# BANNED subnets (00320-00339)
#$cmd 00320 deny all from {banned} to any in via $pif
# Deny all Netbios service. 137=name, 138=datagram, 139=session
# Netbios is MS/Windows sharing services.
# Block MS/Windows hosts2 name server requests 81
$cmd 00340 deny tcp from any to any 137-139 in via $pif
$cmd 00341 deny udp from any to any 137-139 in via $pif
$cmd 00342 deny tcp from any to any 81 in via $pif
# Deny any late arriving packets
$cmd 00350 deny all from any to any frag in via $pif
# Reject & Log all setup of tcp incoming connections from the outside
$cmd 00360 deny log tcp from any to any setup in via $pif
# Reject & Log all incoming connections from the outside
$cmd 00499 deny log all from any to any in via $pif
# Everything else is denied by default
# deny and log all packets that fell through to see what they are
$cmd 00999 deny log all from any to any
################ End of IPFW rules file ###############################
[/more]
<!--#Moderation mode-->
################ Start of IPFW rules file ###############################
# Flush out the list before we begin.
ipfw -q -f flush
# Set rules command prefix
cmd="ipfw -q add"
pif="rl0"
pnet=`ifconfig rl0 |grep "inet " |awk '{print $6}'`
pip=`ifconfig rl0 |grep "inet " |awk '{print $2}'`
#################################################################
# No restrictions on Inside Lan Interface for private network
# Not needed unless you have Lan.
#################################################################
#$cmd 00005 allow all from any to any via rl0
#################################################################
# No restrictions on Loopback Interface
#################################################################
$cmd 00010 allow all from any to any via lo0
#################################################################
# Allow the packet through if it has previous been added to the
# the "dynamic" rules table by a allow keep-state statement.
#################################################################
$cmd 00015 check-state
#################################################################
# Interface facing Public Internet (Outbound Section)
# Interrogate session start requests originating from behind the
# firewall on the private network or from this gateway server
# destine for the public Internet.
#################################################################
# Allow out access to my ISP's Domain name server.
$cmd 00110 allow tcp from any to 212.7.9.34 53 out via $pif setup keep-state
$cmd 00111 allow udp from any to 212.7.9.34 53 out via $pif keep-state
$cmd 00112 allow tcp from any to 212.7.0.1 53 out via $pif setup keep-state
$cmd 00113 allow udp from any to 212.7.0.1 53 out via $pif keep-state
# Allow out access to my ISP's DHCP server for cable/DSL configurations.
#$cmd 00120 allow log udp from any to any 67 out via $pif keep-state
$cmd 00120 allow udp from any to 10.50.14.1 67-68 out via $pif keep-state
$cmd 00121 allow udp from 10.50.14.1 to any 67-68 in via $pif keep-state
$cmd 00122 allow udp from any to 212.7.9.82 67-68 out via $pif keep-state
$cmd 00123 allow udp from 212.7.9.82 to any 67-68 in via $pif keep-state
# Allow traffic in from ISP's DHCP server.
$cmd 00124 allow udp from any to 212.7.9.82 67-68 in via $pif keep-state
$cmd 00125 allow udp from any to 10.50.14.1 67-68 in via $pif keep-state
# Allow established TCP connections
$cmd 00205 allow tcp from any to any via $pif established
# Allow out non-secure standard www function
$cmd 00210 allow tcp from any to any 80 out via $pif setup keep-state
# Allow out secure www function https over TLS SSL
$cmd 00211 allow tcp from any to any 443 out via $pif setup keep-state
# Allow Infonet proxy
$cmd 00220 allow tcp from any to 212.7.9.42 8080 out via $pif setup keep-state
$cmd 00221 allow tcp from any to 212.7.9.46 8080 out via $pif setup keep-state
$cmd 00222 allow tcp from any to 212.7.9.35 8080 out via $pif setup keep-state
$cmd 00223 allow tcp from any to 212.7.9.36 8080 out via $pif setup keep-state
# Allow out send & get email function
$cmd 00230 allow tcp from any to any 25 out via $pif setup keep-state
$cmd 00231 allow tcp from any to any 110 out via $pif setup keep-state
# Allow out FBSD (make install & CVSUP) functions
# Basically give user root "GOD" privileges.
$cmd 00240 allow tcp from me to any out via $pif setup keep-state uid root
# Allow ping, traceroute and some other ICMP types
$cmd 00250 allow icmp from any to any icmptypes 8 out via $pif keep-state
$cmd 00251 allow icmp from any to any icmptypes 0,3,4,11,12 via $pif keep-state
$cmd 00252 allow udp from any to any 33434-33524 out xmit $pif keep-state
$cmd 00253 allow log icmp from 212.7.9.82 to any icmptypes 8 in via $pif keep-state
$cmd 00254 allow log icmp from 212.7.5.250 to any icmptypes 8 in via $pif keep-state
$cmd 00255 allow log icmp from 212.7.5.251 to any icmptypes 8 in via $pif keep-state
$cmd 00256 allow log icmp from 212.7.0.1 to any icmptypes 8 in via $pif keep-state
$cmd 00257 allow log icmp from 212.7.9.194 to any icmptypes 8 in via $pif keep-state
# Allow out Time
$cmd 00260 allow tcp from any to any 37 out via $pif setup keep-state
# Allow out nntp news (i.e. news groups)
$cmd 00270 allow tcp from any to any 119 out via $pif setup keep-state
# Allow out secure FTP, Telnet, and SCP
# This function is using SSH (secure shell)
# Also enable traditional telnet
$cmd 00280 allow tcp from any to any 22 out via $pif setup keep-state
$cmd 00281 allow tcp from any to any 23 out via $pif setup keep-state
# Allow passive FTP control channel 21 & data high ports
$cmd 00282 allow tcp from any to any 21 out via $pif setup keep-state
$cmd 00283 allow tcp from any to any 10000-65000 out via $pif setup keep-state
# Allow out whois
$cmd 00290 allow tcp from any to any 43 out via $pif setup keep-state
# Allow out whois++
$cmd 00291 allow tcp from any to any 63 out via $pif setup keep-state
$cmd 00292 allow udp from any to any 63 out via $pif keep-state
# Allow out IRC
$cmd 00293 allow tcp from any to any 194 out via $pif setup keep-state
$cmd 00294 allow udp from any to any 194 out via $pif keep-state
# Allow out finger
$cmd 00295 allow tcp from any to any 79 out via $pif setup keep-state
$cmd 00296 allow udp from any to any 79 out via $pif keep-state
# deny and log everything else that.s trying to get out.
# This rule enforces the block all by default logic.
#$cmd 00299 deny log all from any to any out via $pif
#################################################################
# Interface facing Public Internet (Inbound Section)
# Interrogate packets originating from the public Internet
# destine for this gateway server or the private network.
#################################################################
# Deny public pings
$cmd 00310 deny log icmp from any to any in via $pif
# Deny ident
$cmd 00315 deny tcp from any to any 113 in via $pif
# BANNED subnets (00320-00339)
#$cmd 00320 deny all from {banned} to any in via $pif
# Deny all Netbios service. 137=name, 138=datagram, 139=session
# Netbios is MS/Windows sharing services.
# Block MS/Windows hosts2 name server requests 81
$cmd 00340 deny tcp from any to any 137-139 in via $pif
$cmd 00341 deny udp from any to any 137-139 in via $pif
$cmd 00342 deny tcp from any to any 81 in via $pif
# Deny any late arriving packets
$cmd 00350 deny all from any to any frag in via $pif
# Reject & Log all setup of tcp incoming connections from the outside
$cmd 00360 deny log tcp from any to any setup in via $pif
# Reject & Log all incoming connections from the outside
$cmd 00499 deny log all from any to any in via $pif
# Everything else is denied by default
# deny and log all packets that fell through to see what they are
$cmd 00999 deny log all from any to any
################ End of IPFW rules file ###############################
[/more]