#!/bin/bash
#

## Firewall Script
#  01-07-26  by Erik Wegner
#  https-forward <InternalInterface> <ExternalInterface>
#

INT=$1  # Interface
EXT=$2  # Network

if test -z $1 || test -z $2 ; then
	echo "https-forward <InternalInterface> <ExternalInterfae>"
	echo "e.g.: https-forward eth0 ppp0"
	exit 2
fi

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

## Ports
#  Nicht-privilegierte = 1024-65535
P_HIGH=1024:65535
P_HTTPS=443

echo -e "\n# HTTPS-Forward $INT[$P_HIGH] -> $EXT[$P_HTTPS]"
echo "$IPTABLES -A FORWARD -o $EXT -i $INT -m state --state NEW \\"
echo "	-p TCP --sport $P_HIGH --dport $P_HTTPS \\"
echo "	-j ACCEPT"

