# -*-sh-*-
#
# POSTROUTING (SNAT) chain for scipfire 
#
# $Id: POSTROUTING,v 1.2 2001/07/29 21:23:35 scip Exp $



#
# The name of this chain
CHAIN=POSTROUTING


#
# get the type of mode we are running under
# will be one of: start | startlog | print | stop
MODE=$1


#
# get the base path
PREFIX=$2


#
# source the config
. $PREFIX/conf/scipfire.cfg



#
# now $MODE is only start or stop!
case $MODE in
  "start")
    echo "  Initialize $CHAIN"
    #
    # initialize this chain

    # flush possibly existing rules(for restart|reload!)
    $echo $iptables -t nat -F $CHAIN

    $fw -t nat -s $NAT_NET -o $EX_INT -j SNAT --to-source $EX_ME
    
    ;;
  "stop")
    echo "  Resetting $CHAIN"
    #
    # zero and delete this chain
    $iptables -t nat -F $CHAIN
    ;;
esac
