LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   If I forward a port in iptables, does the port have to be open on the firewall? (https://www.linuxquestions.org/questions/linux-server-73/if-i-forward-a-port-in-iptables-does-the-port-have-to-be-open-on-the-firewall-745300/)

qwertyjjj 08-05-2009 09:57 AM

If I forward a port in iptables, does the port have to be open on the firewall?
 
If I forward port 80 to port 3128 for squid with an iptable rule, does port 3128 have to be open on the firewall or is this all routed behind the firewall?

PresGas 08-05-2009 01:26 PM

iptables IS the firewall for Linux, or at least the front-end for netfilter of which is the firewall for Linux. Are you meaning an external firewall perhaps?

kirukan 08-05-2009 02:12 PM

You will have to accept port 3128 at your INPUT table, In iptable prerouting is happening first.
http://www.docum.org/docum.org/kptd/

qwertyjjj 08-05-2009 04:41 PM

Quote:

Originally Posted by PresGas (Post 3632643)
iptables IS the firewall for Linux, or at least the front-end for netfilter of which is the firewall for Linux. Are you meaning an external firewall perhaps?

Yes, there is an external hardware firewall on my box or on the network held by the host, which presumably picks up the IP and associated rules. So, a http request would come in on port 80.
To forward it, do I need to open the external firewall as well as forward it in iptables?
The external firewall has no forwarding facility in this case so it has to be done through iptables.

PresGas 08-06-2009 09:22 AM

If I am understanding you correctly, squid is also on the server. If that is the case, I believe you would only need to open up 80 on the outside firewall, as everything else would be done at the server.


All times are GMT -5. The time now is 08:49 PM.