- Newest
- Most votes
- Most comments
The presence (or absence) of a default public IP address is determined by the setting for the subnet into which the instance is being launched https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html#vpc-public-ipv4-addresses
This can be selected in AWS Console when you launch the instance.
Could it be that you have launched the Ubuntu instance in a subnet that has public IPs enabled, but Amazon Linux is in a subnet where public IPs are disabled by default?
I am going to give you a series of configurations that you can review to verify the connection:
-
When you launch the instance check that "Auto assign public IP" is enabled
-
Make sure you have assigned a key pair
-
That the instance is in a public subnet, this will allow it to connect to the internet
-
Use the correct users:
- For ubuntu it is: ubuntu
- For Amazon Linux it is: ec2-user
I hope I have been helpful
Relevant content
- asked 5 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
Thanks for reply! but, I mean, A public ip has been created, but when I access the ip or ping from a web browser such as Chrome, the response that it is closed.
Is the Amazon Linux instance (the one you can't access) in the same subnet as Ubuntu (which is fine)?
If Amazon Linux is in a different subnet to Ubuntu, then the subnet needs to be internet-facing, which means it needs to have a route to an internet gateway.
Answering a ping needs inbound ICMP to be open in the security group. A web browser needs a webserver to be listening on the port at the other end (unlikely if you can't login to the EC2 to begin setting it up) and the relevent port(s) open. But if the security group and routing is setup correctly, and you have port 22 open, then you should definitely be able to SSH to Amazon Linux, the same as you can to Ubuntu.
Just a thought, did you select "My IP" when setting up the security group for the instance? If it was limited to your IP then has that changed - depending on your ISP your Home IP address can change periodically, and obviously your IP is different at home/at work/on VPN/on cellular.
If none of this helps then consider using Reachability Analyser https://docs.aws.amazon.com/vpc/latest/reachability/what-is-reachability-analyzer.html