From owner-freebsd-bugs@FreeBSD.ORG Wed Oct 8 08:30:17 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 46C2116A4B3 for ; Wed, 8 Oct 2003 08:30:17 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D71B143FD7 for ; Wed, 8 Oct 2003 08:30:13 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h98FUDFY061966 for ; Wed, 8 Oct 2003 08:30:13 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h98FUDND061965; Wed, 8 Oct 2003 08:30:13 -0700 (PDT) (envelope-from gnats) Resent-Date: Wed, 8 Oct 2003 08:30:13 -0700 (PDT) Resent-Message-Id: <200310081530.h98FUDND061965@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Ian Service Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4D71716A4BF for ; Wed, 8 Oct 2003 08:20:23 -0700 (PDT) Received: from atlas.tsnetworks.ca (atlas.tsnetworks.ca [216.185.66.221]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6ABBD43FF2 for ; Wed, 8 Oct 2003 08:20:12 -0700 (PDT) (envelope-from iservice@atlas.tsnetworks.ca) Received: from atlas.tsnetworks.ca (localhost [127.0.0.1]) by atlas.tsnetworks.ca (8.12.9/8.12.9) with ESMTP id h98FKA3E075584; Wed, 8 Oct 2003 11:20:10 -0400 (EDT) (envelope-from iservice@atlas.tsnetworks.ca) Received: (from root@localhost) by atlas.tsnetworks.ca (8.12.9/8.12.9/Submit) id h98FKAoo075583; Wed, 8 Oct 2003 11:20:10 -0400 (EDT) Message-Id: <200310081520.h98FKAoo075583@atlas.tsnetworks.ca> Date: Wed, 8 Oct 2003 11:20:10 -0400 (EDT) From: Ian Service To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: iservice@tsnetworks.ca Subject: misc/57748: [patch] rc.network doesn't allow for -a in natd_flags if interface specified X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Ian Service List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Oct 2003 15:30:17 -0000 >Number: 57748 >Category: misc >Synopsis: [patch] rc.network doesn't allow for -a in natd_flags if interface specified >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Wed Oct 08 08:30:13 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Ian Service >Release: FreeBSD 4.8-STABLE i386 >Organization: Tweaked Solutions Inc. >Environment: System: FreeBSD jolt.landscapeontario.com 4.8-STABLE FreeBSD 4.8-STABLE #0: Wed May 21 21:06:47 EDT 2003 iservice@newjolt.landscapeontario.com:/usr/obj/usr/src/sys/NEWJOLTKERNEL i386 >Description: By default if you natd_interface="out0" into your rc.conf it makes the ipfw rule if natd_enable="YES" and then it makes the natd flag -n out0 this is good but if you want to make another IP the nat IP, you have to make natd_interface="192.168.0.1" or whatever, but if that's not your external interface, the ipfw rule is wrong and doesn't work. I have an aliased IP that I want my nat traffic to leave as so, I set the natd_flags="-a 192.168.0.2" and my natd_interface="out0" and then I needed to edit /etc/rc.network, to look for that and not reduntantly set -n to out0 as well as -a to 192.168.0.2 >How-To-Repeat: >Fix: See Patch --- rc.network.2003100800.patch begins here --- --- /root/rc.network Thu Apr 3 03:55:40 2003 +++ /etc/rc.network Wed Oct 8 09:09:20 2003 @@ -338,7 +338,10 @@ case ${natd_enable} in [Yy][Ee][Ss]) if [ -n "${natd_interface}" ]; then - if echo ${natd_interface} | \ + if echo ${natd_flags} | \ + grep -q -E '^\-a\ [0-9]+(\.[0-9]+){0,3}'; then + # there's already a -a flag in natd_flags + elif echo ${natd_interface} | \ grep -q -E '^[0-9]+(\.[0-9]+){0,3}$'; then natd_flags="$natd_flags -a ${natd_interface}" else --- rc.network.2003100800.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: