[NTLUG:Discuss] Port forwarding question

bkontr bkontr at yahoo.com
Tue Jun 3 21:01:44 CDT 2003


Hey everyone,

I googled the archive and couldn't find the answer so here it goes. I 
have an Apache server inside my firewall and I am trying get my firewall 
to forward port 8080 to my apache server which is also running on port 
8080.  I  should explain that the reason I am using 8080 at the moment 
is because I am not sure if Comcast is blocking port 80 so I opted to 
use a non standard port.  My firewall is fairly fascist by design and 
I'm not sure if a previous (iptables) rule is the problem but I still 
can't seem to get the port forward  to work. These are the rules I 
which I borrowed from an example from the internet:

INTIF1=Internal Network Interface 1
EXTIF=External Network Interface
HTTP= The IP of the Apache server
COMCAST= The DHCP leased IP from Comcast

$IPTABLES -A FORWARD -p tcp -i $EXTIF -o $INTIF1 -d $HTTP 
--destination-port 8080 --source-port 1024:65535 -m state --state NEW -j 
ACCEPT

$IPTABLES -A FORWARD -t filter -i $INTIF1 -m state --state / 
NEW,ESTABLISHED,RELATED -j ACCEPT

$IPTABLES -A FORWARD -t filter -i $EXTIF -m state --state
NEW,ESTABLISHED,RELATED -j ACCEPT

$IPTABLES -t nat -A PREROUTING -p tcp -i $EXTIF -d $COMCAST 
--destination-port 8080 --source-port 1024:65535 -j DNAT --to $HTTP




More information about the Discuss mailing list