Do away with ${network_interfaces} in rc.conf. Just use ifconfig -l to

get a list of interfaces, and then automatically configure them if
${ifconfig_${ifn}} or /etc/start_if.${ifn} exists.

This makes it a lot easier to deal with machines that constantly change
their network configuration as you can leave ifconfig settings for all
the possible cards - just the ones that are present will be configured.
This commit is contained in:
Peter Wemm 1999-07-07 12:49:47 +00:00
parent c65e877457
commit 9c65a84aea
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=48662
8 changed files with 85 additions and 23 deletions

View File

@ -9,7 +9,7 @@
#
# All arguments must be in double or single quotes.
#
# $Id: rc.conf,v 1.14 1999/07/04 14:41:20 hosokawa Exp $
# $Id: rc.conf,v 1.15 1999/07/07 01:19:15 hosokawa Exp $
##############################################################
### Important initial Boot-time options ####################
@ -44,7 +44,6 @@ natd_flags="" # Additional flags for natd.
tcp_extensions="NO" # Set to Yes to turn on RFC1323 extensions.
log_in_vain="NO" # Disallow bad connection logging (or YES).
tcp_keepalive="YES" # Kill dead TCP connections (or NO).
network_interfaces="lo0" # List of network interfaces (lo0 is loopback).
ifconfig_lo0="inet 127.0.0.1" # default loopback device configuration.
#ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry.
#

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $Id: rc.network,v 1.46 1999/06/05 12:06:19 bde Exp $
# $Id: rc.network,v 1.47 1999/06/08 13:00:30 brian Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@ -51,14 +51,18 @@ network_pass1() {
done
# Set up all the network interfaces, calling startup scripts if needed
for ifn in ${network_interfaces}; do
interfaces="`ifconfig -l`"
for ifn in ${interfaces}; do
showstat=false
if [ -e /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn}
showstat=true
fi
# Do the primary ifconfig if specified
eval ifconfig_args=\$ifconfig_${ifn}
if [ -n "${ifconfig_args}" ] ; then
ifconfig ${ifn} ${ifconfig_args}
showstat=true
fi
# Check to see if aliases need to be added
alias=0
@ -67,6 +71,7 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args} alias
showstat=true
alias=`expr ${alias} + 1`
else
break;
@ -76,8 +81,12 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_ipx
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args}
showstat=true
fi
if [ "${showstat}" = "true" ]
then
ifconfig ${ifn}
fi
ifconfig ${ifn}
done
# Initialize IP filtering using ipfw

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $Id: rc.network,v 1.46 1999/06/05 12:06:19 bde Exp $
# $Id: rc.network,v 1.47 1999/06/08 13:00:30 brian Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@ -51,14 +51,18 @@ network_pass1() {
done
# Set up all the network interfaces, calling startup scripts if needed
for ifn in ${network_interfaces}; do
interfaces="`ifconfig -l`"
for ifn in ${interfaces}; do
showstat=false
if [ -e /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn}
showstat=true
fi
# Do the primary ifconfig if specified
eval ifconfig_args=\$ifconfig_${ifn}
if [ -n "${ifconfig_args}" ] ; then
ifconfig ${ifn} ${ifconfig_args}
showstat=true
fi
# Check to see if aliases need to be added
alias=0
@ -67,6 +71,7 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args} alias
showstat=true
alias=`expr ${alias} + 1`
else
break;
@ -76,8 +81,12 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_ipx
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args}
showstat=true
fi
if [ "${showstat}" = "true" ]
then
ifconfig ${ifn}
fi
ifconfig ${ifn}
done
# Initialize IP filtering using ipfw

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $Id: rc.network,v 1.46 1999/06/05 12:06:19 bde Exp $
# $Id: rc.network,v 1.47 1999/06/08 13:00:30 brian Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@ -51,14 +51,18 @@ network_pass1() {
done
# Set up all the network interfaces, calling startup scripts if needed
for ifn in ${network_interfaces}; do
interfaces="`ifconfig -l`"
for ifn in ${interfaces}; do
showstat=false
if [ -e /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn}
showstat=true
fi
# Do the primary ifconfig if specified
eval ifconfig_args=\$ifconfig_${ifn}
if [ -n "${ifconfig_args}" ] ; then
ifconfig ${ifn} ${ifconfig_args}
showstat=true
fi
# Check to see if aliases need to be added
alias=0
@ -67,6 +71,7 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args} alias
showstat=true
alias=`expr ${alias} + 1`
else
break;
@ -76,8 +81,12 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_ipx
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args}
showstat=true
fi
if [ "${showstat}" = "true" ]
then
ifconfig ${ifn}
fi
ifconfig ${ifn}
done
# Initialize IP filtering using ipfw

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $Id: rc.network,v 1.46 1999/06/05 12:06:19 bde Exp $
# $Id: rc.network,v 1.47 1999/06/08 13:00:30 brian Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@ -51,14 +51,18 @@ network_pass1() {
done
# Set up all the network interfaces, calling startup scripts if needed
for ifn in ${network_interfaces}; do
interfaces="`ifconfig -l`"
for ifn in ${interfaces}; do
showstat=false
if [ -e /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn}
showstat=true
fi
# Do the primary ifconfig if specified
eval ifconfig_args=\$ifconfig_${ifn}
if [ -n "${ifconfig_args}" ] ; then
ifconfig ${ifn} ${ifconfig_args}
showstat=true
fi
# Check to see if aliases need to be added
alias=0
@ -67,6 +71,7 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args} alias
showstat=true
alias=`expr ${alias} + 1`
else
break;
@ -76,8 +81,12 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_ipx
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args}
showstat=true
fi
if [ "${showstat}" = "true" ]
then
ifconfig ${ifn}
fi
ifconfig ${ifn}
done
# Initialize IP filtering using ipfw

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $Id: rc.network,v 1.46 1999/06/05 12:06:19 bde Exp $
# $Id: rc.network,v 1.47 1999/06/08 13:00:30 brian Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@ -51,14 +51,18 @@ network_pass1() {
done
# Set up all the network interfaces, calling startup scripts if needed
for ifn in ${network_interfaces}; do
interfaces="`ifconfig -l`"
for ifn in ${interfaces}; do
showstat=false
if [ -e /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn}
showstat=true
fi
# Do the primary ifconfig if specified
eval ifconfig_args=\$ifconfig_${ifn}
if [ -n "${ifconfig_args}" ] ; then
ifconfig ${ifn} ${ifconfig_args}
showstat=true
fi
# Check to see if aliases need to be added
alias=0
@ -67,6 +71,7 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args} alias
showstat=true
alias=`expr ${alias} + 1`
else
break;
@ -76,8 +81,12 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_ipx
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args}
showstat=true
fi
if [ "${showstat}" = "true" ]
then
ifconfig ${ifn}
fi
ifconfig ${ifn}
done
# Initialize IP filtering using ipfw

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $Id: rc.network,v 1.46 1999/06/05 12:06:19 bde Exp $
# $Id: rc.network,v 1.47 1999/06/08 13:00:30 brian Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@ -51,14 +51,18 @@ network_pass1() {
done
# Set up all the network interfaces, calling startup scripts if needed
for ifn in ${network_interfaces}; do
interfaces="`ifconfig -l`"
for ifn in ${interfaces}; do
showstat=false
if [ -e /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn}
showstat=true
fi
# Do the primary ifconfig if specified
eval ifconfig_args=\$ifconfig_${ifn}
if [ -n "${ifconfig_args}" ] ; then
ifconfig ${ifn} ${ifconfig_args}
showstat=true
fi
# Check to see if aliases need to be added
alias=0
@ -67,6 +71,7 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args} alias
showstat=true
alias=`expr ${alias} + 1`
else
break;
@ -76,8 +81,12 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_ipx
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args}
showstat=true
fi
if [ "${showstat}" = "true" ]
then
ifconfig ${ifn}
fi
ifconfig ${ifn}
done
# Initialize IP filtering using ipfw

