What is a public subnet? Check the internet route and public IP together
A public subnet does not mean every server inside it is exposed to the internet. In AWS, a public subnet is one whose associated route table has a route to an internet gateway; an individual instance still needs a public address and suitable security rules to communicate with the internet. Cloud providers use different network models, so assess reachability by checking routes, addresses, and firewalls together—not by relying on a subnet name.
A public subnet does not mean every server inside it is exposed to the internet. In AWS, a public subnet is one whose associated route table has a route to an internet gateway; an individual instance still needs a public address and suitable security rules to communicate with the internet. Cloud providers use different network models, so assess reachability by checking routes, addresses, and firewalls together—not by relying on a subnet name.
What does “public” describe?
A subnet is part of a network’s address space, but providers do not define “public subnet” in exactly the same way. AWS calls a subnet public when its associated route table has a route to an internet gateway. For example, 0.0.0.0/0 → internet gateway is a default route for all IPv4 destinations. It provides an internet path from the subnet, but it does not assign public addresses to instances or open their firewalls.
Google Cloud describes a subnet as a regional IP range in a VPC and distinguishes internal from external IP addresses. An external IP is internet-routable, but VPC firewall rules still determine whether inbound traffic is allowed. In Azure, a subnet is part of a VNet address space, while a public IP is a separate resource associated with a resource such as a VM network interface or public load balancer. Applying AWS’s route-table definition directly to Google Cloud or Azure can therefore hide important differences.
What must be in place for an internet host to reach a server?
Consider an incoming request to a VM-hosted web server. Several conditions must line up:
**A destination address:** the VM has a public IPv4/IPv6 address, or a public load balancer receives the request and forwards it to the VM.
**A network path:** in AWS, the subnet’s associated route table needs a route to an internet gateway. Other services require a path appropriate to their address and routing model.
**An allowed security rule:** the applicable AWS security group, Google Cloud firewall rule, Azure NSG, or other filter must allow the intended source, protocol, and port.
**A listening service:** the server process must be listening on that port, and the operating-system firewall or application configuration must not block it.
If any step is missing, a public address may still be unreachable. For example, Google Cloud’s implied ingress-deny rule blocks incoming internet traffic to a VM with an external IP unless an allow rule applies. Azure Standard public IPs also require an NSG rule that allows inbound traffic. A public address is one part of a path, not permission by itself.
Are inbound and outbound access the same setting?
No. Receiving a connection initiated from the internet is different from a VM opening a connection to the internet. If a workload needs only outbound IPv4 access, it can often use a NAT gateway rather than giving every VM a public IP. AWS documents NAT devices as an option for internet access from instances without public IP addresses. Azure describes NAT Gateway as an option for outbound-only workloads that need a predictable egress address.
So “the server needs to download updates” does not mean “the internet must be able to initiate connections to it.” Application or data tiers that only need outbound access can avoid inbound exposure and use NAT or a centralized firewall. Default outbound behavior can change by service and deployment date, so check current provider documentation for a new design.
How do the three cloud models differ?
| Environment | Subnet and address model | Additional requirements for inbound access to a VM |
|---|---|---|
| AWS Amazon VPC | AWS calls a subnet public when its route table has an internet-gateway route. | The VM needs a public IPv4/IPv6 address, an inbound security-group allowance, and a listening service. The route alone does not expose the instance. |
| Google Cloud VPC | A subnet is a regional address range; a VM network interface can have an internal or external IP. | An internet-routable address, a valid route, and an ingress firewall allowance must all be in place. An external IP does not bypass a firewall deny. |
| Azure Virtual Network | A subnet partitions VNet address space; a public IP is associated with a VM NIC or public load balancer. | Check the public IP and route, plus an inbound allow rule in the NSG and a listening service. |
This is a conceptual comparison, not a description of every resource type. Load balancers, proxies, NAT, IPv6, and custom routes can change the packet path and applicable filters. Similar product names do not guarantee that addresses attach to the same objects or that firewalls apply at the same layer; consult the documentation for the specific resource.
How might you separate web, application, and data tiers?
In this hypothetical example, place web servers, application servers, and a database in separate subnets. The web tier accepts HTTPS from a public load balancer or the necessary web-server address. The application tier allows only its application port from the web tier. The data tier allows only database traffic from the application tier. If application servers need updates or external APIs, route that outbound traffic through NAT or a firewall.
Calling the web subnet “public” does not, by itself, expose the application servers or database. The address on each resource, the route, and the security rules must all permit outside reachability. Limiting direct internet exposure to a public load balancer or the necessary web tier can reduce the attack surface; internal tiers generally do not need public addresses. This is a design example, not a deployment or test performed in a cloud account.
In what order should you check exposure?
**Identify the target.** Decide whether the internet should reach a VM, a public load balancer, or another service.
**Check the address.** Confirm the target has a public IP, or that a public frontend forwards traffic to it.
**Trace the route.** In AWS, inspect the route table actually associated with the subnet and look for an internet-gateway path. In other clouds, check their routing model and any custom routes.
**Review filters.** Confirm that security groups, firewalls, NSGs, and the operating-system firewall allow only the intended sources, protocols, and ports.
**Verify the real flow.** Use flow logs or connectivity diagnostics to see where traffic is allowed or blocked. If the target should not be public, remove unnecessary public addresses and inbound allowances and use a restricted management path.
Do not infer exposure from a subnet name or a “public” console label alone. Decide based on the actual reachability created by address assignment, routes, filters, and the running service.
References
[AWS: Internet connectivity through an internet gateway and the public-subnet definition](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html)
[AWS: Add internet access to a subnet](https://docs.aws.amazon.com/vpc/latest/userguide/working-with-igw.html)
[Google Cloud: IP address types and external-IP routing](https://docs.cloud.google.com/vpc/docs/ip-addresses)
[Google Cloud: VPC firewall rules and inbound filtering](https://docs.cloud.google.com/firewall/docs/firewalls)
[Azure: Public IP addresses and associated resources](https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/public-ip-addresses)
[Azure: Virtual network and subnet design, including NSGs](https://learn.microsoft.com/en-us/azure/networking/design-guide/vnets-subnets)
[Azure: Compare outbound internet access options](https://learn.microsoft.com/en-us/azure/networking/design-guide/outbound-egress)