diff options
author | peter <peter@FreeBSD.org> | 1999-07-07 12:49:47 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-07-07 12:49:47 +0000 |
commit | cc2ae796a663ae5b86f355397761449afad634b8 (patch) | |
tree | 2eb20bcdc6afcbb17f1e97936fe5c91d10c06a64 /etc | |
parent | 7c5b307ede57b5ff838abc0e5a4becdf9b9e5368 (diff) | |
download | FreeBSD-src-cc2ae796a663ae5b86f355397761449afad634b8.zip FreeBSD-src-cc2ae796a663ae5b86f355397761449afad634b8.tar.gz |
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.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/defaults/rc.conf | 3 | ||||
-rw-r--r-- | etc/network.subr | 15 | ||||
-rw-r--r-- | etc/rc.d/netoptions | 15 | ||||
-rw-r--r-- | etc/rc.d/network1 | 15 | ||||
-rw-r--r-- | etc/rc.d/network2 | 15 | ||||
-rw-r--r-- | etc/rc.d/network3 | 15 | ||||
-rw-r--r-- | etc/rc.d/routing | 15 | ||||
-rw-r--r-- | etc/rc.network | 15 |
8 files changed, 85 insertions, 23 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index 261b4c0..2dc8fb5 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -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. # diff --git a/etc/network.subr b/etc/network.subr index 0a40acc..5f49696 100644 --- a/etc/network.subr +++ b/etc/network.subr @@ -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 diff --git a/etc/rc.d/netoptions b/etc/rc.d/netoptions index 0a40acc..5f49696 100644 --- a/etc/rc.d/netoptions +++ b/etc/rc.d/netoptions @@ -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 diff --git a/etc/rc.d/network1 b/etc/rc.d/network1 index 0a40acc..5f49696 100644 --- a/etc/rc.d/network1 +++ b/etc/rc.d/network1 @@ -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 diff --git a/etc/rc.d/network2 b/etc/rc.d/network2 index 0a40acc..5f49696 100644 --- a/etc/rc.d/network2 +++ b/etc/rc.d/network2 @@ -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 diff --git a/etc/rc.d/network3 b/etc/rc.d/network3 index 0a40acc..5f49696 100644 --- a/etc/rc.d/network3 +++ b/etc/rc.d/network3 @@ -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 diff --git a/etc/rc.d/routing b/etc/rc.d/routing index 0a40acc..5f49696 100644 --- a/etc/rc.d/routing +++ b/etc/rc.d/routing @@ -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 diff --git a/etc/rc.network b/etc/rc.network index 0a40acc..5f49696 100644 --- a/etc/rc.network +++ b/etc/rc.network @@ -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 |