Able to access server locally but not over the Internet

Issues related to configuring your network
Post Reply
rbrown3
Posts: 8
Joined: 2016/11/16 22:22:26

Able to access server locally but not over the Internet

Post by rbrown3 » 2020/10/22 15:12:29

I have a server running on my local network that is listening on port 8080. This server is providing a RESTful interface that is supposed to return some JSON to a client. This server is running on a machine running CentOS 7. I have Port 8080 open in Firewalld, and my SELinux is set to Permissive mode.

I have a firewall that has been configured to receive HTTP requests and forward them to my server on Port 8080. I also have a URL: www.myservice.net, which is configured to go to the IP address that my firewall is connected to.

My server's local address is 10.20.2.101. When I access the server using:

http://10.20.2.101:8080/getinfo

I have no problems. My server returns the JSON that I am expecting.

Unfortunately, when I attempt to access the server from outside my network,using:

http://www.myservice.net:8080/getinfo

I get connection failures. Either the connection gets refused or the connection attempt times out.

I have used tcpdump to see what was going on (I suspected my firewall mighthave been misconfigured), and what I am seeing is that the HTTP request is reaching the port on my server in both cases, and the server sees the HTTP request and processes it when I make the request locally. Unfortunately, when I make the request from outside my network, the request reaches the server but in the form of a lot of zero- sized packets and the HTTP request is not recognized at all!

Can someone provide some idea of why HTTP requests are not getting through on an open port? Why is my server unable to process requests from outside my local network? Is there some other thing I need to configure on my Linux machine that will allow the server to process outside requests?

BShT
Posts: 369
Joined: 2019/10/09 12:31:40

Re: Able to access server locally but not over the Internet

Post by BShT » 2020/10/22 19:54:38

look at default route

set it to your firewall

rbrown3
Posts: 8
Joined: 2016/11/16 22:22:26

Re: Able to access server locally but not over the Internet

Post by rbrown3 » 2020/10/23 01:00:00

I do not understand.

Are you talking about the settings on my firewall? There is a route configured on it that sends things coming from the Internet to my server machine. Or are you talking about my server machine setting a route? If so, how do I do this (I am still learning about CentOS network configurations)?

Please advise.

rbrown3
Posts: 8
Joined: 2016/11/16 22:22:26

Re: Able to access server locally but not over the Internet

Post by rbrown3 » 2020/10/23 04:12:09

Please disregard my previous post (is there any way to delete an erroneous post?).

I believe you are referring to the setting of routes using the ip or route command. I checked them. The default gateway (default route?) is already set to my firewall.

I still cannot access my service from the Internet.

User avatar
TrevorH
Forum Moderator
Posts: 29902
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Able to access server locally but not over the Internet

Post by TrevorH » 2020/10/23 09:01:21

If you're seeing 0 byte packets arriving then that sounds like your router or something external is breaking them before they arrive at your machine.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - Networking Support”