简体   繁体   中英

AWS EC2 instance not letting TCP connection

I have created an EC2 (Windows) instance on AWS. I want to run a TCP server on this EC2 on TCP port 7889 and want to connect to it from outside world.

I have edited the inbound traffic rule in security group and added TCP rule for 7889 from anywhere.

But unfortunately my TCP client socket can not reach the server through the public ip of the EC2 instance.

Please help.

Note: The same thing worked for me few years ago. My little search has shown me few things like, I need to create VPC, public and private subnets, internet gateway and route tables.Is it true? All these were not required earlier.Is it a new addition?

Yes all you mentioned are absolutely needed. VPC, Subnet, Route table, Internet Gateway and EIP all are required.

The reason it worked for you previously because you might have used the default VPC with all other components already configured. Even now you will be having a default VPC in every AWS region which you can make use of it.

But it's really needed to have basic understanding of how things connect and work together because all these components are very basic and important. Refer AWS documents for more details.

If all the components are cofigured already, check the output of

netstat -nptl

command. The port 7999 should be available and it should be ready to accept any IP (ie point to 0.0.0.0)

Thank you for the responses. It was windows internal firewall as @Marcin suggested. Everything works now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM