- 最新
- 最多得票
- 最多評論
When you create an EC2 instance and don't see a public IP address assigned to it, there are several potential causes and solutions:
First, check if you enabled the "Auto-assign public IP" option during instance creation. If this option was set to "Disable" when you launched your instance, it won't receive a public IP address automatically.
The behavior you experienced - where restarting the instance resolved the issue - is interesting because normally, stopping and starting an EC2 instance would actually cause an auto-assigned public IP to change (or be lost if it wasn't properly configured). This suggests there might have been a temporary issue with the IP assignment or display in the console.
Here are some things to check if you encounter this issue again:
- Verify your instance is in a public subnet with a route to an Internet Gateway
- Confirm the "Auto-assign public IP" setting is enabled for your instance
- Check if the "Public IPv4 DNS" column is hidden in your EC2 console (you can enable it via the settings icon)
- Refresh your browser or try logging out and back into the AWS console
If you need a consistent public IP address that persists across instance stops and starts, consider using an Elastic IP address instead. Elastic IPs remain associated with your AWS account until you release them, providing a stable public IP for your instances.
Sources
Issue with automatic public IP adress (Bug report) | AWS re:Post
Private IP show on server rather public IP | AWS re:Post
General connection prerequisites - Amazon Elastic Compute Cloud
相關內容
- 已提問 2 年前
