Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / release / picobsd / mfs_tree / etc / rc.network
1 #!/bin/sh -
2 # $FreeBSD: src/release/picobsd/mfs_tree/etc/rc.network,v 1.1.2.3 2002/03/08 12:34:57 luigi Exp $
3 # $DragonFly: src/release/picobsd/mfs_tree/etc/Attic/rc.network,v 1.2 2003/06/17 04:27:20 dillon Exp $
4
5 network_pass1() {
6     echo -n 'Doing initial network setup:'
7     # Set the host name if it is not already set
8     if [ -z "`hostname -s`" ] ; then
9         hostname $hostname
10         echo ' hostname'
11     fi
12     # Set up all the network interfaces, calling startup scripts if needed
13     for ifn in ${network_interfaces}; do
14         [ -e /etc/start_if.${ifn} ] && . /etc/start_if.${ifn}
15         # Do the primary ifconfig if specified
16         eval ifconfig_args=\$ifconfig_${ifn}
17         [ -n "${ifconfig_args}" ] && ifconfig ${ifn} ${ifconfig_args}
18         # Check to see if aliases need to be added
19         alias=0
20         while :
21         do
22             eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
23             if [ -n "${ifconfig_args}" ]; then
24                 ifconfig ${ifn} ${ifconfig_args} alias
25                 alias=$((${alias} + 1))
26             else
27                 break;
28             fi
29         done
30         ifconfig ${ifn}
31     done
32     # Load the filters if required
33     if [ -f /etc/rc.firewall -a "${firewall_enable}" = "YES" ] ; then
34         # Set quiet mode if requested
35         if [ "${firewall_quiet}" = "YES" ]; then
36             fwcmd="/sbin/ipfw -q"
37         else
38             fwcmd="/sbin/ipfw"
39         fi
40         $fwcmd -f flush # Flush out the list before we begin.
41
42         . /etc/rc.firewall
43         echo "Firewall rules loaded."
44     else
45         echo "Warning: kernel has firewall functionality, but firewall rules weren't loaded."
46         echo "         All ip services are ENABLED by default."
47     fi
48     # Configure routing
49     if [ "x$defaultrouter" != "xNO" ] ; then
50         static_routes="default ${static_routes}"
51         route_default="default ${defaultrouter}"
52     fi
53     # Set up any static routes.  This should be done before router discovery.
54     if [ "x${static_routes}" != "x" ]; then
55         for i in ${static_routes}; do
56             eval route_args=\$route_${i}
57             route add ${route_args}
58         done
59     fi
60     echo -n 'Additional routing options:'
61     if [ -n "$tcp_extensions" -a "x$tcp_extensions" != "xYES" ] ; then
62         echo -n ' tcp_extensions=NO'
63         sysctl -w net.inet.tcp.rfc1323=0 >/dev/null 2>&1
64         sysctl -w net.inet.tcp.rfc1644=0 >/dev/null 2>&1
65     fi
66     if [ "X$gateway_enable" = X"YES" ]; then
67         echo -n ' IP_gateway=YES'
68         sysctl -w net.inet.ip.forwarding=1 >/dev/null 2>&1
69     fi
70     if [ "X$arpproxy_all" = X"YES" ]; then
71         echo -n ' turning on ARP_PROXY_ALL: '
72         sysctl -w net.link.ether.inet.proxyall=1 2>&1
73     fi
74     echo '.'
75     network_pass1_done=YES      # Let future generations know we made it.
76 }
77
78 network_pass2() {
79     network_pass2_done=YES
80 }
81
82 network_pass3() {
83     network_pass3_done=YES
84 }