1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00

Add rudimentry support for ifconfig'ing aliases at boot. Also allow

start_if.<if> to do all the work instead if so configured.  With examples.
This commit is contained in:
Peter Wemm 1996-10-27 06:30:43 +00:00
parent bc407914f9
commit 95e6becc12
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19203
2 changed files with 25 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $Id: netstart,v 1.43 1996/04/03 17:13:58 phk Exp $
# $Id: netstart,v 1.44 1996/04/06 09:24:48 mpp Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@ -43,8 +43,23 @@ for ifn in ${network_interfaces}; do
if [ -e /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn} ${ifn}
fi
# Do the primary ifconfig if specified
eval ifconfig_args=\$ifconfig_${ifn}
ifconfig ${ifn} ${ifconfig_args}
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
ifconfig ${ifn}
done

View File

@ -4,7 +4,7 @@
# This is sysconfig - a file full of useful variables that you can set
# to change the default startup behavior of your system.
#
# $Id: sysconfig,v 1.50 1996/09/09 00:17:14 ache Exp $
# $Id: sysconfig,v 1.51 1996/10/21 20:09:27 wpaul Exp $
######################### Start Of Local Configuration Section ###########
@ -107,6 +107,8 @@ weak_mountd_authentication=NO
#
# Set to the list of network devices on this host. You must have an
# ifconfig_${network_interface} line for each interface listed here.
# Extra addresses may be specified with sequentual _alias<N> lines.
#
# for example:
#
# network_interfaces="ed0 sl0 lo0"
@ -114,6 +116,11 @@ weak_mountd_authentication=NO
# ifconfig_ed0="inet 10.0.0.1 netmask 0xffffff00"
# ifconfig_sl0="inet 10.0.1.0 netmask 0xffffff00"
# ifconfig_lo0="inet localhost"
# ifconfig_ed0_alias0="inet 10.0.2.1 netmask 0xffffff00"
# ifconfig_ed0_alias1="inet 10.0.2.2 netmask 0xffffffff"
#
# Alternatively, /etc/start_if.${network_interface} is run if it exists.
# This script can be used as an alternative to the ifconfig_<xxx> lines.
#
network_interfaces="lo0"