From owner-freebsd-bugs Sun Jun 14 09:10:45 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA20347 for freebsd-bugs-outgoing; Sun, 14 Jun 1998 09:10:45 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA20339 for ; Sun, 14 Jun 1998 09:10:42 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id JAA10855; Sun, 14 Jun 1998 09:10:01 -0700 (PDT) Received: from bone.nectar.com (bone.nectar.com [204.27.67.93]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA19206 for ; Sun, 14 Jun 1998 09:04:15 -0700 (PDT) (envelope-from nectar@bone.nectar.com) Received: (from nectar@localhost) by bone.nectar.com (8.9.0/8.9.0) id LAA26889; Sun, 14 Jun 1998 11:03:44 -0500 (CDT) Message-Id: <199806141603.LAA26889@bone.nectar.com> Date: Sun, 14 Jun 1998 11:03:44 -0500 (CDT) From: Jacques Vidrine Reply-To: nectar@NECTAR.COM To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: conf/6947: allow ip address for natd_interface in rc.conf/rc.network Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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