#!/bin/bash
#

## Firewall Script
#  01-07-26  by Erik Wegner
#  forwarding-http-up <ExternalInterface>
#

EXT=$1

if test -z $1 ; then
	echo "forwarding-http-up <ExternalInterface> "
	echo "e.g.: forwarding-mail-up ippp0"
	exit 2
fi

# Pfad zu IPTables
if test -z $IPTABLES ; then
	IPTABLES=/usr/sbin/iptables
fi

# Ports
P_HIGH=1024:65535
P_HTTP=80

echo "Forwarding [$P_HTTP] <-> $EXT ..."

$IPTABLES -A FORWARD -o $EXT \
	-m state --state NEW \
	-p TCP --sport $P_HIGH \
	--dport $P_HTTP \
	-j ACCEPT

