Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Nov 2000 18:27:29 +0200
From:      Wim Olivier <wimo@osiricom.co.za>
To:        FreeBSD-stable <freebsd-stable@freebsd.org>
Subject:   Entire Config:  NATD & IPFW on FreeBSD 4.0-REL
Message-ID:  <3A1167F1.F3865DEC@osiricom.co.za>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------43F7858B05283B3A8A2354F9
Content-Type: multipart/alternative;
 boundary="------------044B2225C162437292C9BC37"


--------------044B2225C162437292C9BC37
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Still no luck....

Attached is my current config:  (/etc/rc.conf, /etc/rc.firewall,
/usr/src/sys/i386/conf/DAEMON


Please recommend....



--
Kind Regards,

Wim Olivier
Principal Consultant - UNIX Systems
Professional Services (Africa & Middle East)
OSIRICOM Holdings (Pty) Ltd.  -  South Africa
Mobile : +27 (0) 82 6553599            http://www.osiricom.co.za
Tel      : +27 11 802 7415
Fax     : +27 11 802 5853


--------------044B2225C162437292C9BC37
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Still no luck....
<p>Attached is my current config:&nbsp; (/etc/rc.conf, /etc/rc.firewall,
/usr/src/sys/i386/conf/DAEMON
<br>&nbsp;
<p>Please recommend....
<br>&nbsp;
<br>&nbsp;
<p>--
<br>Kind Regards,
<p>Wim Olivier
<br>Principal Consultant - UNIX Systems
<br>Professional Services (Africa &amp; Middle East)
<br>OSIRICOM Holdings (Pty) Ltd.&nbsp; -&nbsp; South Africa
<br>Mobile : +27 (0) 82 6553599&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<A HREF="http://www.osiricom.co.za">http://www.osiricom.co.za</A>;
<br>Tel&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : +27 11 802 7415
<br>Fax&nbsp;&nbsp;&nbsp;&nbsp; : +27 11 802 5853
<br>&nbsp;</html>

--------------044B2225C162437292C9BC37--

--------------43F7858B05283B3A8A2354F9
Content-Type: text/plain; charset=us-ascii;
 name="rc.firewall"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="rc.firewall"

############
# Setup system for firewall service.
# $FreeBSD: src/etc/rc.firewall,v 1.30 2000/02/06 19:24:37 paul Exp $

# Suck in the configuration variables.
if [ -r /etc/defaults/rc.conf ]; then
	. /etc/defaults/rc.conf
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 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
[Oo][Pp][Ee][Nn])
	${fwcmd} add 65000 pass all from any to any
	;;

[Cc][Ll][Ii][Ee][Nn][Tt])
	############
	# This is a prototype setup that will protect your system somewhat
	# against people from outside your own network.
	############

	# set these to your network and netmask and ip
	net="192.0.2.0"
	mask="255.255.255.0"
	ip="192.0.2.1"

	# Allow any traffic to or from my own net.
	${fwcmd} add pass all from ${ip} to ${net}:${mask}
	${fwcmd} add pass all from ${net}:${mask} to ${ip}

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

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

	# Allow setup of incoming email
	${fwcmd} add pass tcp from any to ${ip} 25 setup

	# Allow setup of outgoing TCP connections only
	${fwcmd} add pass tcp from ${ip} to any setup

	# Disallow setup of all other TCP connections
	${fwcmd} add deny tcp from any to any setup

	# Allow DNS queries out in the world
	${fwcmd} add pass udp from any 53 to ${ip}
	${fwcmd} add pass udp from ${ip} to any 53

	# Allow NTP queries out in the world
	${fwcmd} add pass udp from any 123 to ${ip}
	${fwcmd} add pass udp from ${ip} to any 123

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

