Subject: misc/3638: Add /etc/ipnat.conf functionality similar to /etc/ipf.conf
To: None <gnats-bugs@gnats.netbsd.org>
From: None <abs@mono.org>
List: netbsd-bugs
Date: 05/16/1997 22:55:23
>Number:         3638
>Category:       misc
>Synopsis:       Add /etc/ipnat.conf functionality similar to /etc/ipf.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri May 16 23:05:00 1997
>Last-Modified:
>Originator:     David Brownlee
>Organization:
<a href="http://www.mono.org/">Monochrome</a>
>Release:        1.2
>Environment:
	
System: NetBSD lapton.mono.org 1.2D NetBSD 1.2D (_LAPTON_) #3: Sun Apr 27 22:24:02 BST 1997 root@lapton.mono.org:/usr/src/sys/arch/i386/compile/_LAPTON_ i386


>Description:
	ipf can be configured from within /etc/rc.conf, but ipnat cannot.
>How-To-Repeat:
	Try to configured a machine to run ipnat on bootup (for example to
	be a gateway for a local subnet all using the same IP address to the
	outside world).
>Fix:
	Patch to /etc/netstart and /etc/rc.conf

--- netstart	Sun May 11 17:02:51 1997
+++ netstart.new	Fri May 16 22:27:19 1997
@@ -94,6 +94,15 @@
 ) < /etc/ifaliases
 fi
 
+# Network Address Translation...
+if [ "$ipnat" != NO ] && [ -f /etc/ipnat.conf ]; then
+	echo 'installing NAT rules ... '
+	if [ "$ipfilter" = NO ] || [ ! -f /etc/ipf.conf ]; then
+		ipf -E -Fa
+	fi
+	ipnat -F -f /etc/ipnat.conf
+fi
+
 if [ -s /etc/netstart.local ]; then
 	. /etc/netstart.local
 fi
--- rc.conf	Sun May 11 17:02:51 1997
+++ rc.conf.new	Fri May 16 22:29:03 1997
@@ -17,6 +17,7 @@
 savecore_flags=DEFAULT		# default: ""
 lkm_init=YES			# YES or NO.
 ipfilter=NO			# YES or NO.
+ipnat=YES			# YES or NO.
 
 # Network Interfaces
 net_interfaces=DEFAULT		# default: use "ifconfig -l" to get a list
>Audit-Trail:
>Unformatted: