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"
|