What Is an Internet Gateway? Connect a VPC’s Internet Route and Public Address
An Internet Gateway (IGW) is an AWS-managed component that serves as a route target for internet traffic between an Amazon VPC and the internet. Attaching an IGW to a VPC does not, by itself, give an instance internet connectivity. The subnet route table, the instance’s public address, and its security rules must also line up. This article uses AWS as its reference point and explains each role and how to check the connection.
An Internet Gateway (IGW) is an AWS-managed component that serves as a route target for internet traffic between an Amazon VPC and the internet. Attaching an IGW to a VPC does not, by itself, give an instance internet connectivity. The subnet route table, the instance’s public address, and its security rules must also line up. This article uses AWS as its reference point and explains each role and how to check the connection.
What does an IGW do in a packet’s path?
An IGW is an internet-connectivity component attached to a VPC. AWS describes it as horizontally scaled, redundant, and highly available, with support for IPv4 and IPv6. When a route table names the IGW as its next hop, internet-bound traffic from subnets using that table can be sent toward the IGW. An IGW is not a firewall and does not automatically expose all VPC traffic to the internet.
For IPv4, the IGW logically performs one-to-one address translation on behalf of an instance. The instance uses a private IPv4 address inside the VPC, while outbound packets use its associated public IPv4 address as the source. When a reply comes back to that public address, the IGW translates the destination to the instance’s private address. As a result, adding an IGW route without assigning a public IPv4 address does not complete ordinary direct IPv4 internet connectivity.
IPv6 uses a different addressing model. The VPC and subnet must have an IPv6 range, and the instance must receive an IPv6 address from it. IPv6 addresses are globally unique, so do not design IPv6 connectivity around IPv4-style public-address translation. Routes and security rules are still necessary. In particular, a ::/0 route to an IGW creates a default route for every IPv6 destination, so check the intended exposure and firewall rules too.
Why does internet connectivity require several settings?
Each setting answers a different question.
| Component | Question it answers | Common result when missing |
|---|---|---|
| IGW attached to the VPC | Is there an internet route target for the VPC? | The route table has no IGW to target |
| Route in the subnet’s route table | Where should packets for this destination go? | Traffic from that subnet never reaches the IGW |
| Public IPv4 or IPv6 address on the instance | Can the instance exchange addresses with the internet? | An IPv4 default route exists, but the instance lacks a public IPv4 address |
| Security group, network ACL, and host firewall | Which connections are allowed? | The path and address are correct, but a port or direction is blocked |
Assumed example: Suppose you want to publish one web server over IPv4. Attach an IGW to the VPC and add 0.0.0.0/0 → IGW to the route table used by the server’s subnet. The server also needs a public IPv4 address. Finally, allow only the required web ports in the security group and host firewall, and restrict management ports such as SSH to trusted sources. Requests arrive at the public address, and the IGW maps that address to the server’s private address. If any step is missing, the fact that an IGW is attached does not make the service reachable. This is an illustrative configuration, not a claim of a test in a real environment.
How do you configure and verify the connection in AWS?
For internet access from a subnet in a nondefault AWS VPC, AWS documents this sequence: create an IGW, attach it to the VPC, then add a route to the subnet’s route table.
**Choose the address family and scope.** Decide whether the server will use IPv4 or IPv6 and which subnet and destinations should be reachable. If the goal is public access, consider whether every instance needs a public address.
**Create the IGW and attach it to the VPC.** The attached IGW can then be used as a route target for that VPC.
**Find the route table actually used by the subnet.** A subnet uses its explicitly associated table, or the VPC’s main route table if it has no explicit association. Check the association so you do not change a different subnet’s table by mistake.
**Add a route for the required address family.** For all IPv4 destinations, use `0.0.0.0/0`; for all IPv6 destinations, use `::/0`, with the IGW as target. If only a limited external range is needed, consider a narrower destination instead of a default route.
**Check the instance address and security rules.** For IPv4, confirm a public IPv4 or Elastic IP association. For IPv6, confirm the VPC and subnet IPv6 ranges and the instance address. Check security groups, network ACLs, the host firewall, and the listening service port for the intended direction and protocol.
Verify the whole path rather than stopping at the IGW status. In the route table actually associated with the subnet, confirm the matching destination and IGW target. Check the network interface’s address, whether security rules permit both directions of the flow, and whether the service is listening on the expected interface and port. AWS notes that a default VPC may include some IPv4 components by default; do not assume a nondefault VPC has them—verify each component.
What should you check first when connectivity fails?
**Missing IGW route or wrong route table:** Check which route table the subnet actually uses, then add the needed address-family route to that table.
**No public IPv4 address:** An IGW route alone does not provide ordinary direct IPv4 connectivity to an instance without a public IPv4 or Elastic IP. If direct instance exposure is not the goal, decide whether a NAT device or public load balancer is more appropriate.
**IPv4 and IPv6 are confused:** `0.0.0.0/0` is an IPv4 route; `::/0` is an IPv6 route. Check the address family used by the client and server, the instance address, and the corresponding route separately.
**A security rule or service blocks traffic:** An IGW does not control access. Check security groups and firewalls for only the required ports, and verify that the server process is listening on them.
**The request arrives but the reply does not:** Check the route for the reply destination and the symmetry requirements of any stateful firewall. A middlebox can drop a connection if request and response take different paths.
Assigning public addresses and opening a default route can expand exposure. Before applying changes, limit the target subnet, instances, and allowed ports; afterward, verify that only intended connections succeed. If the result is unexpected, record the previous settings, roll back the change, and compare the route, address, and security rules one at a time.
Do other clouds use the same kind of Internet Gateway?
Do not assume that the name “Internet Gateway” means the same attachable resource in every cloud. In Google Cloud, the default internet gateway is the name of the next hop for a system-generated default route in a VPC. That differs from AWS’s create-and-attach IGW resource. Azure describes a routing model with a 0.0.0.0/0 → Internet system route on each subnet; that is also not an AWS IGW resource. In each model, actual connectivity still depends on addresses, routes, firewalls, and service configuration. Check each provider’s effective routes and public-address model instead of mapping services by name alone.
References
[AWS: Enable VPC internet access using an Internet Gateway, including IPv4 and IPv6 behavior](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html)
[AWS: Add internet access to a subnet in a nondefault VPC](https://docs.aws.amazon.com/vpc/latest/userguide/working-with-igw.html)
[Google Cloud: VPC routes and the default internet gateway next hop](https://docs.cloud.google.com/vpc/docs/routes)
[Azure: Virtual network system routes and the Internet next hop](https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-udr-overview)
[Azure: Virtual machines, virtual networks, and public IP addresses](https://learn.microsoft.com/en-us/azure/virtual-machines/network-overview)