[Ss][Ii][Mm][Pp][Ll][Ee])
	############
	# 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="ed2"
	onet=""
	omask=""
	oip=""

	# set these to your inside interface network and netmask and ip
	iif="ed0"
	inet="192.168.1.0"
	imask="255.255.255.0"
	iip="192.168.1.1"

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

	# Stop RFC1918 nets on the outside interface
	${fwcmd} add deny all from 10.0.0.0/8 to any via ${oif}
	${fwcmd} add deny all from any to 10.0.0.0/8 via ${oif}
	${fwcmd} add deny all from 172.16.0.0/12 to any via ${oif}
	${fwcmd} add deny all from any to 172.16.0.0/12 via ${oif}
	${fwcmd} add deny all from 192.168.0.0/16 to any via ${oif}
	${fwcmd} add deny all from any to 192.168.0.0/16 via ${oif}

	# Stop draft-manning-dsua-01.txt nets on the outside interface
	${fwcmd} add deny all from 0.0.0.0/8 to any via ${oif}
	${fwcmd} add deny all from any to 0.0.0.0/8 via ${oif}
	${fwcmd} add deny all from 169.254.0.0/16 to any via ${oif}
	${fwcmd} add deny all from any to 169.254.0.0/16 via ${oif}
	${fwcmd} add deny all from 192.0.2.0/24 to any via ${oif}
	${fwcmd} add deny all from any to 192.0.2.0/24 via ${oif}
	${fwcmd} add deny all from 224.0.0.0/4 to any via ${oif}
	${fwcmd} add deny all from any to 224.0.0.0/4 via ${oif}
	${fwcmd} add deny all from 240.0.0.0/4 to any via ${oif}
	${fwcmd} add deny all from any to 240.0.0.0/4 via ${oif}

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

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

	# Allow setup of incoming email
	${fwcmd} add pass tcp from any to ${oip} 25 setup

	# Allow access to our DNS
	${fwcmd} add pass tcp from any to ${oip} 53 setup
	${fwcmd} add pass udp from any to ${oip} 53
	${fwcmd} add pass udp from ${oip} 53 to any

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

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

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

	# Allow DNS queries out in the world
	${fwcmd} add pass udp from any 53 to ${oip}
	${fwcmd} add pass udp from ${oip} to any 53

	# Allow NTP queries out in the world
	${fwcmd} add pass udp from any 123 to ${oip}
	${fwcmd} add pass udp from ${oip} to any 123

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

[Uu][Nn][Kk][Nn][Oo][Ww][Nn])
	;;
*)
	if [ -r "${firewall_type}" ]; then
		${fwcmd} ${firewall_flags} ${firewall_type}
	fi
	;;
esac

--------------43F7858B05283B3A8A2354F9
Content-Type: text/plain; charset=us-ascii;
 name="rc.conf"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="rc.conf"

# This file now contains just the overrides from /etc/defaults/rc.conf
# please make all changes to this file.

# -- sysinstall generated deltas -- #
hostname="REMOVED"
ifconfig_ed0="inet 192.168.1.1  netmask 255.255.255.0"
ifconfig_ed2="inet REMOVED  netmask REMOVED"
defaultrouter="REMOVED"
svr4_enable="YES"
linux_enable="YES"
ibcs2_enable="YES"
check_quotas="NO"
lpd_enable="NO"
moused_port="/dev/cuaa0"
moused_enable="YES"
saver="daemon"
router_flags="-q"
router="routed"
router_enable="YES"
sshd_enable="YES"
nfs_server_enable="NO"
nfs_client_enable="NO"
rwhod_enable="NO"
tcp_extensions="YES"
# -- sysinstall generated deltas -- #
nfs_client_enable="NO"
amd_flags="-a /.amd_mnt -c 1800 -l syslog /host /etc/amd.map /net /etc/amd.map"
# -- sysinstall generated deltas -- #
firewall_enable="YES"
firewall_type="open"
firewall_quiet="NO"
natd_enable="YES"
natd_interface="ed2"
natd_flags="-m -u -dynamic"
network_interfaces="auto"
gateway_enable="YES"
forward_sourceroute="NO"
accept_sourceroute="NO"
arpproxy_all=""

