#!/bin/bash
#

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

INT=$1  # InternalInterface
EXT=$2  # ExternalInterface

if test -z $1 || test -z $2 ; then
	echo "nntp-forward <InternalInterface> <ExternalInterface>"
	echo "e.g.: nntp-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_NNTP=119

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

