0

We are using TCP socket connection to send messages from one PC to another PC. Now, we have migrated our project to a cloud environment. It is possible to send messages from our own PC to the Amazon Cloud Instance. I have already tried this but I am unable to get the response in EC2 instance and also checked it by disabling firewall but no use. Please help me. Does anyone know how to achieve TCP Socket connection using Amazon EC2?

wohlstad
  • 12,661
  • 10
  • 26
  • 39
user5503016
  • 21
  • 1
  • 5

1 Answers1

1

What are the settings of the security group of your aws instance?
Verify that you have allowed inbound traffic.
Check the below link on AWS security groups to know how to configure:
Amazon EC2 Security Groups .

phoenix
  • 3,069
  • 3
  • 22
  • 29
  • Hi Sri , Thank you for your reply , i have checked aws instace security group i have configured as all traffic still i am facing same issue. – user5503016 Oct 29 '15 at 15:50
  • are you in default vpc or own vpc? do you have any network acls for your vpc and subnet? I assume you have kept the outbound traffic to allow all. – phoenix Oct 29 '15 at 16:19
  • it is in default VPC and i kept outbound traffic as same as inbound i.e allow all. i dont have any network acls for my vpc. – user5503016 Oct 29 '15 at 17:23
  • also does this help you: http://serverfault.com/questions/383071/amazon-ec2-socket-connection-not-being-accepted – phoenix Oct 29 '15 at 17:29
  • Ping i have cheked , it is not working and scp i will check and let me know. – user5503016 Oct 29 '15 at 17:36
  • if ping does not work then obviously even socket won't work. I think there is some problem with your settings( firewall/acl/securitygroup/). Also is your instance in public subnet? if your instance is in private then you won't be able to connect. – phoenix Oct 29 '15 at 17:48
  • is the acl rules blocking something. – phoenix Oct 29 '15 at 17:49
  • i have checked the rule it is not blocking. – user5503016 Oct 29 '15 at 17:55
  • how can i check is my subnet is public or private? – user5503016 Oct 29 '15 at 17:56
  • while launching your instance, did you create a new private subnet or did you leave it to default (public one). – phoenix Oct 29 '15 at 18:04
  • i am not created any new subnet and default one only assigned – user5503016 Oct 29 '15 at 18:11
  • If all the factors mentioned above are taken care then it should work. If it is not working then it means somewhere one of those factors is affecting. That is all I can say from my side. It is for you to track it now. – phoenix Oct 29 '15 at 18:14
  • great, what was the problem? accept my answer if my comments helped you. – phoenix Oct 30 '15 at 08:50
  • Amazon Cloud instance is considering public IP address of My PC but i have checked with IP i.e which i have taken using "ipconfig" command from command prompt both are different. so i tried with public IP of my pc then it is worked fine. – user5503016 Oct 30 '15 at 09:03
  • :). that is a basic thing. Read :
    http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html
    From outside aws u can only access public IP or elastic IP.
    – phoenix Oct 30 '15 at 09:17