--------------43F7858B05283B3A8A2354F9
Content-Type: text/plain; charset=us-ascii;
 name="Daemon"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="Daemon"

#
# GENERIC -- Generic kernel configuration file for FreeBSD/i386
#
# For more information on this file, please read the handbook section on
# Kernel Configuration Files:
#
#    http://www.freebsd.org/handbook/kernelconfig-config.html
#
# The handbook is also available locally in /usr/share/doc/handbook
# if you've installed the doc distribution, otherwise always see the
# FreeBSD World Wide Web server (http://www.FreeBSD.ORG/) for the
# latest information.
#
# An exhaustive list of options and more detailed explanations of the
# device lines is also present in the ./LINT configuration file. If you are
# in doubt as to the purpose or necessity of a line, check first in LINT.
#
# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.246 2000/03/09 16:32:55 jlemon Exp $

machine		i386
cpu		I586_CPU
ident		DAEMON
maxusers	32

#makeoptions	DEBUG=-g		#Build kernel with gdb(1) debug symbols

options 	MATH_EMULATE		#Support for x87 emulation
options 	INET			#InterNETworking
options 	FFS			#Berkeley Fast Filesystem
options 	FFS_ROOT		#FFS usable as root device [keep this!]
options 	MFS			#Memory Filesystem
options 	MD_ROOT			#MD is a potential root device
options 	NFS			#Network Filesystem
options 	NFS_ROOT		#NFS usable as root device, NFS required
options 	MSDOSFS			#MSDOS Filesystem
options 	CD9660			#ISO 9660 Filesystem
options 	CD9660_ROOT		#CD-ROM usable as root, CD9660 required
options 	PROCFS			#Process filesystem
options 	COMPAT_43		#Compatible with BSD 4.3 [KEEP THIS!]
options 	SCSI_DELAY=15000	#Delay (in ms) before probing SCSI
options 	UCONSOLE		#Allow users to grab the console
options 	USERCONFIG		#boot -c editor
options 	VISUAL_USERCONFIG	#visual boot -c editor
options 	KTRACE			#ktrace(1) support
options 	SYSVSHM			#SYSV-style shared memory
options 	SYSVMSG			#SYSV-style message queues
options 	SYSVSEM			#SYSV-style semaphores
options 	P1003_1B		#Posix P1003_1B real-time extentions
options 	_KPOSIX_PRIORITY_SCHEDULING
options		ICMP_BANDLIM		#Rate limit bad replies
options		IPFIREWALL		#NATD requirement
options		IPFIREWALL_VERBOSE	#NATD requirement
options		IPFIREWALL_VERBOSE_LIMIT=20 #NATD requirement
options		IPDIVERT		#NATD requirement
#options		TCP_RESTRICT_RST	#Stops SYN flooding

# To make an SMP kernel, the next two are needed
#options 	SMP			# Symmetric MultiProcessor Kernel
#options 	APIC_IO			# Symmetric (APIC) I/O
# Optionally these may need tweaked, (defaults shown):
#options 	NCPU=2			# number of CPUs
#options 	NBUS=4			# number of busses
#options 	NAPIC=1			# number of IO APICs
#options 	NINTR=24		# number of INTs

device		isa
#device		eisa
device		pci

# Floppy drives
device		fdc0	at isa? port IO_FD1 irq 6 drq 2
device		fd0	at fdc0 drive 0
#device		fd1	at fdc0 drive 1

# ATA and ATAPI devices
device		ata0	at isa? port IO_WD1 irq 14
device		ata1	at isa? port IO_WD2 irq 15
device		ata
device		atadisk			# ATA disk drives
device		atapicd			# ATAPI CDROM drives
device		atapifd			# ATAPI floppy drives
device		atapist			# ATAPI tape drives
options 	ATA_STATIC_ID		#Static device numbering
#options 	ATA_ENABLE_ATAPI_DMA	#Enable DMA on ATAPI devices

