Article Figure 1 Figure 2 Figure 3 Listing 1
Listing 2 Listing 3 Listing 4 Listing 5 Listing 6
Listing 7 Listing 8 Listing 9 Listing 10 Listing 11
Sidebar 1 Sidebar 2 Sidebar 3 Sidebar 4 Sidebar 5 Sidebar 6 Sidebar 7 jun96.tar

Listing 10: rc.internet

#!/bin/sh

IPFW="/sbin/ipfwadm"
ROOTHOME=/root
MODDIR=/usr/src/linux/modules

echo -n "Configuring Internet software "

if [ -x $IPFW ]; then
echo -n " firewall "
$IPFW -F -p deny
$IPFW -I -p deny
$IPFW -O -p deny

#
# Forwarding
#

if [ -x ${ROOTHOME}/add.forward ]; then
${ROOTHOME}/add.forward
fi

#
# Input
#

if [ -x ${ROOTHOME}/add.input ]; then
${ROOTHOME}/add.input
fi

#
# Output
#

if [ -x ${ROOTHOME}/add.output ]; then
${ROOTHOME}/add.output
fi

#
echo ""
fi

# Load modules now firewall is configured
# correctly

echo -n "Loading modules"

if [ -f ${MODDIR}/slhc.o ]; then
echo -n " slhc"
/sbin/insmod ${MODDIR}/slhc.o
fi

if [ -f ${MODDIR}/ppp.o ]; then
echo -n " ppp"
/sbin/insmod ${MODDIR}/ppp.o
fi

if [ -f ${MODDIR}/slip.o ]; then
echo -n " slip"
/sbin/insmod ${MODDIR}/slip.o
fi

# And finally, start the diald
if [ -x /etc/ppp/diald.start ]; then
echo "starting diald"
/etc/ppp/diald.start
fi

echo "Done"