
#-----------------------------------------------------------------------
# Copyright (C) 2000-2001, Jean-Sebastien Morisset <jsmoriss@mvlan.net>
#-----------------------------------------------------------------------
# $Id: dmz_networks_chains.sh,v 1.5 2001/08/11 17:01:20 jsmoriss Exp $
#-----------------------------------------------------------------------
#  $RCSfile: dmz_networks_chains.sh,v $
#   $Author: jsmoriss $
# $Revision: 1.5 $
#     $Date: 2001/08/11 17:01:20 $
#   $Locker:  $ 
#     $Name:  $
#-----------------------------------------------------------------------
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by 
# the Free Software Foundation <http://www.gnu.org/copyleft/gpl.txt>.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License (LICENSE file in archive) for more details.
#
#-----------------------------------------------------------------------
# README
#-----------------------------------------------------------------------
#
# A bourne shell function used by rcf; a very secure, fast, and complete
# firewall for linux <http://jsmoriss.mvlan.net/linux/rcf.html>.
#
#-----------------------------------------------------------------------
# FUNCTION
#-----------------------------------------------------------------------

DMZ_Networks_Chains () {

	echo "Creating DMZ Networks Chains and Adding Accept Rules"

	if [ ! "$REFRESH_INTERFACES" ]
	then
		ipchains -N dmzi
		ipchains -N dmzo
	else
		ipchains -F dmzi
		ipchains -F dmzo
	fi

	for DMZ in $DMZ_INTERFACES
	do
		Get_Interface_Vars $DMZ
		if [ "$VIRTUAL" = "no" ]
		then
			for net in `Device_Subnets`
			do
				ipchains -A dmzi -j ACCEPT -s $ANY -d $net $LOG
				ipchains -A dmzo -j ACCEPT -s $net -d $ANY $LOG
			done
			unset net
		fi
	done
	unset DMZ
}