View File

@ -1,6 +1,6 @@
#!/bin/sh -
#
# $Id: rc.network,v 1.46 1999/06/05 12:06:19 bde Exp $
# $Id: rc.network,v 1.47 1999/06/08 13:00:30 brian Exp $
# From: @(#)netstart 5.9 (Berkeley) 3/30/91
# Note that almost all the user-configurable behavior is no longer in
@ -51,14 +51,18 @@ network_pass1() {
done
# Set up all the network interfaces, calling startup scripts if needed
for ifn in ${network_interfaces}; do
interfaces="`ifconfig -l`"
for ifn in ${interfaces}; do
showstat=false
if [ -e /etc/start_if.${ifn} ]; then
. /etc/start_if.${ifn}
showstat=true
fi
# Do the primary ifconfig if specified
eval ifconfig_args=\$ifconfig_${ifn}
if [ -n "${ifconfig_args}" ] ; then
ifconfig ${ifn} ${ifconfig_args}
showstat=true
fi
# Check to see if aliases need to be added
alias=0
@ -67,6 +71,7 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args} alias
showstat=true
alias=`expr ${alias} + 1`
else
break;
@ -76,8 +81,12 @@ network_pass1() {
eval ifconfig_args=\$ifconfig_${ifn}_ipx
if [ -n "${ifconfig_args}" ]; then
ifconfig ${ifn} ${ifconfig_args}
showstat=true
fi
if [ "${showstat}" = "true" ]
then
ifconfig ${ifn}
fi
ifconfig ${ifn}
done
# Initialize IP filtering using ipfw