freebsd-dev/etc/netstart
Rodney W. Grimes 978dabea51 Reviewed by: bde, jkh
Add comment that you should not have to edit netstart, and if you
do we would like to know about it.

The lo0 interface is now handled just like any other interface,
This makes it possible to do things to it from sysconfig.

Redo the comments in sysconfig about network_interfaces and ifconfig_${X}
to reflect the moving of lo0 to this scheme.  We now have an uncommented
variable for sysintall to find and play with.  (Your welcome Jordan)

Redo the way static routes are handled.  Basically use the same
scheme for routes that I did for network interfaces.  This allows
any number of static routes to be added from sysconfig.

Make sure we do the default route first so we stand a chance of
getting to our DNS server (if we have one) to resolve our own
IP address from $hostname.
1995-05-17 04:46:57 +00:00

72 lines
2.1 KiB
Bash
Executable File

#!/bin/sh -
#
# $Id: netstart,v 1.31 1995/05/11 21:11:14 jkh Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
# this file, but rather in /etc/sysconfig. Please check this file
# first before contemplating any changes here. If you do need to change
# this file for some reason, we would like to know about it.
# If there is a global system configuration file, suck it in.
if [ -f /etc/sysconfig ]; then
. /etc/sysconfig
fi
# Set the host name if it is not already set
if [ -z "`hostname -s`" ] ; then
hostname $hostname
fi
# Set the domainname if we're using NIS
if [ -n "$defaultdomainname" -a "x$defaultdomainname" != "xNO" ] ; then
domainname $defaultdomainname
fi
#
# XXX This is known to cause an error if /usr is nfs mounted since it
# will not be avaliable until after the network is up :-(. Once the
# relocation of sysctl to /sbin is done that problem will go away.
#
if [ -n "$tcp_extensions" -a "x$tcp_extensions" = "xNO" ] ; then
sysctl -nw net.inet.tcp.rfc1323=0
sysctl -nw net.inet.tcp.rfc1644=0
fi
# Set up all the network interfaces, calling startup scripts if needed
for ifn in ${network_interfaces}; do
if [ -e /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn} ${ifn}
fi
eval ifconfig_args=\$ifconfig_${ifn}
ifconfig ${ifn} ${ifconfig_args}
ifconfig ${ifn}
done
if [ -n "$defaultrouter" -a "x$defaultrouter" != "xNO" ] ; then
static_routes="default ${static_routes}"
route_default="default ${defaultrouter}"
fi
# Set up any static routes. This should be done before router discovery.
for i in ${static_routes}; do
eval route_args=\$route_${i}
route add ${route_args}
done
if [ "x$gated" != "xNO" -o "x$routedflags" != "xNO" ] ; then
echo -n starting routing daemons:
# $gated and $routedflags are imported from /etc/sysconfig.
# If $gated == YES, gated is used; otherwise routed.
# If $routedflags == NO, routed isn't run.
if [ "X${gated}" = X"YES" -a -r /etc/gated.conf ]; then
echo -n ' gated'; /usr/local/sbin/gated $gatedflags
elif [ "X${routedflags}" != X"NO" ]; then
echo -n ' routed'; routed $routedflags
fi
echo '.'
fi