I’ve spent countless hours configuring VPCs, subnets, and routing tables, but every now and then, something as simple as a checkbox reminds me how much there is to learn in AWS networking. Let me share a recent discovery that saved me hours of troubleshooting—and might save you even more.
The Problem: Internet Access Issues in a New Subnet
I was manually creating a new subnet in AWS. Everything seemed perfectly configured:
• Internet Gateway (IGW).
• Route Table pointing to the IGW.
• Security Groups allowing outbound traffic.
Yet when I launched an EC2 instance in the subnet, it had no internet access. At first, I assumed I had missed something minor, but after reviewing my setup repeatedly, I was stumped.
The Missing Link: Auto-Assign Public IPv4 Address
After hours of digging, I found the issue buried in the subnet settings. By default, when you manually create a subnet, the Auto-assign public IPv4 address option is disabled. This means that even though the route table points to an IGW and the security group allows traffic, instances launched in the subnet won’t be assigned a public IP address—making internet connectivity impossible.
Why This Happens
Public IP assignment is managed per subnet, not at the instance level or in the Launch Template. Even if your Launch Template includes settings for a public IP, it won’t override the subnet’s configuration. Without enabling this option, your instances are essentially isolated from the internet.
How to Fix It
Enable Public IP Assignment in Subnet Settings
- Go to the VPC Console > Subnets.
- Select the subnet in question and click Edit Subnet Settings.
- Under Auto-assign IP settings, check the box for Enable auto-assign public IPv4 address.
- Click Save.
Alternative: Assign Elastic IPs Manually
If you prefer not to enable auto-assignment, you can manually assign an Elastic IP to your instance. This approach gives you more control but adds extra steps during setup.
Lessons Learned
This experience reinforced an important AWS networking concept:
Even with the correct routing table and security group settings, an instance cannot access the internet without a public IP.
When creating subnets manually, always remember:
• If the instances in the subnet require internet access, enable the Auto-assign public IPv4 address option.
• Alternatively, assign Elastic IPs or use a NAT Gateway for outbound internet access.
Top comments (0)