netoptions revision 54458
125184Sjkh#!/bin/sh -
225184Sjkh#
350472Speter# $FreeBSD: head/etc/rc.d/netoptions 54458 1999-12-12 01:58:30Z obrien $
425184Sjkh#	From: @(#)netstart	5.9 (Berkeley) 3/30/91
525184Sjkh
651231Ssheldonh# Note that almost all of the user-configurable behavior is no longer in
751231Ssheldonh# this file, but rather in /etc/defaults/rc.conf.  Please check that file
825184Sjkh# first before contemplating any changes here.  If you do need to change
925184Sjkh# this file for some reason, we would like to know about it.
1025184Sjkh
1125184Sjkh# First pass startup stuff.
1251231Ssheldonh#
1325184Sjkhnetwork_pass1() {
1451231Ssheldonh	echo -n 'Doing initial network setup:'
1525184Sjkh
1651231Ssheldonh	# Set the host name if it is not already set
1751231Ssheldonh	#
1851231Ssheldonh	if [ -z "`hostname -s`" ]; then
1951231Ssheldonh		hostname ${hostname}
2051231Ssheldonh		echo -n ' hostname'
2151231Ssheldonh	fi
2225184Sjkh
2351231Ssheldonh	# Set the domainname if we're using NIS
2451231Ssheldonh	#
2551231Ssheldonh	case ${nisdomainname} in
2651231Ssheldonh	[Nn][Oo] | '')
2751231Ssheldonh		;;
2851231Ssheldonh	*)
2951231Ssheldonh		domainname ${nisdomainname}
3051231Ssheldonh		echo -n ' domain'
3151231Ssheldonh		;;
3251231Ssheldonh	esac
3340006Sphk
3451231Ssheldonh	echo '.'
3542621Shm
3651231Ssheldonh	# Initial ATM interface configuration
3751231Ssheldonh	#
3851231Ssheldonh	case ${atm_enable} in
3951231Ssheldonh	[Yy][Ee][Ss])
4051231Ssheldonh		if [ -r /etc/rc.atm ]; then
4151231Ssheldonh			. /etc/rc.atm
4251231Ssheldonh			atm_pass1
4351231Ssheldonh		fi
4451231Ssheldonh		;;
4551231Ssheldonh	esac
4642627Sjoerg
4751231Ssheldonh	# ISDN subsystem startup
4851231Ssheldonh	#
4951231Ssheldonh	case ${isdn_enable} in
5051231Ssheldonh	[Yy][Ee][Ss])
5151231Ssheldonh		if [ -r /etc/rc.isdn ]; then
5251231Ssheldonh			. /etc/rc.isdn
5351231Ssheldonh		fi
5451231Ssheldonh		;;
5551231Ssheldonh	esac
5629300Sdanny
5751231Ssheldonh	# Special options for sppp(4) interfaces go here.  These need
5851231Ssheldonh	# to go _before_ the general ifconfig section, since in the case
5951231Ssheldonh	# of hardwired (no link1 flag) but required authentication, you
6051231Ssheldonh	# cannot pass auth parameters down to the already running interface.
6151231Ssheldonh	#
6251231Ssheldonh	for ifn in ${sppp_interfaces}; do
6351231Ssheldonh		eval spppcontrol_args=\$spppconfig_${ifn}
6451231Ssheldonh		if [ -n "${spppcontrol_args}" ]; then
6551231Ssheldonh			# The auth secrets might contain spaces; in order
6651231Ssheldonh			# to retain the quotation, we need to eval them
6751231Ssheldonh			# here.
6851231Ssheldonh			eval spppcontrol ${ifn} ${spppcontrol_args}
6951231Ssheldonh		fi
7051231Ssheldonh	done
7149122Sbrian
7251231Ssheldonh	# Set up all the network interfaces, calling startup scripts if needed
7351231Ssheldonh	#
7451231Ssheldonh	case ${network_interfaces} in
7551231Ssheldonh	[Aa][Uu][Tt][Oo])
7651231Ssheldonh		network_interfaces="`ifconfig -l`"
7751231Ssheldonh		;;
7851231Ssheldonh	esac
7949122Sbrian
8054458Sobrien	dhcp_interfaces=""
8151231Ssheldonh	for ifn in ${network_interfaces}; do
8251231Ssheldonh		if [ -r /etc/start_if.${ifn} ]; then
8351231Ssheldonh			. /etc/start_if.${ifn}
8454458Sobrien			eval showstat_$ifn=1
8551231Ssheldonh		fi
8649122Sbrian
8751231Ssheldonh		# Do the primary ifconfig if specified
8851231Ssheldonh		#
8951231Ssheldonh		eval ifconfig_args=\$ifconfig_${ifn}
9029300Sdanny
9151231Ssheldonh		case ${ifconfig_args} in
9251231Ssheldonh		'')
9351231Ssheldonh			;;
9451231Ssheldonh		[Dd][Hh][Cc][Pp])
9554458Sobrien			# DHCP inits are done all in one go below
9654458Sobrien			dhcp_interfaces="$dhcp_interfaces $ifn"
9754458Sobrien			eval showstat_$ifn=1
9851231Ssheldonh			;;
9951231Ssheldonh		*)
10051231Ssheldonh			ifconfig ${ifn} ${ifconfig_args}
10154458Sobrien			eval showstat_$ifn=1
10251231Ssheldonh			;;
10351231Ssheldonh		esac
10454458Sobrien	done
10551231Ssheldonh
10654458Sobrien	if [ ! -z "${dhcp_interfaces}" ]; then
10754458Sobrien		${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${dhcp_interfaces}
10854458Sobrien	fi
10954458Sobrien
11054458Sobrien	for ifn in ${network_interfaces}; do
11151231Ssheldonh		# Check to see if aliases need to be added
11251231Ssheldonh		#
11351231Ssheldonh		alias=0
11451231Ssheldonh		while : ; do
11551231Ssheldonh			eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
11651231Ssheldonh			if [ -n "${ifconfig_args}" ]; then
11751231Ssheldonh				ifconfig ${ifn} ${ifconfig_args} alias
11854458Sobrien				eval showstat_$ifn=1
11951231Ssheldonh				alias=`expr ${alias} + 1`
12051231Ssheldonh			else
12151231Ssheldonh				break;
12251231Ssheldonh			fi
12351231Ssheldonh		done
12451231Ssheldonh
12551231Ssheldonh		# Do ipx address if specified
12651231Ssheldonh		#
12751231Ssheldonh		eval ifconfig_args=\$ifconfig_${ifn}_ipx
12851231Ssheldonh		if [ -n "${ifconfig_args}" ]; then
12951231Ssheldonh			ifconfig ${ifn} ${ifconfig_args}
13054458Sobrien			eval showstat_$ifn=1
13151231Ssheldonh		fi
13254458Sobrien	done
13351231Ssheldonh
13454458Sobrien	for ifn in ${network_interfaces}; do
13554458Sobrien		eval showstat=\$showstat_${ifn}
13654458Sobrien		if [ ! -z ${showstat} ]; then
13751231Ssheldonh			ifconfig ${ifn}
13854458Sobrien		fi
13951231Ssheldonh	done
14051231Ssheldonh
14151231Ssheldonh	# Warm up user ppp if required, must happen before natd.
14251231Ssheldonh	#
14351231Ssheldonh	case ${ppp_enable} in
14451231Ssheldonh	[Yy][Ee][Ss])
14551231Ssheldonh		# Establish ppp mode.
14651231Ssheldonh		#
14751231Ssheldonh		if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \
14851231Ssheldonh			-a "${ppp_mode}" != "dedicated" \
14951231Ssheldonh			-a "${ppp_mode}" != "background" ]; then
15051231Ssheldonh			ppp_mode="auto";
15151231Ssheldonh		fi
15251231Ssheldonh
15351231Ssheldonh		ppp_command="-${ppp_mode} ";
15451231Ssheldonh
15551231Ssheldonh		# Switch on alias mode?
15651231Ssheldonh		#
15751231Ssheldonh		case ${ppp_nat} in
15851231Ssheldonh		[Yy][Ee][Ss])
15951231Ssheldonh			ppp_command="${ppp_command} -nat";
16051231Ssheldonh			;;
16151231Ssheldonh		esac
16251231Ssheldonh
16351231Ssheldonh		echo -n 'Starting ppp: '; ppp ${ppp_command} -quiet ${ppp_profile}
16451231Ssheldonh		;;
16551231Ssheldonh	esac
16651231Ssheldonh
16751231Ssheldonh	# Initialize IP filtering using ipfw
16851231Ssheldonh	#
16951231Ssheldonh	echo ''
17051231Ssheldonh
17151231Ssheldonh	if /sbin/ipfw -q flush > /dev/null 2>&1; then
17251231Ssheldonh		firewall_in_kernel=1
17329300Sdanny	else
17451231Ssheldonh		firewall_in_kernel=0
17529300Sdanny	fi
17629300Sdanny
17751231Ssheldonh	case ${firewall_enable} in
17851231Ssheldonh	[Yy][Ee][Ss])
17951231Ssheldonh		if [ "${firewall_in_kernel}" -eq 0 ] && kldload ipfw; then
18051231Ssheldonh			firewall_in_kernel=1
18151231Ssheldonh			echo "Kernel firewall module loaded."
18251231Ssheldonh		elif [ "${firewall_in_kernel}" -eq 0 ]; then
18351231Ssheldonh			echo "Warning: firewall kernel module failed to load."
18451231Ssheldonh		fi
18551231Ssheldonh		;;
18651231Ssheldonh	esac
18744992Sbrian
18851231Ssheldonh	# Load the filters if required
18951231Ssheldonh	#
19051231Ssheldonh	case ${firewall_in_kernel} in
19151231Ssheldonh	1)
19251231Ssheldonh		if [ -z "${firewall_script}" ]; then
19351231Ssheldonh			firewall_script=/etc/rc.firewall
19444992Sbrian		fi
19551231Ssheldonh
19651231Ssheldonh		case ${firewall_enable} in
19751231Ssheldonh		[Yy][Ee][Ss])
19851426Sgreen			if [ -r "${firewall_script}" ]; then
19951426Sgreen				. "${firewall_script}"
20051231Ssheldonh				echo -n 'Firewall rules loaded, starting divert daemons:'
20151231Ssheldonh
20251231Ssheldonh				# Network Address Translation daemon
20351231Ssheldonh				#
20451231Ssheldonh				case ${natd_enable} in
20551231Ssheldonh				[Yy][Ee][Ss])
20651231Ssheldonh					if [ -n "${natd_interface}" ]; then
20751231Ssheldonh						if echo ${natd_interface} | \
20851231Ssheldonh							grep -q -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'; then
20951231Ssheldonh							natd_ifarg="-a ${natd_interface}"
21051231Ssheldonh						else
21151231Ssheldonh							natd_ifarg="-n ${natd_interface}"
21251231Ssheldonh						fi
21351231Ssheldonh
21451231Ssheldonh						echo -n ' natd'; ${natd_program:-/sbin/natd} ${natd_flags} ${natd_ifarg}
21551231Ssheldonh					fi
21651231Ssheldonh					;;
21751231Ssheldonh				esac
21851231Ssheldonh
21951231Ssheldonh				echo '.'
22051231Ssheldonh
22151231Ssheldonh			elif [ "`ipfw l 65535`" = "65535 deny ip from any to any" ]; then
22251231Ssheldonh				echo -n "Warning: kernel has firewall functionality, "
22351231Ssheldonh				echo "but firewall rules are not enabled."
22451231Ssheldonh				echo "		 All ip services are disabled."
22551231Ssheldonh			fi
22651231Ssheldonh			;;
22751231Ssheldonh		esac
22851231Ssheldonh		;;
22951231Ssheldonh	esac
23051231Ssheldonh
23151231Ssheldonh	# Additional ATM interface configuration
23251231Ssheldonh	#
23351231Ssheldonh	if [ -n "${atm_pass1_done}" ]; then
23451231Ssheldonh		atm_pass2
23529300Sdanny	fi
23625184Sjkh
23751231Ssheldonh	# Configure routing
23851231Ssheldonh	#
23951231Ssheldonh	case ${defaultrouter} in
24051231Ssheldonh	[Nn][Oo] | '')
24151231Ssheldonh		;;
24251231Ssheldonh	*)
24351231Ssheldonh		static_routes="default ${static_routes}"
24451231Ssheldonh		route_default="default ${defaultrouter}"
24551231Ssheldonh		;;
24651231Ssheldonh	esac
24740006Sphk
24851231Ssheldonh	# Set up any static routes.  This should be done before router discovery.
24951231Ssheldonh	#
25051231Ssheldonh	if [ -n "${static_routes}" ]; then
25151231Ssheldonh		for i in ${static_routes}; do
25251231Ssheldonh			eval route_args=\$route_${i}
25351231Ssheldonh			route add ${route_args}
25451231Ssheldonh		done
25551231Ssheldonh	fi
25629300Sdanny
25751231Ssheldonh	echo -n 'Additional routing options:'
25851231Ssheldonh	case ${tcp_extensions} in
25951231Ssheldonh	[Yy][Ee][Ss] | '')
26051231Ssheldonh		;;
26151231Ssheldonh	*)
26251231Ssheldonh		echo -n ' tcp extensions=NO'
26351231Ssheldonh		sysctl -w net.inet.tcp.rfc1323=0 >/dev/null
26451231Ssheldonh		;;
26551231Ssheldonh	esac
26625184Sjkh
26751231Ssheldonh	case ${icmp_bmcastecho} in
26851231Ssheldonh	[Yy][Ee][Ss])
26951231Ssheldonh		echo -n ' broadcast ping responses=YES'
27051231Ssheldonh		sysctl -w net.inet.icmp.bmcastecho=1 >/dev/null
27151231Ssheldonh		;;
27251231Ssheldonh	esac
27345096Simp
27451231Ssheldonh	case ${icmp_drop_redirect} in
27551231Ssheldonh	[Yy][Ee][Ss])
27651231Ssheldonh		echo -n ' ignore ICMP redirect=YES'
27751231Ssheldonh		sysctl -w net.inet.icmp.drop_redirect=1 >/dev/null
27851231Ssheldonh		;;
27951231Ssheldonh	esac
28039267Sjkoshy
28151231Ssheldonh	case ${icmp_log_redirect} in
28251231Ssheldonh	[Yy][Ee][Ss])
28351231Ssheldonh		echo -n ' log ICMP redirect=YES'
28451231Ssheldonh		sysctl -w net.inet.icmp.log_redirect=1 >/dev/null
28551231Ssheldonh		;;
28651231Ssheldonh	esac
28733439Sguido
28851231Ssheldonh	case ${gateway_enable} in
28951231Ssheldonh	[Yy][Ee][Ss])
29051231Ssheldonh		echo -n ' IP gateway=YES'
29151231Ssheldonh		sysctl -w net.inet.ip.forwarding=1 >/dev/null
29251231Ssheldonh		;;
29351231Ssheldonh	esac
29433439Sguido
29551231Ssheldonh	case ${forward_sourceroute} in
29651231Ssheldonh	[Yy][Ee][Ss])
29751231Ssheldonh		echo -n ' do source routing=YES'
29851231Ssheldonh		sysctl -w net.inet.ip.sourceroute=1 >/dev/null
29951231Ssheldonh		;;
30051231Ssheldonh	esac
30147752Sphk
30251231Ssheldonh	case ${accept_sourceroute} in
30351231Ssheldonh	[Yy][Ee][Ss])
30451231Ssheldonh		echo -n ' accept source routing=YES'
30551231Ssheldonh		sysctl -w net.inet.ip.accept_sourceroute=1 >/dev/null
30651231Ssheldonh		;;
30751231Ssheldonh	esac
30851209Sdes
30951231Ssheldonh	case ${tcp_keepalive} in
31051231Ssheldonh	[Yy][Ee][Ss])
31151231Ssheldonh		echo -n ' TCP keepalive=YES'
31251231Ssheldonh		sysctl -w net.inet.tcp.always_keepalive=1 >/dev/null
31351231Ssheldonh		;;
31451231Ssheldonh	esac
31551209Sdes
31651231Ssheldonh	case ${tcp_restrict_rst} in
31751231Ssheldonh	[Yy][Ee][Ss])
31851231Ssheldonh		echo -n ' restrict TCP reset=YES'
31951231Ssheldonh		sysctl -w net.inet.tcp.restrict_rst=1 >/dev/null
32051231Ssheldonh		;;
32151231Ssheldonh	esac
32236174Sjkh
32351231Ssheldonh	case ${tcp_drop_synfin} in
32451231Ssheldonh	[Yy][Ee][Ss])
32551231Ssheldonh		echo -n ' drop SYN+FIN packets=YES'
32651231Ssheldonh		sysctl -w net.inet.tcp.drop_synfin=1 >/dev/null
32751231Ssheldonh		;;
32851231Ssheldonh	esac
32936174Sjkh
33051231Ssheldonh	case ${ipxgateway_enable} in
33151231Ssheldonh	[Yy][Ee][Ss])
33251231Ssheldonh		echo -n ' IPX gateway=YES'
33351231Ssheldonh		sysctl -w net.ipx.ipx.ipxforwarding=1 >/dev/null
33451231Ssheldonh		;;
33551231Ssheldonh	esac
33651231Ssheldonh
33751231Ssheldonh	case ${arpproxy_all} in
33851231Ssheldonh	[Yy][Ee][Ss])
33951231Ssheldonh		echo -n ' ARP proxyall=YES'
34051231Ssheldonh		sysctl -w net.link.ether.inet.proxyall=1 >/dev/null
34151231Ssheldonh		;;
34251231Ssheldonh	esac
34351231Ssheldonh	echo '.'
34451231Ssheldonh
34551231Ssheldonh	echo -n 'routing daemons:'
34651231Ssheldonh	case ${router_enable} in
34751231Ssheldonh	[Yy][Ee][Ss])
34851231Ssheldonh		echo -n " ${router}";	${router} ${router_flags}
34951231Ssheldonh		;;
35051231Ssheldonh	esac
35151231Ssheldonh
35251231Ssheldonh	case ${ipxrouted_enable} in
35351231Ssheldonh	[Yy][Ee][Ss])
35451231Ssheldonh		echo -n ' IPXrouted'
35551231Ssheldonh		IPXrouted ${ipxrouted_flags} > /dev/null 2>&1
35651231Ssheldonh		;;
35751231Ssheldonh	esac
35851231Ssheldonh
35951231Ssheldonh	case ${mrouted_enable} in
36051231Ssheldonh	[Yy][Ee][Ss])
36151231Ssheldonh		echo -n ' mrouted';	mrouted ${mrouted_flags}
36251231Ssheldonh		;;
36351231Ssheldonh	esac
36451231Ssheldonh
36551231Ssheldonh	case ${rarpd_enable} in
36651231Ssheldonh	[Yy][Ee][Ss])
36751231Ssheldonh		echo -n ' rarpd';	rarpd ${rarpd_flags}
36851231Ssheldonh		;;
36951231Ssheldonh	esac
37051231Ssheldonh	echo '.'
37151231Ssheldonh
37251231Ssheldonh	# Let future generations know we made it.
37351231Ssheldonh	#
37451231Ssheldonh	network_pass1_done=YES
37525184Sjkh}
37625184Sjkh
37725184Sjkhnetwork_pass2() {
37851231Ssheldonh	echo -n 'Doing additional network setup:'
37951231Ssheldonh	case ${named_enable} in
38051231Ssheldonh	[Yy][Ee][Ss])
38151231Ssheldonh		echo -n ' named';	${named_program:-named} ${named_flags}
38251231Ssheldonh		;;
38351231Ssheldonh	esac
38425184Sjkh
38551231Ssheldonh	case ${ntpdate_enable} in
38651231Ssheldonh	[Yy][Ee][Ss])
38751231Ssheldonh		echo -n ' ntpdate'
38851231Ssheldonh		${ntpdate_program:-ntpdate} ${ntpdate_flags} >/dev/null 2>&1
38951231Ssheldonh		;;
39051231Ssheldonh	esac
39125184Sjkh
39251231Ssheldonh	case ${xntpd_enable} in
39351231Ssheldonh	[Yy][Ee][Ss])
39451231Ssheldonh		echo -n ' xntpd';	${xntpd_program:-xntpd} ${xntpd_flags}
39551231Ssheldonh		;;
39651231Ssheldonh	esac
39725184Sjkh
39851231Ssheldonh	case ${timed_enable} in
39951231Ssheldonh	[Yy][Ee][Ss])
40051231Ssheldonh		echo -n ' timed';	timed ${timed_flags}
40151231Ssheldonh		;;
40251231Ssheldonh	esac
40325184Sjkh
40451231Ssheldonh	case ${portmap_enable} in
40551231Ssheldonh	[Yy][Ee][Ss])
40651231Ssheldonh		echo -n ' portmap';	${portmap_program:-/usr/sbin/portmap} ${portmap_flags}
40751231Ssheldonh		;;
40851231Ssheldonh	esac
40925184Sjkh
41051231Ssheldonh	# Start ypserv if we're an NIS server.
41151231Ssheldonh	# Run rpc.ypxfrd and rpc.yppasswdd only on the NIS master server.
41251231Ssheldonh	#
41351231Ssheldonh	case ${nis_server_enable} in
41451231Ssheldonh	[Yy][Ee][Ss])
41551231Ssheldonh		echo -n ' ypserv'; ypserv ${nis_server_flags}
41625184Sjkh
41751231Ssheldonh		case ${nis_ypxfrd_enable} in
41851231Ssheldonh		[Yy][Ee][Ss])
41951231Ssheldonh			echo -n ' rpc.ypxfrd'
42051231Ssheldonh			rpc.ypxfrd ${nis_ypxfrd_flags}
42151231Ssheldonh			;;
42251231Ssheldonh		esac
42325184Sjkh
42451231Ssheldonh		case ${nis_yppasswdd_enable} in
42551231Ssheldonh		[Yy][Ee][Ss])
42651231Ssheldonh			echo -n ' rpc.yppasswdd'
42751231Ssheldonh			rpc.yppasswdd ${nis_yppasswdd_flags}
42851231Ssheldonh			;;
42951231Ssheldonh		esac
43051231Ssheldonh		;;
43151231Ssheldonh	esac
43235149Smarkm
43351231Ssheldonh	# Start ypbind if we're an NIS client
43451231Ssheldonh	#
43551231Ssheldonh	case ${nis_client_enable} in
43651231Ssheldonh	[Yy][Ee][Ss])
43751231Ssheldonh		echo -n ' ypbind'; ypbind ${nis_client_flags}
43851231Ssheldonh		case ${nis_ypset_enable} in
43951231Ssheldonh		[Yy][Ee][Ss])
44051231Ssheldonh			echo -n ' ypset';	ypset ${nis_ypset_flags}
44151231Ssheldonh			;;
44251231Ssheldonh		esac
44351231Ssheldonh		;;
44451231Ssheldonh	esac
44540006Sphk
44651231Ssheldonh	# Start keyserv if we are running Secure RPC
44751231Ssheldonh	#
44851231Ssheldonh	case ${keyserv_enable} in
44951231Ssheldonh	[Yy][Ee][Ss])
45051231Ssheldonh		echo -n ' keyserv';	keyserv ${keyserv_flags}
45151231Ssheldonh		;;
45251231Ssheldonh	esac
45351231Ssheldonh
45451231Ssheldonh	# Start ypupdated if we are running Secure RPC and we are NIS master
45551231Ssheldonh	#
45651231Ssheldonh	case ${rpc_ypupdated_enable} in
45751231Ssheldonh	[Yy][Ee][Ss])
45851231Ssheldonh		echo -n ' rpc.ypupdated';	rpc.ypupdated
45951231Ssheldonh		;;
46051231Ssheldonh	esac
46151231Ssheldonh
46251231Ssheldonh	# Start ATM daemons
46351231Ssheldonh	if [ -n "${atm_pass2_done}" ]; then
46451231Ssheldonh		atm_pass3
46551231Ssheldonh	fi
46651231Ssheldonh
46751231Ssheldonh	echo '.'
46851231Ssheldonh	network_pass2_done=YES
46925184Sjkh}
47025184Sjkh
47125184Sjkhnetwork_pass3() {
47251231Ssheldonh	echo -n 'Starting final network daemons:'
47325184Sjkh
47451231Ssheldonh	case ${nfs_server_enable} in
47551231Ssheldonh	[Yy][Ee][Ss])
47651231Ssheldonh		if [ -r /etc/exports ]; then
47751231Ssheldonh			echo -n ' mountd'
47851231Ssheldonh
47951231Ssheldonh			case ${weak_mountd_authentication} in
48051231Ssheldonh			[Yy][Ee][Ss])
48151231Ssheldonh				mountd_flags="-n"
48251231Ssheldonh				;;
48351231Ssheldonh			esac
48451231Ssheldonh
48551231Ssheldonh			mountd ${mountd_flags}
48651231Ssheldonh
48751231Ssheldonh			case ${nfs_reserved_port_only} in
48851231Ssheldonh			[Yy][Ee][Ss])
48951231Ssheldonh				echo -n ' NFS on reserved port only=YES'
49051231Ssheldonh				sysctl -w vfs.nfs.nfs_privport=1 >/dev/null
49151231Ssheldonh				;;
49251231Ssheldonh			esac
49351231Ssheldonh
49451231Ssheldonh			echo -n ' nfsd';	nfsd ${nfs_server_flags}
49551231Ssheldonh
49651231Ssheldonh			case ${rpc_lockd_enable} in
49751231Ssheldonh			[Yy][Ee][Ss])
49851231Ssheldonh				echo -n ' rpc.lockd';	rpc.lockd
49951231Ssheldonh				;;
50051231Ssheldonh			esac
50151231Ssheldonh
50251231Ssheldonh			case ${rpc_statd_enable} in
50351231Ssheldonh			[Yy][Ee][Ss])
50451231Ssheldonh				echo -n ' rpc.statd';	rpc.statd
50551231Ssheldonh				;;
50651231Ssheldonh			esac
50751231Ssheldonh		fi
50851231Ssheldonh		;;
50953158Sache	*)
51053158Sache		case ${single_mountd_enable} in
51153158Sache		[Yy][Ee][Ss])
51253158Sache			if [ -r /etc/exports ]; then
51353158Sache				echo -n ' mountd'
51453158Sache
51553158Sache				case ${weak_mountd_authentication} in
51653158Sache				[Yy][Ee][Ss])
51753158Sache					mountd_flags="-n"
51853158Sache					;;
51953158Sache				esac
52053158Sache
52153158Sache				mountd ${mountd_flags}
52253158Sache			fi
52353158Sache			;;
52453158Sache		esac
52553158Sache		;;
52651231Ssheldonh	esac
52751231Ssheldonh
52851231Ssheldonh	case ${nfs_client_enable} in
52951231Ssheldonh	[Yy][Ee][Ss])
53051231Ssheldonh		echo -n ' nfsiod';	nfsiod ${nfs_client_flags}
53151231Ssheldonh		if [ -n "${nfs_access_cache}" ]; then
53247755Sbde		echo -n " NFS access cache time=${nfs_access_cache}"
53341371Sjkoshy		sysctl -w vfs.nfs.access_cache_timeout=${nfs_access_cache} \
53451231Ssheldonh			>/dev/null
53551231Ssheldonh		fi
53651231Ssheldonh		;;
53751231Ssheldonh	esac
53825184Sjkh
53951231Ssheldonh	case ${amd_enable} in
54051231Ssheldonh	[Yy][Ee][Ss])
54151231Ssheldonh		echo -n ' amd'
54251231Ssheldonh		case ${amd_map_program} in
54351231Ssheldonh		[Nn][Oo] | '')
54451231Ssheldonh			;;
54551231Ssheldonh		*)
54651231Ssheldonh			amd_flags="${amd_flags} `eval ${amd_map_program}`"
54751231Ssheldonh			;;
54851231Ssheldonh		esac
54925184Sjkh
55051231Ssheldonh		if [ -n "${amd_flags}" ]; then
55151231Ssheldonh			amd -p ${amd_flags} > /var/run/amd.pid 2> /dev/null
55251231Ssheldonh		else
55351231Ssheldonh			amd 2> /dev/null
55451231Ssheldonh		fi
55551231Ssheldonh		;;
55651231Ssheldonh	esac
55725184Sjkh
55851231Ssheldonh	case ${rwhod_enable} in
55951231Ssheldonh	[Yy][Ee][Ss])
56051231Ssheldonh		echo -n ' rwhod';	rwhod ${rwhod_flags}
56151231Ssheldonh		;;
56251231Ssheldonh	esac
56351231Ssheldonh
56451231Ssheldonh	# Kerberos runs ONLY on the Kerberos server machine
56551231Ssheldonh	case ${kerberos_server_enable} in
56651231Ssheldonh	[Yy][Ee][Ss])
56751231Ssheldonh		case ${kerberos_stash} in
56851231Ssheldonh		[Yy][Ee][Ss])
56951231Ssheldonh			stash_flag=-n
57051231Ssheldonh			;;
57151231Ssheldonh		*)
57251231Ssheldonh			stash_flag=
57351231Ssheldonh			;;
57451231Ssheldonh		esac
57551231Ssheldonh
57651231Ssheldonh		echo -n ' kerberos'
57738316Sphk		kerberos ${stash_flag} >> /var/log/kerberos.log &
57851231Ssheldonh
57951231Ssheldonh		case ${kadmind_server_enable} in
58051231Ssheldonh		[Yy][Ee][Ss])
58151231Ssheldonh			echo -n ' kadmind'
58251231Ssheldonh			(sleep 20; kadmind ${stash_flag} >/dev/null 2>&1 &) &
58351231Ssheldonh			;;
58451231Ssheldonh		esac
58551231Ssheldonh		unset stash_flag
58651231Ssheldonh		;;
58751231Ssheldonh	esac
58851231Ssheldonh
58953611Sbrian	case ${pppoed_enable} in
59053611Sbrian	[Yy][Ee][Ss])
59153613Sbrian		if [ -n "${pppoed_provider}" ]; then
59253611Sbrian			pppoed_flags="${pppoed_flags} -p ${pppoed_provider}"
59353611Sbrian		fi
59453611Sbrian		echo -n ' pppoed';
59553611Sbrian		/usr/libexec/pppoed ${pppoed_flags} ${pppoed_interface}
59653611Sbrian		;;
59753611Sbrian	esac
59853611Sbrian
59951231Ssheldonh	echo '.'
60051231Ssheldonh	network_pass3_done=YES
60125184Sjkh}
60253314Sache
60353314Sachenetwork_pass4() {
60453314Sache	echo -n 'Additional TCP options:'
60553314Sache	case ${log_in_vain} in
60653314Sache	[Nn][Oo] | '')
60753314Sache		;;
60853314Sache	*)
60953314Sache		echo -n ' log_in_vain=YES'
61053314Sache		sysctl -w net.inet.tcp.log_in_vain=1 >/dev/null
61153314Sache		sysctl -w net.inet.udp.log_in_vain=1 >/dev/null
61253314Sache		;;
61353314Sache	esac
61453314Sache
61553314Sache	echo '.'
61653314Sache	network_pass4_done=YES
61753314Sache}
618