Sonny To on 1 Sep 2007 01:33:42 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] iptables masquerading, port blocking and port forwarding

  • From: "Sonny To" <son.c.to@gmail.com>
  • To: "Philadelphia Linux User's Group Discussion List" <plug@lists.phillylinux.org>
  • Subject: [PLUG] iptables masquerading, port blocking and port forwarding
  • Date: Fri, 31 Aug 2007 21:33:36 -0400
  • Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Q8kZ9Gvsx94tvYk9taAGxdPzJxdGsC5h9OYtsB01ZS0m2irHzr5WPuPCeCOj555MD2V9y6ZzOnOGTzxybfR78YiwuIgUjeWWIzy/iuqnue6yC0IzqDmP/pDy9NIxUYoU6THA4/IevYxSot4s3IjkZksvri1i7Vlz/cyp1I/ii6Q=
  • Reply-to: Philadelphia Linux User's Group Discussion List <plug@lists.phillylinux.org>
  • Sender: plug-bounces@lists.phillylinux.org

ip masquerading is working, port blocking is working, but now cannot
get port forwarding to work.

I want to run Jetty on port 80 instead of apache httpd but don't want
it to run as root.

$IPTABLES -t nat -A PREROUTING -p tcp -i $EXTIF --dport 80 -j DNAT
--to 192.168.1.2:7070

the above works if I did not have the below:

$IPTABLES -A INPUT -j ACCEPT -p tcp --destination-port 80 -i $EXTIF
$IPTABLES -A INPUT -j DROP -p tcp -i $EXTIF

How can I get port forwarding port 80 to port 7070 while blocking all
other ports?

many thanks,
Sonny
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug