From nobody  Tue Oct 13 12:41:20 1998
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id MAA08043;
          Tue, 13 Oct 1998 12:41:20 -0700 (PDT)
          (envelope-from nobody)
Message-Id: <199810131941.MAA08043@hub.freebsd.org>
Date: Tue, 13 Oct 1998 12:41:20 -0700 (PDT)
From: gelderen@mediaport.org
To: freebsd-gnats-submit@freebsd.org
Subject: NATD get loaded late in bootsequence
X-Send-Pr-Version: www-1.0

>Number:         8306
>Category:       conf
>Synopsis:       [patch] NATD get loaded late in bootsequence
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 13 12:50:00 PDT 1998
>Closed-Date:    Wed Mar 24 12:34:04 PST 1999
>Last-Modified:  Wed Mar 24 12:35:09 PST 1999
>Originator:     Jeroen C. van Gelderen
>Release:        2.2.7/STABLE
>Organization:
>Environment:
FreeBSD wit395306.utwente.nl 2.2.7-RELEASE FreeBSD 2.2.7-RELEASE #0: Sat Oct 10 15:57:08 GMT 1998     root@wit395306.student.utwente.nl:/usr/src/sys/compile/FIREWALL  i386
>Description:
I've enabled natd in my rc.conf which works fine except when booting. This
has something to do with NATD only getting loaded in pass 3 of rc.network.

In the first pass of rc.network ipfw gets initialized and it is instructed
to divert everything to the natd which is not running at the time. Then the
various services (sendmail, etc) are started. Problem is that they lack
internet connectivity because traffic is diverted but natd is not yet
running (gets only initialized in pass 3).

The patch attached below fixes the problem for me, but it might not be the
right solution. I'd like someone to take this over and/or give some
feedback...

If you need an 'ungarbled' patch, please mail me...
>How-To-Repeat:
see above
>Fix:
*** rc.network Sun Oct 11 22:14:49 1998
--- rc.network.new Sun Oct 11 22:14:19 1998
***************
*** 87,98 ****
--- 87,104 ----
  echo "but firewall rules are not enabled."
  echo "         All ip services are disabled."
      fi
  fi
      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
+
      # Configure routing

      if [ "x$defaultrouter" != "xNO" ] ; then
      static_routes="default ${static_routes}"
      route_default="default ${defaultrouter}"
      fi
***************
*** 252,267 ****
      unset stash_flag
      fi

      # IP multicast routing daemon
      if [ "X${mrouted_enable}" = X"YES" ]; then
      echo -n ' mrouted'; mrouted ${mrouted_flags}
-     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

      echo '.'
      network_pass3_done=YES
  }
--- 258,268 ----
>Release-Note:
>Audit-Trail:

From: Brian Somers <brian@Awfulhak.org>
To: gelderen@mediaport.org
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: conf/8306: NATD get loaded late in bootsequence 
Date: Wed, 14 Oct 1998 15:32:49 +0100

 > 
 > >Number:         8306
 > >Category:       conf
 > >Synopsis:       NATD get loaded late in bootsequence
 [.....]
 > >Description:
 > I've enabled natd in my rc.conf which works fine except when booting. This
 > has something to do with NATD only getting loaded in pass 3 of rc.network.
 
 Natd needs to move to /sbin if we're going to bring it forward in the 
 boot sequence.  As it is, natd could live on an NFS disk that's 
 accessed through an interface that runs natd....
 
 -- 
 Brian <brian@Awfulhak.org>, <brian@FreeBSD.org>, <brian@OpenBSD.org>
       <http://www.Awfulhak.org>
 Don't _EVER_ lose your sense of humour....
 
 
State-Changed-From-To: open->closed 
State-Changed-By: brian 
State-Changed-When: Wed Mar 24 12:34:04 PST 1999 
State-Changed-Why:  
Natd is now loaded in network_pass1 in -current & -stable 
>Unformatted:
