Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Dec 2000 15:31:13 -0700
From:      "Carlos Andrade" <carlos@rjstech.com>
To:        <freebsd-ipfw@FreeBSD.ORG>
Subject:   right
Message-ID:  <000801c066e6$bb7e4620$fa01a8c0@rjstech.com>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
So the email list found some typo's (which is good, the typos bad).  And I
have my machine on a crossover cable, life is peachy right?  wrong...

for some reason I cannot get dns to work.  I can send email and receive
email since I was able to hobble the ip's of my pop and smtp servers.  So I
look at my rc.firewall (attached) and well I cannot figure out why I can do
things using IP's but not names.  Its one thing for me to do this, its
another for the rest of the office to do it.  For that matter I don't know
of the top of my head the ip for www.yahoo.com.  So I beseech this email
list, what am I doing wrong?

----
Carlos A. Andrade
IS Manager
RJS Technologies
915.845.5228 ext 13  915.845.2119 fax
carlos@rjstech.com

[-- Attachment #2 --]
############
# Setup system for firewall service.
# $FreeBSD: src/etc/rc.firewall,v 1.30.2.6 2000/09/21 07:44:53 ru Exp $

# Suck in the configuration variables.
if [ -r /etc/defaults/rc.conf ]; then
	. /etc/defaults/rc.conf
	source_rc_confs
elif [ -r /etc/rc.conf ]; then
	. /etc/rc.conf
fi

############
# Define the firewall type in /etc/rc.conf.  Valid values are:
#   open     - will allow anyone in
#   client   - will try to protect just this machine
#   simple   - will try to protect a whole network
#   closed   - totally disables IP services except via lo0 interface
#   UNKNOWN  - disables the loading of firewall rules
#   filename - will load the rules in the given filename (full path required)
#
# For ``client'' and ``simple'' the entries below should be customized
# appropriately

############
#
# If you don't know enough about packet filtering, we suggest that you
# take time to read this book:
#
#	Building Internet Firewalls
#	Brent Chapman and Elizabeth Zwicky
#
#	O'Reilly & Associates, Inc
#	ISBN 1-56592-124-0
#	http://www.ora.com/
#
# For a more advanced treatment of Internet Security read:
#
#	Firewalls & Internet Security
#	Repelling the wily hacker
#	William R. Cheswick, Steven M. Bellowin
#
#	Addison-Wesley
#	ISBN 0-201-6337-4
#	http://www.awl.com/
#

if [ -n "${1}" ]; then
	firewall_type="${1}"
fi

############
# Set quiet mode if requested
#
case ${firewall_quiet} in
[Yy][Ee][Ss])
	fwcmd="/sbin/ipfw -q"
	;;
*)
	fwcmd="/sbin/ipfw"
	;;
esac

############
# Flush out the list before we begin.
#
${fwcmd} -f flush

############
# These rules are required for using natd.  All packets are passed to
# natd before they encounter your remaining rules.  The firewall rules
# will then be run again on each packet after translation by natd,
# minus any divert rules (see natd(8)).
#
case ${natd_enable} in
[Yy][Ee][Ss])
	if [ -n "${natd_interface}" ]; then
	      ${fwcmd} add 50 divert natd all from any to any via ${natd_interface}
	fi
	;;
esac

############
# If you just configured ipfw in the kernel as a tool to solve network
# problems or you just want to disallow some particular kinds of traffic
# then you will want to change the default policy to open.  You can also
# do this as your only action by setting the firewall_type to ``open''.
#
# ${fwcmd} add 65000 pass all from any to any

############
# Only in rare cases do you want to change these rules
#
${fwcmd} add 100 pass all from any to any via lo0
${fwcmd} add 200 deny all from any to 127.0.0.0/8
# If you're using 'options BRIDGE', uncomment the following line to pass ARP
#${fwcmd} add 300 pass udp from 0.0.0.0 2054 to 0.0.0.0

# Prototype setups.
#
case ${firewall_type} in
[Ss][Ii][Mm][Pp][Ll][Ee])

