Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jun 1998 11:03:44 -0500 (CDT)
From:      Jacques Vidrine <nectar@NECTAR.COM>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   conf/6947: allow ip address for natd_interface in rc.conf/rc.network
Message-ID:  <199806141603.LAA26889@bone.nectar.com>

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

>Number:         6947
>Category:       conf
>Synopsis:       allow ip address for natd_interface in rc.conf/rc.network
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 14 09:10:01 PDT 1998
>Last-Modified:
>Originator:     Jacques Vidrine
>Organization:
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

	3.0-CURRENT

>Description:

	natd must be started with either ``-n [interface name]'' or
	``-a [ip address]''.  Both flags are used to tell natd which
	interface and IP address to use for aliasing.

	Currently, rc.network is hard-coded to use ``-n
	${natd_interface}''.  I propose changing the behavior
	such that if ${natd_interface} looks like an IP address,
	use ``-a ${natd_interface}'', otherwise use ``-n
	${natd_interface}''.

	This will allow users who need the behavior of -a to
	use our config files to start natd.

>How-To-Repeat:

	Attempt to find a way to start natd with the -a flag using
	our existing configuration scripts.

>Fix:

Note that this patch will only apply if the bug reported in conf/6946
has been applied first.  If it has not, it is not hard to apply the
patch by hand instead.

--- rc.network.orig     Sun Jun 14 10:48:21 1998
+++ rc.network  Sun Jun 14 10:55:11 1998
@@ -269,10 +269,16 @@
     fi

     # Network Address Translation daemon
-    if [ "X${natd_enable}" = X"YES" -a "X${natd_interface}" != X"" \
-       -a "X${firewall_enable}" = X"YES" ]; then
-           echo -n ' natd'; natd ${natd_flags} -n ${natd_interface}
-    fi
+       if [ "X${natd_enable}" = X"YES" -a X"${natd_interface}" != X"" \
+               -a X"${firewall_enable}" = X"YES" ]; then
+               if echo ${natd_interface} | \
+                       grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then
+                       natd_ifarg="-a ${natd_interface}"
+               else
+                       natd_ifarg="-n ${natd_interface}"
+               fi
+               echo -n ' natd'; natd ${natd_flags} ${natd_ifarg}
+       fi

     echo '.'
     network_pass3_done=YES 

>Audit-Trail:
>Unformatted:

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



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