LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   CentOS 5.8: Cannot NAT Forward for HTTP server... (https://www.linuxquestions.org/questions/linux-networking-3/centos-5-8-cannot-nat-forward-for-http-server-4175466293/)

kenneth_phough 06-16-2013 10:55 PM

CentOS 5.8: Cannot NAT Forward for HTTP server...
 
Hi,

This is an embarrassing question. I can't get HTTP traffic forwarded to my web server behind my CentOS 5.8 firewall. I had this all *working* before I moved into my new place. I confirmed that it is *not* a problem with my cable modem or my new ISP by temporarily making my firewall a web server.

Currently with the rules below, if I try to access my website from an external location (say at work or an internet cafe or my phone) i get 502 bad gateway or timeout.

Below are my nat and filter rules:
Code:

Table: nat
Chain PREROUTING (policy ACCEPT)
num  target    prot opt source              destination       
1    DNAT      tcp  --  0.0.0.0/0            0.0.0.0/0          tcp dpt:80 to:192.168.1.2:80

Chain POSTROUTING (policy ACCEPT)
num  target    prot opt source              destination       
1    MASQUERADE  all  --  0.0.0.0/0            0.0.0.0/0         

Chain OUTPUT (policy ACCEPT)
num  target    prot opt source              destination       

Table: filter
Chain INPUT (policy DROP)
num  target    prot opt source              destination       
1    ACCEPT    all  --  0.0.0.0/0            0.0.0.0/0         
2    ACCEPT    all  --  0.0.0.0/0            0.0.0.0/0         
3    ACCEPT    all  --  0.0.0.0/0            0.0.0.0/0          state RELATED,ESTABLISHED
4    ACCEPT    tcp  --  0.0.0.0/0            0.0.0.0/0          tcp dpt:22 state NEW,ESTABLISHED

Chain FORWARD (policy DROP)
num  target    prot opt source              destination       
1    ACCEPT    all  --  0.0.0.0/0            0.0.0.0/0         
2    ACCEPT    all  --  0.0.0.0/0            0.0.0.0/0          state RELATED,ESTABLISHED
3    ACCEPT    tcp  --  0.0.0.0/0            192.168.1.2        tcp dpt:80

Chain OUTPUT (policy ACCEPT)
num  target    prot opt source              destination

Any help on how to make http forwarding work again is much appreciated.

kenneth_phough 06-16-2013 11:10 PM

First solution...sleep. next, check iptables of web server. Sorry for posting.


All times are GMT -5. The time now is 03:08 AM.