Network Infrastructure with VPC, IGW, NAT, and Subnet Routing

DINESH REDDY JETTI
3 min readFeb 9, 2024

--

Virtual Private Cloud (VPC) is the cornerstone of network infrastructure in cloud computing environments, providing a secure and isolated section within the AWS Cloud. Think of it as your own private data center in the cloud. Within this virtual environment, several key components work together to enable secure communication and resource management.

At the heart of the VPC lies the Internet Gateway (IGW), a crucial component that facilitates communication between instances within the VPC and the broader internet. It serves as the entry and exit point for internet traffic, enabling instances to access external resources and allowing external entities to communicate with VPC resources.

To manage outbound internet traffic from private subnets while maintaining security, Network Address Translation (NAT) Gateway comes into play. It allows instances in private subnets to initiate outbound connections to the internet while preventing unsolicited inbound traffic. This ensures that resources remain protected from direct exposure to the internet while still being able to access necessary external services.

Within the VPC, subnets are used to partition the IP address space and organize resources based on their accessibility requirements. Public subnets are configured with routes to the internet gateway, allowing instances within them to have public IP addresses and direct internet access. On the other hand, private subnets lack direct internet access and rely on NAT Gateways for outbound traffic.

Internet Gateway (IGW)

An internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows communication between instances in your VPC and the internet.

NAT Gateway

A NAT gateway enables instances in a private subnet to connect to the internet or other AWS services, but prevents the internet from initiating connections with those instances.

Public Subnet

A public subnet is a subnet that has a route to the internet gateway. Instances in a public subnet can have public IP addresses and can be reached from the internet.

Private Subnet

A private subnet is a subnet that does not have a route to the internet gateway. Instances in a private subnet can access the internet through a NAT gateway but are not directly reachable from the internet.

Route tables are essential for controlling the flow of network traffic within the VPC. They determine how traffic is routed between subnets, internet gateways, and NAT gateways. By associating subnets with appropriate route tables, administrators can dictate the path of traffic within the VPC, ensuring efficient communication while maintaining security boundaries.

Elastic IP (EIP) addresses provide a mechanism for associating static, public IPv4 addresses with AWS resources. They are particularly useful for instances that require a consistent public-facing IP address, such as NAT gateways or externally accessible servers. By reserving and assigning Elastic IPs, administrators can ensure consistent accessibility for these resources.

Finally, adding routes for 0.0.0.0/0 to NAT and internet gateways in route tables ensures proper routing of internet-bound traffic. This default route directs all non-local traffic to the specified gateway, allowing instances within the VPC to reach external destinations seamlessly.

In summary, the VPC, along with its associated components such as internet gateways, NAT gateways, subnets, route tables, elastic IPs, and route configurations, forms the foundation of a secure, scalable, and well-connected network infrastructure in the cloud. By understanding and effectively leveraging these components, organizations can build robust and flexible architectures to support their cloud-based applications and services.

--

--

DINESH REDDY JETTI

Cloud Infra Devops. Lead @ Zuellig Pharma | DevOps, Security , Automation, Azure, AWS, GCP