# SCSI Controllers
#device		ahb		# EISA AHA1742 family
device		ahc		# AHA2940 and onboard AIC7xxx devices
#device		amd		# AMD 53C974 (Teckram DC-390(T))
#device		dpt		# DPT Smartcache - See LINT for options!
#device		isp		# Qlogic family
#device		ncr		# NCR/Symbios Logic
#device		sym		# NCR/Symbios Logic (newer chipsets)

#device		adv0	at isa?
#device		adw
#device		bt0	at isa?
#device		aha0	at isa?
#device		aic0	at isa?

# SCSI peripherals
device		scbus		# SCSI bus (required)
device		da		# Direct Access (disks)
device		sa		# Sequential Access (tape etc)
device		cd		# CD
device		pass		# Passthrough device (direct SCSI access)

# RAID controllers
#device		ida		# Compaq Smart RAID
#device		amr		# AMI MegaRAID
#device		mlx		# Mylex DAC960 family

# atkbdc0 controls both the keyboard and the PS/2 mouse
device		atkbdc0	at isa? port IO_KBD
device		atkbd0	at atkbdc? irq 1
device		psm0	at atkbdc? irq 12

device		vga0	at isa?

# splash screen/screen saver
pseudo-device	splash

# syscons is the default console driver, resembling an SCO console
device		sc0	at isa?

# Enable this and PCVT_FREEBSD for pcvt vt220 compatible console driver
#device		vt0	at isa?
#options 	XSERVER			# support for X server on a vt console
#options 	FAT_CURSOR		# start with block cursor
# If you have a ThinkPAD, uncomment this along with the rest of the PCVT lines
#options 	PCVT_SCANSET=2		# IBM keyboards are non-std

# Floating point support - do not disable.
device		npx0	at nexus? port IO_NPX irq 13

# Power management support (see LINT for more options)
#device		apm0    at nexus? disable flags 0x20 # Advanced Power Management

# PCCARD (PCMCIA) support
#device		card
#device		pcic0	at isa? irq 10 port 0x3e0 iomem 0xd0000
#device		pcic1	at isa? irq 11 port 0x3e2 iomem 0xd4000 disable

# Serial (COM) ports
device		sio0	at isa? port IO_COM1 flags 0x10 irq 4
device		sio1	at isa? port IO_COM2 irq 3
#device		sio2	at isa? disable port IO_COM3 irq 5
#device		sio3	at isa? disable port IO_COM4 irq 9

# Parallel port
device		ppc0	at isa? irq 7
device		ppbus		# Parallel port bus (required)
device		lpt		# Printer
#device		plip		# TCP/IP over parallel
device		ppi		# Parallel port interface device
#device		vpo		# Requires scbus and da


# PCI Ethernet NICs.
#device		de		# DEC/Intel DC21x4x (``Tulip'')
#device		fxp		# Intel EtherExpress PRO/100B (82557, 82558)
#device		tx		# SMC 9432TX (83c170 ``EPIC'')
#device		vx		# 3Com 3c590, 3c595 (``Vortex'')
#device		wx		# Intel Gigabit Ethernet Card (``Wiseman'')

# PCI Ethernet NICs that use the common MII bus controller code.
#device		miibus		# MII bus support
#device		dc		# DEC/Intel 21143 and various workalikes
#device		rl		# RealTek 8129/8139
#device		sf		# Adaptec AIC-6915 (``Starfire'')
#device		sis		# Silicon Integrated Systems SiS 900/SiS 7016
#device		ste		# Sundance ST201 (D-Link DFE-550TX)
#device		tl		# Texas Instruments ThunderLAN
#device		vr		# VIA Rhine, Rhine II
#device		wb		# Winbond W89C840F
#device		xl		# 3Com 3c90x (``Boomerang'', ``Cyclone'')

# ISA Ethernet NICs.
device		ed0	at isa? port 0x280 irq 10 iomem 0xd8000
#device		ex
#device		ep
# WaveLAN/IEEE 802.11 wireless NICs. Note: the WaveLAN/IEEE really
# exists only as a PCMCIA device, so there is no ISA attatement needed
# and resources will always be dynamically assigned by the pccard code.
device		wi
# Aironet 4500/4800 802.11 wireless NICs. Note: the declaration below will
# work for PCMCIA and PCI cards, as well as ISA cards set to ISA PnP
# mode (the factory default). If you set the switches on your ISA
# card for a manually chosen I/O address and IRQ, you must specify
# those paremeters here.
#device		an
# The probe order of these is presently determined by i386/isa/isa_compat.c.
#device		ie0	at isa? port 0x300 irq 10 iomem 0xd0000
#device		fe0	at isa? port 0x300
#device		le0	at isa? port 0x300 irq 5 iomem 0xd0000
#device		lnc0	at isa? port 0x280 irq 10 drq 0
#device		cs0	at isa? port 0x300
#device		sn0	at isa? port 0x300 irq 10
# requires PCCARD (PCMCIA) support to be activated
#device		xe0	at isa?

# Pseudo devices - the number indicates how many units to allocated.
pseudo-device	loop		# Network loopback
pseudo-device	ether		# Ethernet support
pseudo-device	sl	1	# Kernel SLIP
pseudo-device	ppp	1	# Kernel PPP
pseudo-device	tun		# Packet tunnel.
pseudo-device	pty		# Pseudo-ttys (telnet etc)
pseudo-device	md		# Memory "disks"
pseudo-device	gif	4	# IPv6 and IPv4 tunneling
#pseudo-device	faith	1	# IPv6-to-IPv4 relaying (translation)

# The `bpf' pseudo-device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
pseudo-device	bpf     16	#Berkeley packet filter

# USB support
#device		uhci		# UHCI PCI->USB interface
#device		ohci		# OHCI PCI->USB interface
#device		usb		# USB Bus (required)
#device		ugen		# Generic
#device		uhid		# "Human Interface Devices"
#device		ukbd		# Keyboard
#device		ulpt		# Printer
#device		umass		# Disks/Mass storage - Requires scbus and da
#device		ums		# Mouse
# USB Ethernet, requires mii
#device		aue		# ADMtek USB ethernet
#device		cue		# CATC USB ethernet
#device		kue		# Kawasaki LSI USB ethernet

--------------43F7858B05283B3A8A2354F9
Content-Type: text/x-vcard; charset=us-ascii;
 name="wimo.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Wim Olivier
Content-Disposition: attachment;
 filename="wimo.vcf"

begin:vcard 
n:Olivier;Wim
tel;cell:+27 (0) 82 655 3599
tel;fax:+27 (0) 11 802 5853
tel;work:+27 (0) 11 802 7415
x-mozilla-html:TRUE
url:http://www.osiricom.co.za
org:Osiricom Holdings (Pty) Ltd.;Professional Services Division
version:2.1
email;internet:wimo@osiricom.co.za
title:Principal Consultant
adr;quoted-printable:;;16 Ashwood Place=0D=0AMomentum Office Park=0D=0AWoodmead;Johannesburg;Gauteng;;South Africa
note;quoted-printable:Osiricom's Professional Services Division  is the de facto source=0D=0Afor Professional Services in Africa & the Middle East region.=0D=0A=0D=0AOperating Systems Specilization:=0D=0A=0D=0A * UNIX (all)=0D=0A * IBM AS/400 (including specialized printing solutions)=0D=0A * NT / Win2000=0D=0A * Tarantella & Citrix Server Based (Thin Client) Computing=0D=0A=0D=0AFor more information please e-mail info@osiricom.co.za
fn:Wim Olivier
end:vcard

--------------43F7858B05283B3A8A2354F9--



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A1167F1.F3865DEC>