Cover V05, I06
Article
Figure 1
Figure 2
Figure 3
Listing 1
Listing 10
Listing 11
Listing 2
Listing 3
Listing 4
Listing 5
Listing 6
Listing 7
Listing 8
Listing 9
Sidebar 1
Sidebar 2
Sidebar 3
Sidebar 4
Sidebar 5
Sidebar 6
Sidebar 7

jun96.tar


Listing 6: add.input

#!/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 input rule for nameserver -> me
$IPFW -I -a accept -P udp -V $TRUSTIF -S 193.78.174.34 53 -D 193.78.174.33

# Add input rule for Internet -> nameserver (masqueraded)
$IPFW -I -a accept -P udp -S 0.0.0.0/0 53 -D 194.109.13.150

# Add input rule for nameserver -> Internet (will masquerade)
$IPFW -I -a accept -P udp -V $TRUSTIF -S 193.78.174.34 53 -D 0.0.0.0/0 53

# Add input rule for Internet -> me for mail (stops at firewall)
$IPFW -I -a accept -P tcp -S 0.0.0.0/0 -D 194.109.13.150 25

# Add input rule for Internet -> me for FTP data connection (masqueraded)
$IPFW -I -a accept -P tcp -S 0.0.0.0/0 20 -D 194.109.13.150 1024:65535

# Add input rule for Internet -> local (masqueraded)
$IPFW -I -a accept -P tcp -k -S 0.0.0.0/0 -D 194.109.13.150

# Add input rules for clients -> Internet (will masquerade)
$IPFW -I -a accept -P tcp -V $TRUSTIF -S 193.78.174.34 -D 0.0.0.0/0
$IPFW -I -a accept -P tcp -V $TRUSTIF -S 193.78.174.35 -D 0.0.0.0/0
fi