Find the answer to your Linux question:
Results 1 to 5 of 5
Hi everyone! I am working with EC2 Amazon and I have a socket server in PHP listening on port 5006. The problem is that socket clients can not connect, the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Nov 2009
    Posts
    104

    problem with socket


    Hi everyone!

    I am working with EC2 Amazon and I have a socket server in PHP listening on port 5006.

    The problem is that socket clients can not connect, the error message is:

    Code:
    Could not connect: [51] Network is unreachable

    I have open the port in the EC2 management console.

    Also, the IP that the server connects to is the internal IP “172.31.5.211”, not the public IP.

    Could you help me please??

    Thank you very much!!
    Last edited by jesusitoLinux; 02-18-2014 at 08:11 AM. Reason: wrong info

  2. #2
    Linux Newbie
    Join Date
    Nov 2009
    Posts
    104
    I solved the problem disabling the firewall with this command

    Code:
    /etc/init.d/iptables stop
    Is it good to disable the Firewall??

    Thank you very much

  3. #3
    Linux Engineer docbop's Avatar
    Join Date
    Nov 2009
    Location
    Woodshed, CA
    Posts
    929
    Quote Originally Posted by jesusitoLinux View Post
    I solved the problem disabling the firewall with this command

    Code:
    /etc/init.d/iptables stop
    Is it good to disable the Firewall??

    Thank you very much
    No, better to learn how to configure IPTables so you can open the port you need.

    Linux Howtos: Security -> iptables-tutorial

  4. #4
    Just Joined!
    Join Date
    Dec 2009
    Location
    California
    Posts
    98
    I'm going to go out on a limb here and offer an opposing view.

    In the case of Amazon EC2, I believe it is perfectly fine to disable the iptables firewall. Here is why. Amazon has a firewall that protects the EC2 hosts already (they call them security groups). I'm a big fan of the KISS principal and having two firewalls isn't intuitive. I am speaking from a perspective of a guy who supports 5 different customers with 5 different applications, parts of which are in the cloud and parts which are not. Troubleshooting why connectivity isn't working when I've modified the security group settings in the AWS console becomes a pain in butt.

  5. #5
    Linux Engineer
    Join Date
    Dec 2013
    Posts
    1,188
    Quote Originally Posted by abarclay View Post
    I'm going to go out on a limb here and offer an opposing view.

    In the case of Amazon EC2, I believe it is perfectly fine to disable the iptables firewall. Here is why. Amazon has a firewall that protects the EC2 hosts already (they call them security groups). I'm a big fan of the KISS principal and having two firewalls isn't intuitive. I am speaking from a perspective of a guy who supports 5 different customers with 5 different applications, parts of which are in the cloud and parts which are not. Troubleshooting why connectivity isn't working when I've modified the security group settings in the AWS console becomes a pain in butt.
    So, do you think the second firewall is to protect from access from within the first firewall or to add protection not provided by the first firewall?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •