Skip to content

EC2 Connection issue

0

Hi, I have created a Elastic beanstalk web server and this inturn created a EC2 host one single instance. We run an application inside EC2 on a particular port. so the security group is updated with inbound rule to allow traffic from 0.0.0.0/0 on custom TCP port. Also we verified that the application is running on port.

netstat -an | grep 3333
tcp        0      0 0.0.0.0:3333            0.0.0.0:*               LISTEN     
tcp6       0      0 :::3333                 :::*                    LISTEN 

Still, we couldn't connect the application using URL http://<PUBLIC_IP_ADDRESS>:3333/. Any step did we miss? Thanks.

3 Answers
2

Hi idesk-dev,

Please try this solution it will be helpful for you.

Security Group Configuration:

Verify that the security group associated with your EC2 instance allows inbound traffic on the specific port (3333). You should have a rule that allows inbound TCP traffic on port 3333 from your IP range or 0.0.0.0/0 if you want to allow all IPs for testing purposes. Similarly, make sure that the outbound rules of your security group allow traffic to leave the instance.

whenever you start and stop instance while you can see like public ip change check your public ip

https://docs.aws.amazon.com/vpc/latest/userguide/vpc-security-groups.html

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-security-groups.html

EXPERT
answered 2 years ago
2

To troubleshoot connectivity to an application on a custom port (e.g., 3333) on an AWS EC2 instance:

Check Security Group: Ensure the security group allows inbound traffic on port 3333 from 0.0.0.0/0.

Verify Network ACLs: Ensure the subnet's NACL allows traffic on port 3333.

Firewall Settings: SSH into the instance and ensure the firewall (e.g., iptables, firewalld) isn't blocking port 3333.

Public Access: Ensure the instance has a public IP and test connectivity from an external machine using curl http://<PUBLIC_IP_ADDRESS>:3333.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/security-group-rules.html

https://docs.aws.amazon.com/elastic-beanstalk/

EXPERT
answered 2 years ago
0

Thanks for the insights. Actually the process running on the port 3333 was having startup errors. We fixed those application issues and restarted the elastic beanstalk environment. That fixed the connection refused error. Thanks.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.