1993-06-20 14:41:45 +01:00
|
|
|
#!/bin/sh -
|
|
|
|
#
|
1997-02-23 09:21:14 +00:00
|
|
|
# $Id$
|
1993-11-07 01:19:06 +00:00
|
|
|
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
|
1993-06-20 14:41:45 +01:00
|
|
|
|
1995-05-11 22:11:17 +01: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 05:46:57 +01: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 22:11:17 +01:00
|
|
|
|
1995-04-11 02:22:24 +01: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 23:50:54 +00:00
|
|
|
if [ -z "`hostname -s`" ] ; then
|
|
|
|
hostname $hostname
|
|
|
|
fi
|
1993-07-19 20:14:45 +01:00
|
|
|
|
1995-02-03 23:54:07 +00:00
|
|
|
# Set the domainname if we're using NIS
|
1995-04-25 00:52:16 +01:00
|
|
|
if [ -n "$defaultdomainname" -a "x$defaultdomainname" != "xNO" ] ; then
|
|
|
|
domainname $defaultdomainname
|
1995-02-03 23:54:07 +00:00
|
|
|
fi
|
|
|
|
|
1996-04-03 18:13:59 +01:00
|
|
|
# If IP filtering
|
1996-04-06 10:24:48 +01:00
|
|
|
if [ -n "$firewall" -a "x$firewall" != "xNO" -a -f /etc/rc.firewall ] ; then
|
1996-04-03 18:13:59 +01:00
|
|
|
sh /etc/rc.firewall
|
|
|
|
fi
|
|
|
|
|
1995-05-11 20:08:37 +01:00
|
|
|
#
|
|
|
|
# XXX This is known to cause an error if /usr is nfs mounted since it
|
1996-01-31 15:03:18 +00:00
|
|
|
# will not be available until after the network is up :-(. Once the
|
1995-05-11 20:08:37 +01: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 10:35:56 +01:00
|
|
|
sysctl -w net.inet.tcp.rfc1323=0
|
|
|
|
sysctl -w net.inet.tcp.rfc1644=0
|
1995-05-11 20:08:37 +01:00
|
|
|
fi
|
|
|
|
|
1995-04-11 02:22:24 +01: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-15 02:19:43 +01:00
|
|
|
fi
|
1996-10-27 06:30:43 +00:00
|
|
|
# Do the primary ifconfig if specified
|
1995-04-11 02:22:24 +01:00
|
|
|
eval ifconfig_args=\$ifconfig_${ifn}
|
1996-10-27 06:30:43 +00:00
|
|
|
if [ -n "${ifconfig_args}" ] ; then
|
|
|
|
ifconfig ${ifn} ${ifconfig_args}
|
|
|
|
fi
|
|
|
|
# Check to see if aliases need to be added
|
|
|
|
alias=0
|
|
|
|
while :
|
|
|
|
do
|
|
|
|
eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
|
|
|
|
if [ -n "${ifconfig_args}" ]; then
|
|
|
|
ifconfig ${ifn} ${ifconfig_args} alias
|
|
|
|
alias=`expr ${alias} + 1`
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
fi
|
|
|
|
done
|
1996-11-05 20:10:37 +00:00
|
|
|
# Do ipx address if specified
|
|
|
|
eval ifconfig_args=\$ifconfig_${ifn}_ipx
|
|
|
|
if [ -n "${ifconfig_args}" ]; then
|
|
|
|
ifconfig ${ifn} ${ifconfig_args}
|
|
|
|
fi
|
1995-04-11 02:22:24 +01:00
|
|
|
ifconfig ${ifn}
|
1994-09-15 02:19:43 +01:00
|
|
|
done
|
1993-06-20 14:41:45 +01:00
|
|
|
|
1994-09-15 02:19:43 +01:00
|
|
|
if [ -n "$defaultrouter" -a "x$defaultrouter" != "xNO" ] ; then
|
1995-05-17 05:46:57 +01:00
|
|
|
static_routes="default ${static_routes}"
|
|
|
|
route_default="default ${defaultrouter}"
|
1994-09-15 02:19:43 +01:00
|
|
|
fi
|
|
|
|
|
1995-05-17 05:46:57 +01:00
|
|
|
# Set up any static routes. This should be done before router discovery.
|
1996-02-11 04:07:27 +00:00
|
|
|
if [ "x${static_routes}" != "x" ]; then
|
1996-02-09 12:45:38 +00:00
|
|
|
for i in ${static_routes}; do
|
|
|
|
eval route_args=\$route_${i}
|
|
|
|
route add ${route_args}
|
|
|
|
done
|
|
|
|
fi
|
1995-03-29 04:28:08 +01:00
|
|
|
|
1995-08-25 08:18:04 +01:00
|
|
|
if [ "x$gateway" != "xNO" ]; then
|
1995-08-23 08:12:16 +01:00
|
|
|
echo 'configuring host as a gateway.'
|
1996-01-02 19:47:05 +00:00
|
|
|
sysctl -w net.inet.ip.forwarding=1 >/dev/null 2>&1
|
1995-08-23 08:12:16 +01:00
|
|
|
fi
|
|
|
|
|
1996-01-06 20:49:18 +00:00
|
|
|
if [ "x$router" != "xNO" ] ; then
|
1995-12-28 01:24:04 +00:00
|
|
|
echo -n starting routing daemon:
|
1996-01-08 04:50:18 +00:00
|
|
|
echo -n " ${router}"; ${router} ${routerflags}
|
1995-04-09 10:54:51 +01:00
|
|
|
echo '.'
|
1995-03-29 04:28:08 +01:00
|
|
|
fi
|
1996-11-05 20:10:37 +00:00
|
|
|
|
|
|
|
if [ "x$ipxgateway" != "xNO" ]; then
|
|
|
|
echo 'configuring host as an ipx gateway.'
|
|
|
|
sysctl -w net.ipx.ipx.ipxforwarding=1 >/dev/null 2>&1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "x$ipxrouted" != "xNO" ] ; then
|
|
|
|
echo -n "starting IPXrouted"; IPXrouted ${ipxrouted}
|
|
|
|
echo '.'
|
|
|
|
fi
|