LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-16-2013, 10:55 PM   #1
kenneth_phough
Member
 
Registered: Dec 2005
Location: Birmingham, AL
Distribution: CentOS, REHL, Vine Linux
Posts: 67

Rep: Reputation: 3
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.
 
Old 06-16-2013, 11:10 PM   #2
kenneth_phough
Member
 
Registered: Dec 2005
Location: Birmingham, AL
Distribution: CentOS, REHL, Vine Linux
Posts: 67

Original Poster
Rep: Reputation: 3
First solution...sleep. next, check iptables of web server. Sorry for posting.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NAT and NAT Server behind its own NAT(private network) zeusys Linux - Networking 1 06-08-2011 06:22 PM
[SOLVED] nat forward openvpn qwertyjjj Linux - Newbie 8 01-08-2010 04:51 AM
LXer: Install OpenSuse 11 DomU at Xen 3.3 CentOS 5.2 Dom0 via local HTTP Server (all LXer Syndicated Linux News 0 10-18-2008 11:20 AM
LXer: Install CentOS 5.2 & F9 PV DomUs at OpenSuse 11 Dom0 via local HTTP Server (all LXer Syndicated Linux News 0 10-16-2008 09:30 AM
Nat server with iptables -P FORWARD set to DROP problem Ronin_tekorei Linux - Server 1 05-22-2008 07:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration