3 # $FreeBSD: src/etc/rc.d/network1,v 1.147 2003/06/06 13:00:43 mtm Exp $
4 # $DragonFly: src/etc/rc.d/Attic/network1,v 1.3 2004/09/18 07:16:32 asmodai Exp $
8 # REQUIRE: atm1 ipfilter mountcritlocal pccard serial sppp sysctl tty
9 # KEYWORD: DragonFly nostart
14 start_cmd="network_start"
15 stop_cmd="network_stop"
18 case ${gif_interfaces} in
22 for i in ${gif_interfaces}; do
23 eval peers=\$gifconfig_$i
29 ifconfig $i create >/dev/null 2>&1
30 ifconfig $i tunnel ${peers}
41 # set hostname, turn on network
43 echo -n "Doing initial network setup:"
45 # Set the host name if it is not already set
47 if [ -z "`hostname -s`" ]; then
52 # Set the domainname if we're using NIS
54 case ${nisdomainname} in
58 domainname ${nisdomainname}
65 # Attempt to create cloned interfaces.
66 for ifn in ${cloned_interfaces}; do
67 ifconfig ${ifn} create
73 # Set up all the network interfaces, calling startup scripts if needed
75 case ${network_interfaces} in
77 network_interfaces="`ifconfig -l`"
80 network_interfaces="${network_interfaces} ${cloned_interfaces}"
85 for ifn in ${network_interfaces}; do
86 if [ -r /etc/start_if.${ifn} ]; then
87 . /etc/start_if.${ifn}
91 # Do the primary ifconfig if specified
93 eval ifconfig_args=\$ifconfig_${ifn}
95 case ${ifconfig_args} in
99 # DHCP inits are done all in one go below
100 dhcp_interfaces="$dhcp_interfaces $ifn"
104 ifconfig ${ifn} ${ifconfig_args}
110 if [ ! -z "${dhcp_interfaces}" ]; then
111 ${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${dhcp_interfaces}
114 for ifn in ${network_interfaces}; do
115 # Check to see if aliases need to be added
119 eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
120 if [ -n "${ifconfig_args}" ]; then
121 ifconfig ${ifn} ${ifconfig_args} alias
123 alias=$((${alias} + 1))
129 # Do ipx address if specified
131 eval ifconfig_args=\$ifconfig_${ifn}_ipx
132 if [ -n "${ifconfig_args}" ]; then
133 ifconfig ${ifn} ${ifconfig_args}
138 # Display ifconfiged interfaces
139 for ifn in ${network_interfaces}; do
140 eval showstat=\$showstat_${ifn}
141 if [ ! -z ${showstat} ]; then
147 /etc/rc.d/ipfilter resync
152 echo -n "Stopping network:"
156 echo -n " flush routes"