3

When I run my application on Centos the specific process opens port that listens for connections from localhost, but uses 0.0.0.0 in Foreign Address. Is it secured?

netstat -plunt
Active Internet connections (only servers)
Proto Recv-Q Send-Q     Local Address               Foreign Address             State       PID/Program name
tcp        0      0     127.0.0.1:5555              0.0.0.0:*                   LISTEN      17332
5

All this is indicating is that the process listening on that address and port has 'requested' the ability to receive connections from any IP address on any port. Until a connection is made the process appears as being connected to nothing in this way (asterisk).

From the netstat manpage:

Foreign Address - The IP address and port number of the remote computer to which the socket is connected. The names that corresponds to the IP address and the port are shown unless the -n parameter is specified. If the port is not yet established, the port number is shown as an asterisk (*).

Because this process is listening on 127.0.0.1, it is secured in that only addresses in the 127.0.0.0/8 range can make a connection, which is a range exclusively reserved for connections only possible by other processes running on that system.

  • Thanks! So, it is not secured by the configuration (if I depend on the firewall). How should I change it to be secure? What should be in Foreign Address? 127.0.0.1:*? – Michael Feb 18 '14 at 9:09
  • Apologies, now I look closer I see it's listening on the loopback address. This is secure as the kernel (Windows and Linux) do not allow just any address to route to it. So even without a firewall, this particular process is relatively secure listening there. – deed02392 Feb 18 '14 at 9:12
  • Just to clarify: if I have 127.0.0.1 in Local Address it is secured without dependency what I have in Foreign Address. – Michael Feb 18 '14 at 9:14
  • Yes, processes listening on 127.0.0.1 are secured in that only addresses in the 127.0.0.0/8 range can make a connection, which is a range exclusively reserved for connections only possible by other processes running on that system. – deed02392 Feb 18 '14 at 9:21
  • Great, you can update the answer to all people that will read it in the future. – Michael Feb 18 '14 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.