# I deleted open and client, too many conflicts
# so we go directly in to simple
# This is a prototype setup for a simple firewall.  Configure this
# machine as a named server and ntp server, and point all the machines
# on the inside at this machine for those services.
############

	# set these to your outside interface network and netmask and ip
	oif="xl0"
	onet="206.249.222.0"
	omask="255.255.255.224"
	oip="206.249.222.226"

	# set these to your inside interface network and netmask and ip
	iif="xl1"
	inet="192.168.1.0"
	imask="255.255.255.224"
	iip="192.168.1.225"

	#dns servers
	#dns1="204.90.111.2"
	#dns2="205.137.48.5"

	# Stop spoofing
	${fwcmd} add 300 deny all from ${inet}:${imask} to any in via ${oif}
	${fwcmd} add 400 deny all from ${onet}:${omask} to any in via ${iif}

	# Stop RFC1918 nets on the outside interface
	${fwcmd} add 500 deny all from 10.0.0.0/8 to any via ${oif}
	${fwcmd} add 600 deny all from any to 10.0.0.0/8 out via ${oif}
	${fwcmd} add 700 deny all from 172.16.0.0/12 to any via ${oif}
	${fwcmd} add 800 deny all from any to 172.16.0.0/12 out via ${oif}
	${fwcmd} add 900 deny all from 192.168.0.0/16 to any via ${oif}
	${fwcmd} add 1000 deny all from any to 192.168.0.0/16 out via ${oif}
	
	# Stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1,
	# DHCP auto-configuration, NET-TEST, MULTICAST (class D), and class E)
	# on the outside interface
	${fwcmd} add 1100 deny all from 0.0.0.0/8 to any via ${oif}
	${fwcmd} add 1200 deny all from any to 0.0.0.0/8 via ${oif}
	${fwcmd} add 1300 deny all from 169.254.0.0/16 to any via ${oif}
	${fwcmd} add 1400 deny all from any to 169.254.0.0/16 via ${oif}
	${fwcmd} add 1500 deny all from 192.0.2.0/24 to any via ${oif}
	${fwcmd} add 1600 deny all from any to 192.0.2.0/24 via ${oif}
	${fwcmd} add 1700 deny all from 224.0.0.0/4 to any via ${oif}
	${fwcmd} add 1800 deny all from any to 224.0.0.0/4 via ${oif}
	${fwcmd} add 1900 deny all from 240.0.0.0/4 to any via ${oif}
	${fwcmd} add 2000 deny all from any to 240.0.0.0/4 via ${oif}

	# Allow TCP through if setup succeeded
	${fwcmd} add 2100 pass tcp from any to any established

	# Allow IP fragments to pass through
	${fwcmd} add 2200 pass all from any to any frag

# TCP STUFF

	# Allow access to sendmail for incoming email
	${fwcmd} add 2300 pass tcp from any to ${oip} 25 setup

	# Allow access to our WWW
	${fwcmd} add 2400 pass tcp from any to ${oip} 80 setup

	#SSH login - allow and log all incoming
	${fwcmd} add 2500 pass log tcp from any to any 22 in via ${oip} setup

	#IDENT - reset incoming connections 
	${fwcmd} add 2600 reset tcp from any to any 113 in via ${oif} setup

	# Reject&Log all setup of incoming connections from the outside
	${fwcmd} add 2700 deny log tcp from any to any in via ${oif} setup

	# Allow setup of any other TCP connection
	${fwcmd} add 2800 pass tcp from any to any setup

# UPD STUFF

	# Allow access to our DNS
	#${fwcmd} add 2900 pass upd from any to ${dns1} 53 setup
	#${fwcmd} add 3000 pass upd from any to ${dns2} 53 setup
	#${fwcmd} add 3100 pass udp from ${dns1} 53 to any
	#${fwcmd} add 3200 pass udp from ${dns2} 53 to any
	
	${fwcmd} add 2900 pass udp from any 53 to ${oip}
	${fwcmd} add 3000 pass udp from ${oip} 53 to any
	${fwcmd} add 3100 pass tcp from any to ${oip} 53 setup

	# SMB - allow local traffic
	${fwcmd} add 3300 pass udp from any to any 137-139 via ${iif}

	# Allow NTP queries out in the world BUT we do it like this
	# allow server-server on outside interface
	# allow client-server on inside interface
	${fwcmd} add 3400 pass udp from any 123 to any 123 via ${oif}
	${fwcmd} add 3500 pass udp from any 123 to any 123 via ${iif}
	${fwcmd} add 3600 pass udp from any to any 123 via ${iif} 

	# TRACEROUTE - allow outgoing but not ingoing
	${fwcmd} add 3700 pass udp from any to any 33434-33523 out via ${oif}

# ICMP stuff

	#ICMP packets
	# allow all on internal interface
	${fwcmd} add 3800 pass icmp from any to any via ${iif}

	#Allow outgoing pings but no incoming
	${fwcmd} add 3900 pass icmp from any to any icmptypes 8 out via ${oif}
	${fwcmd} add 4000 pass icmp from any to any icmptypes 0 in via ${oif}

	#Allow destination unreachable, source quench, time excedded
	#and bad header
     ${fwcmd} add 4100 pass icmp from any to any icmptypes 3,4,11,12 via ${oif}

	#deny the rest of them
	${fwcmd} add 4200 deny icmp from any to any 

	# Everything else is denied by default, unless the
	# IPFIREWALL_DEFAULT_TO_ACCEPT option is set in your kernel
	# config file. Which it is not
	;;
esac

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000801c066e6$bb7e4620$fa01a8c0>