Port froward from external port 9000 to internal port 80

Issues related to configuring your network
Post Reply
bhd
Posts: 1
Joined: 2019/08/26 10:14:45

Port froward from external port 9000 to internal port 80

Post by bhd » 2019/08/26 10:26:34

Hi All

This may not apply to this category of the forum, but it will be my starting point. I have come across something strange and need some help in understanding where I am going wrong.

I set my router to port forward external port 9000 to internal port 80 which is my webserver running CentOS 7

From what I can see the router is sending the packet to the server but the server is not responding. I thought it may be a firewall issue. So I temporarily;y turned off the firewall. But that didn't solve the problem.

I set the httpd.conf file to listen to port 9000 and on the internal side of the network. This worked I was able to bring up the WordPress website. But from an external computer, the web site does not load. So my question to this forum is. Do I need to do something else to get this port forward to work? Or should I be looking at another area to solve the problem?

Any and all help is extremely appreciated

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Port froward from external port 9000 to internal port 80

Post by jlehtone » 2019/08/26 20:14:24

It seems that you have two networks (lanA and wanB) and three machines:
1. Client in wanB
2. Router (RTR) between wanB and lanA
3. CentOS http server (SRV) in lanA

A successful communication would be:
1. Client sends to RB:9000 (port 9000 of IP address of RTR on the wanB). Sender's address is CB.
2. RTR redirects packet to SA:80 (port 80 of SRV)
3. SRV receives packet from CB.
4. httpd handles request
5. SRV sends reply to CB via RA (the IP address of RTR in lanA). Sender is SA:80.
6. RTR passes reply back to CB, but rewrites sender RB:9000.
7. Client receives reply from RB:9000

The step 5 requires that the SRV has a route to CB "via RA". If the RTR is the one and only router of lanA, then that is SRV's default route.

You can listen traffic on SRV

Code: Select all

tcpdump -nn -v port 80
Did you see packet arriving, but no reply being sent?


You did not say that the RTR is CentOS. Therefore, we cannot say anything about it.

Post Reply