1993-06-20 09:41:45 -04:00
|
|
|
#!/bin/sh -
|
|
|
|
|
#
|
1996-02-10 23:07:27 -05:00
|
|
|
# $Id: netstart,v 1.41 1996/02/09 12:45:37 jkh Exp $
|
1993-11-06 20:19:06 -05:00
|
|
|
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
|
1993-06-20 09:41:45 -04:00
|
|
|
|
1995-05-11 17:11:17 -04:00
|
|
|
# Note that almost all the user-configurable behavior is no longer in
|
|
|
|
|
# this file, but rather in /etc/sysconfig. Please check this file
|
1995-05-17 00:46:57 -04:00
|
|
|
# first before contemplating any changes here. If you do need to change
|
|
|
|
|
# this file for some reason, we would like to know about it.
|
1995-05-11 17:11:17 -04:00
|
|
|
|
1995-04-10 21:22:24 -04:00
|
|
|
# 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
|
1994-11-02 18:50:54 -05:00
|
|
|
if [ -z "`hostname -s`" ] ; then
|
|
|
|
|
hostname $hostname
|
|
|
|
|
fi
|
1993-07-19 15:14:45 -04:00
|
|
|
|
1995-02-03 18:54:07 -05:00
|
|
|
# Set the domainname if we're using NIS
|
1995-04-24 19:52:16 -04:00
|
|
|
if [ -n "$defaultdomainname" -a "x$defaultdomainname" != "xNO" ] ; then
|
|
|
|
|
domainname $defaultdomainname
|
1995-02-03 18:54:07 -05:00
|
|
|
fi
|
|
|
|
|
|
1995-05-11 15:08:37 -04:00
|
|
|
#
|
|
|
|
|
# XXX This is known to cause an error if /usr is nfs mounted since it
|
1996-01-31 10:03:18 -05:00
|
|
|
# will not be available until after the network is up :-(. Once the
|
1995-05-11 15:08:37 -04:00
|
|
|
# relocation of sysctl to /sbin is done that problem will go away.
|
|
|
|
|
#
|
|
|
|
|
if [ -n "$tcp_extensions" -a "x$tcp_extensions" = "xNO" ] ; then
|
1995-06-25 05:35:56 -04:00
|
|
|
sysctl -w net.inet.tcp.rfc1323=0
|
|
|
|
|
sysctl -w net.inet.tcp.rfc1644=0
|
1995-05-11 15:08:37 -04:00
|
|
|
fi
|
|
|
|
|
|
1995-04-10 21:22:24 -04:00
|
|
|
# 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}
|
1994-09-14 21:19:43 -04:00
|
|
|
fi
|
1995-04-10 21:22:24 -04:00
|
|
|
eval ifconfig_args=\$ifconfig_${ifn}
|
|
|
|
|
ifconfig ${ifn} ${ifconfig_args}
|
|
|
|
|
ifconfig ${ifn}
|
1994-09-14 21:19:43 -04:00
|
|
|
done
|
1993-06-20 09:41:45 -04:00
|
|
|
|
1994-09-14 21:19:43 -04:00
|
|
|
if [ -n "$defaultrouter" -a "x$defaultrouter" != "xNO" ] ; then
|
1995-05-17 00:46:57 -04:00
|
|
|
static_routes="default ${static_routes}"
|
|
|
|
|
route_default="default ${defaultrouter}"
|
1994-09-14 21:19:43 -04:00
|
|
|
fi
|
|
|
|
|
|
1995-05-17 00:46:57 -04:00
|
|
|
# Set up any static routes. This should be done before router discovery.
|
1996-02-10 23:07:27 -05:00
|
|
|
if [ "x${static_routes}" != "x" ]; then
|
1996-02-09 07:45:38 -05:00
|
|
|
for i in ${static_routes}; do
|
|
|
|
|
eval route_args=\$route_${i}
|
|
|
|
|
route add ${route_args}
|
|
|
|
|
done
|
|
|
|
|
fi
|
1995-03-28 22:28:08 -05:00
|
|
|
|
1995-08-25 03:18:04 -04:00
|
|
|
if [ "x$gateway" != "xNO" ]; then
|
1995-08-23 03:12:16 -04:00
|
|
|
echo 'configuring host as a gateway.'
|
1996-01-02 14:47:05 -05:00
|
|
|
sysctl -w net.inet.ip.forwarding=1 >/dev/null 2>&1
|
1995-08-23 03:12:16 -04:00
|
|
|
fi
|
|
|
|
|
|
1996-01-06 15:49:18 -05:00
|
|
|
if [ "x$router" != "xNO" ] ; then
|
1995-12-27 20:24:04 -05:00
|
|
|
echo -n starting routing daemon:
|
1996-01-07 23:50:18 -05:00
|
|
|
echo -n " ${router}"; ${router} ${routerflags}
|
1995-04-09 05:54:51 -04:00
|
|
|
echo '.'
|
1995-03-28 22:28:08 -05:00
|
|
|
fi
|