Logo

dev-resources.site

for different kinds of informations.

Subnet Settings in AWS: A Subtle Configuration That Can Cause Big Headaches

Published at
12/6/2024
Categories
aws
subnets
vpc
Author
ahmedsalem2020
Categories
3 categories in total
aws
open
subnets
open
vpc
open
Author
14 person written this
ahmedsalem2020
open
Subnet Settings in AWS: A Subtle Configuration That Can Cause Big Headaches

Image description

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

  1. Go to the VPC Console > Subnets.
  2. Select the subnet in question and click Edit Subnet Settings.
  3. Under Auto-assign IP settings, check the box for Enable auto-assign public IPv4 address.
  4. 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.

vpc Article's
30 articles in total
Favicon
VPN Peering "Region to Region "
Favicon
Customize VPCs with CloudFormation Conditions
Favicon
AWS VPC with Public and Private Subnets & NAT Gateway
Favicon
Understanding AWS Networking Services: A Comprehensive Guide
Favicon
SECURITY GROUP IN AWS VPC
Favicon
IPs Explained: The Address of the Internet
Favicon
I am a wall - Call me a VPC
Favicon
AWS Private Zones To The Max
Favicon
High Availability Database Architecture on AWS: A Deep Dive
Favicon
Build a Virtual Private Cloud
Favicon
Subnet Settings in AWS: A Subtle Configuration That Can Cause Big Headaches
Favicon
Exploring Advanced Networking Concepts in the Cloud: VPC and Subnets
Favicon
A Beginners Guide to AWS (VPS) Virtual Private Cloud
Favicon
VPC y Subredes en AWS - Parte 2: Configuración de Conectividad Segura entre Recursos y hacia Internet
Favicon
Demystifying an interesting relation between ECR and S3
Favicon
Secure AWS VPC using Public and Private Subnets
Favicon
What is VPC Flow Log ? How to Enable VPC Log
Favicon
Cloud Networking - VPC Peering
Favicon
AWS VPC Peering: A Comprehensive Guide
Favicon
How to Create AWS VPC Using Terraform
Favicon
Deploy an EC2 instance inside a custom VPC using Terraform.
Favicon
Explaining Elastic IP Addresses in AWS
Favicon
Networking Essentials for Cloud Specialists
Favicon
Fundamentos de Redes en AWS: VPC y Subredes - Parte 1
Favicon
Transit Gateway v/s Direct Connect v/s Site-to-Site VPN
Favicon
AWS Networking - VPC
Favicon
AWS Client VPN Caveat: Knowing this can save you hours of troubleshooting
Favicon
Understanding AWS Availability Zones: Boosting SaaS Resilience and Uptime
Favicon
AWS VPC Limits
Favicon
AWS Networking, VPC, and Application Deployment: A Step-by-Step Guide

Featured ones: