• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 490
  • Last Modified:

Firestarter porting forwarding

Hi experts,

I'm using firestarter (on Debian Sarge) to do internet sharing in my network. Now I have a web application running on a Windows machine (in LAN) and I want to allow user to access it via internet.

So I configure port forwarding using firestarter. I created a forward service under "inbound traffic policy" according to firestarter manual but it doesn't seem to be forwarding. When I try to connect from another machine (outside my LAN) using my Debian machine's live IP, it fails. However, I'm able to access the app if I run from a LAN PC using the LAN IP.

This is what I get with "iptables -t nat -L", I'm trying to forward port 9909 to my internal IP.

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
DNAT       tcp  --  anywhere             anywhere            tcp dpt:9909 to:192.168.0.140:80
DNAT       udp  --  anywhere             anywhere            udp dpt:9909 to:192.168.0.140:80

With "iptables -L", I also see this...

Chain FORWARD (policy DROP)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             192.168.0.140       tcp dpt:www
ACCEPT     udp  --  anywhere             192.168.0.140       udp dpt:www

Is there anything I missed out or anything I should check?

Thanks!
0
yeewee64
Asked:
yeewee64
  • 4
  • 2
1 Solution
 
pablouruguayCommented:
iptables -A FORWARD -j ACCEPT -p tcp --dport 9909
iptables -t nat -A PREROUTING  -p tcp -d ServerIP --dport 9909 -j DNAT  --to 192.168.0.140:80

only replace the SERVERIP with your swerver ip and its work in my box
0
 
pablouruguayCommented:
orf oyu can use anyware
iptables -t nat -A PREROUTING  -p tcp --dport 9909 -j DNAT  --to 192.168.0.140:80
0
 
pablouruguayCommented:
remeber in your firewall need to accept connections to 9909

iptables -A FORWARD -j ACCEPT -p tcp --dport 9909
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
yeewee64Author Commented:
hi pablouruguay, thanks for your response. I've followed what you've suggested but I'm still getting the same error.

From my observation, traffic to the port is still not being forward because there's nothing in my webserver accesslog and errorlog when I try to connect from my browser.

Is there something else I need to check?
0
 
BlazCommented:
> remeber in your firewall need to accept connections to 9909
> iptables -A FORWARD -j ACCEPT -p tcp --dport 9909

Actually this is not true - you only need to accept connections to port 80 - DNAT is done before forward filtering is done.

Are the listed forward rules the only forward rules you have. Are you sure that reverse traffic passes the firewall? If not add:
iptables -A FORWARD -s 192.168.0.140 -p tcp --sport 80 -j ACCEPT

On the windows server what is the setting for gateway? If it is not the firestarter box you should add:
iptables -t nat -A POSTROUTING  -p tcp -d 192.168.0.140 --dport 80 -j SNAT  --to Firewall_internal_IP

If all this does not work, you should add some logging rules:
iptables -A FORWARD -j LOG

Then the messages log file will give you some idea what packets are beeing denied to pass through the FORWARD chain.
0
 
pablouruguayCommented:
ouch sorry Blaz have reason need to accept port 80
0
 
yeewee64Author Commented:
Thanks Blaz! Finally it's running :D

"On the windows server what is the setting for gateway? If it is not the firestarter box you should add:
iptables -t nat -A POSTROUTING  -p tcp -d 192.168.0.140 --dport 80 -j SNAT  --to Firewall_internal_IP"

I guess this is the key. It works beautifully right after I added that. Again, many thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now