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 7: add.forward

#!/bin/sh

IPFW="/sbin/ipfwadm"

# Assume eth0 is our trusted interface
TRUSTIF=`/sbin/ifconfig eth0|sed -n -e "s/^[     ]*inet addr\:\([0-
9\.]*\).*$/\1/p"`

if [ -x $IPFW ]; then
# Add forwarding rules for nameserver
$IPFW -F -a masquerade -P udp -V $TRUSTIF -S 193.78.174.34 53 -D 0.0.0.0/0 53

# Add forwarding rules for clients
$IPFW -F -a masquerade -P tcp -V $TRUSTIF -S 193.78.174.34 -D 0.0.0.0/0
$IPFW -F -a masquerade -P tcp -V $TRUSTIF -S 193.78.174.35 -D 0.0.0.0/0
fi