Chapter 1: Networking Fundamentals
1.9 How these concepts map to AWS
Come on, friends, let's see where all these pieces sit in AWS. Treat the diagram below as a typical company setup: the web server in a public subnet, the database in a private subnet, and a NAT Gateway for updates. We will build this whole setup ourselves in Chapter 15.
चला मित्रांनो, आता हे सगळे तुकडे AWS मध्ये कुठे बसतात ते बघू. खालचा diagram एक typical company setup समजा: public subnet मध्ये web server, private subnet मध्ये database, आणि updates साठी NAT Gateway. हा पूर्ण setup आपण Chapter 15 मध्ये स्वतः बनवणार आहोत.
चलो दोस्तों, अब देखते हैं कि ये सारे टुकड़े AWS में कहाँ बैठते हैं. नीचे वाले diagram को एक typical company setup समझो: public subnet में web server, private subnet में database, और updates के लिए NAT Gateway. यह पूरा setup हम Chapter 15 में खुद बनाएँगे.
Internet
|
+---------------+
| Internet GW | (1:1 NAT for public / Elastic IPs)
+---------------+
|
+------------------ VPC 10.0.0.0/16 ------------------------------+
| Public subnet 10.0.1.0/24 Private subnet 10.0.11.0/24 |
| +-----------------------+ +------------------------+ |
| | EC2 web server | | EC2 test database | |
| | private 10.0.1.25 | -------> | private 10.0.11.40 | |
| | public 192.0.2.25 | | (no public IP) | |
| +-----------------------+ +-----------+------------+ |
| | | outbound only |
| +-------------+ <-------------------------+ |
| | NAT Gateway | (lets private hosts download updates) |
| +-------------+ |
+-----------------------------------------------------------------+
| Networking concept | AWS feature | Key points |
|---|---|---|
| Private IP | Primary private IPv4 of an EC2 ENI | From the subnet CIDR; stays the same for the life of the instance (even across stop/start) |
| Dynamic public IP | Auto-assigned public IPv4 | An ordinary auto-assigned public IPv4 is released when the instance stops. Check the current association after start. Termination releases that association. |
| Static public IP | Elastic IP (EIP) | Stays with your account until you release it; can be re-mapped to another instance. Ordinary AWS-provided public IPv4 addresses can incur hourly charges. Check current pricing and exceptions. |
| Private network | VPC with CIDR (e.g. 10.0.0.0/16) |
Plan a non-overlapping range. RFC 1918 is common. A standard VPC IPv4 CIDR can be /16 to /28. |
| Subnet | Subnet (lives in one AZ) | A subnet with an internet gateway route is public. 0.0.0.0/0 is one common IPv4 destination for that route. |
| NAT | NAT Gateway / Internet Gateway | The internet gateway maps associated public IPv4 to private IPv4. A NAT gateway can translate approved outgoing traffic for private workloads. |
| Firewall on ports | Security Group (stateful, attached to supported resources) and Network ACL (stateless, subnet level) | Permit only the callers and service ports intended for the workload. Use the approved management path when one is needed. |
| DNS | Route 53 (Chapter 9), and DNS names for public or private endpoints |
Mumbai and Hyderabad regions
The Asia Pacific (Mumbai) ap-south-1 and Asia Pacific (Hyderabad) ap-south-2 Regions are options to evaluate for users in Maharashtra. Measure from the networks users actually use and check service availability, cost and data-location requirements.
Public IP changes after stop/start
If your website stops working after you stop and start an instance, check the public IP — it has probably changed. Use an Elastic IP for a workload that specifically needs a stable public IPv4, or a stable DNS name that points at the intended endpoint, such as a load balancer — we practise this in Chapter 14.
Ravindra Bagale's Tip
In interviews many students mix up the Security Group and the Network ACL. Remember: a Security Group is stateful and applies to its associated resources; a Network ACL works at the subnet level and is stateless. So in an SG matching reply traffic is allowed by the security group if the rest of the path is usable, but in a NACL you need rules in both directions.
Ravindra Bagale's Tip – मराठी
Interview मध्ये बरेच students Security Group आणि Network ACL उलटं सांगतात. लक्षात ठेवा: Security Group stateful असतो आणि त्याला जोडलेल्या resources वर लागू होतो; Network ACL subnet level ला आहे आणि stateless. म्हणजे SG मध्ये allow केलेल्या request च्या reply ला Security Group स्वतंत्र rule शिवाय परवानगी देतो, पण NACL मध्ये दोन्ही दिशांचे rules लागतात.
Ravindra Bagale's Tip – हिंदी
Interview में बहुत से students Security Group और Network ACL उल्टा बताते हैं. याद रखो: Security Group stateful होता है और उससे जुड़े resources पर लागू होता है; Network ACL subnet level पर है और stateless. मतलब SG में allow की गई request के reply के लिए Security Group अलग rule के बिना अनुमति देता है, लेकिन NACL में दोनों दिशाओं के rules चाहिए.
Lab
AWS console madhe VPC → Your VPCs ughda and check the approved VPC CIDR. If your lab uses the standard default VPC, its default IPv4 CIDR is 172.31.0.0/16. Mag Subnets madhe pratyek subnet cha CIDR aani AZ liha, aani Route tables madhe 0.0.0.0/0 → Internet Gateway cha route kuthe aahe te shodha.
Go deeper: Amazon VPC
Chapter 15 builds this exact picture hands-on: What is a VPC? Default VPC vs custom VPC · Route tables: public and private subnets · Security group vs NACL. Quick guides: Create a custom VPC · Public vs private subnet.
Start the AWS diagram with who needs to talk to whom
Mauli Dairy wants one public page for delivery tracking and a separate application that manages the deliveries. The team needs to let customers open the page, let application workers read and update the data, and give those workers an approved way to fetch dependencies. A beginner can draw all three lines before learning the name of a single AWS resource. Each line should show who starts the connection, where the request goes and what counts as a useful reply.
The customer uses a tracking name in a browser, connects over HTTPS, and expects the current status of an authorized delivery. The front end accepts that connection. In a multi-server design it can hand off work to an application server through a separate connection. The application then contacts the database using its private endpoint, a database listener port and accepted credentials. The vendor used for dependencies is another destination with its own access requirements. No one arrow represents all of these paths at once.
For the AWS translation of the diagram, make the tracking entry point an internet-facing Application Load Balancer. Put its application targets on private IPv4 addresses. Use private subnets for the database tier. Where the application workers need an approved public IPv4 path, consider a public NAT gateway. Where workers only need a supported AWS service, consider a suitable VPC endpoint for that traffic. The public name can stay the same while targets behind the front end change. On an isolated early course exercise a public EC2 web server can illustrate the direct path, so the existing diagram shows that smaller design first.
The following sections use a plan with two Availability Zones. That arrangement helps students see which resources are attached to a network, which have zone boundaries and which inspect a connection. A development lab can practice the same reasoning on paper with a single test server. Leave the outline labels the same when switching between the paper and console views. It is easier to check the diagram when “App A subnet” means the same place everywhere.
Use 10.40.0.0/16 and the smaller example blocks inside it in your worksheet. An illustration may use 192.0.2.25 for an internet-side address and tracking.example.com for a public service name. These are example values. A real application uses an owned service name, allocated addresses, approved sources and access policy appropriate to that account.
Place the VPC, Availability Zones, subnets and interfaces
An AWS Region is a geographic collection of Availability Zones. An Availability Zone is an isolated infrastructure location within the Region. A VPC is a virtual network you define in a Region, and it can have subnets across that Region's Availability Zones. A particular subnet belongs to one Availability Zone. An EC2 instance launched in that subnet can use a network interface in that zone, and a private IPv4 on the interface is selected from the subnet's range. Place these pieces in the right order when you expand a drawing from one box into actual resources.
The VPC range is like an allocation record for the whole project. The subnet ranges divide a part of it by purpose and zone. Plan non-overlapping ranges and leave room for future workloads. An Application Load Balancer can create interfaces and scale in its selected subnets. Small or full subnets can prevent later changes even when the VPC's parent block has plenty of other free space. For a standard regional Application Load Balancer, AWS's documented requirements include subnets in at least two Availability Zones and recommend room in those subnets for scaling and maintenance. Verify the current setup requirements for the selected load balancer type.
| Purpose | Zone A example | Zone B example | Intended path |
|---|---|---|---|
| Public entry and zonal egress placement | 10.40.10.0/24 | 10.40.11.0/24 | Internet gateway route for the public components. |
| Application targets | 10.40.20.0/24 | 10.40.21.0/24 | Local target and database traffic. Selected egress according to the design. |
| Database subnets | 10.40.30.0/24 | 10.40.31.0/24 | Private connections for the application. The example does not add a general internet route. |
For the IPv4 subnet calculation, a /24 contains 256 address values. In the ordinary AWS subnet case AWS reserves the first four and last address, leaving 251 available for resource assignment before other allocations. In 10.40.20.0/24, those reserved values run from 10.40.20.0 through 10.40.20.3, plus 10.40.20.255. An address such as 10.40.20.25 can illustrate an app target. In a live subnet verify that the chosen address is permitted and free or let AWS assign one. Special configurations can have different reservation rules.
An Elastic Network Interface, or ENI, represents a network interface in the VPC, with properties such as its assigned IP addresses and security groups. Think about the interface when comparing what the console and the operating system show. An instance's private IPv4 belongs to its subnet and interface. Any ordinary public IPv4 association follows the EC2 addressing model. Separate the subnet route, the association and the operating system listener when a connection fails.
Before choosing a Region, consider where users and dependent systems are, where the data is allowed to reside under your organization's rules, and whether the intended services and instance types are available. Compare real latency from representative client networks and check regional pricing. For users in Maharashtra, Mumbai and Hyderabad are examples worth evaluating. A map distance alone cannot establish which route a particular network takes or which deployment is fastest.
Read route tables as delivery choices and policy as permission
A route table answers where matching destination traffic should go. A route usually has a destination prefix and a target such as the VPC's local path, an internet gateway or a NAT gateway. Every subnet uses a route table. It can have an explicit association to a particular table or implicitly use the VPC's main route table. An engineer troubleshooting a subnet needs the table that is actually associated, even if another table has the right-looking name.
Longest prefix match means AWS uses the most specific matching destination when routes differ in prefix length. In the app subnet, 10.40.0.0/16 → local includes the app's private database destination. A catch-all 0.0.0.0/0 → NAT gateway applies to less specific IPv4 destinations that otherwise match no preferred route. A packet for the database uses the local route. Choosing where vendor requests go does not force the database traffic through public egress.
| Subnet example | Destination class | Expected route choice |
|---|---|---|
| Public zone A | Local app addresses and ordinary internet IPv4 | VPC CIDR local route for the app addresses. A route to the internet gateway for the intended internet prefixes. |
| App zone A | Database addresses and approved vendor IPv4 | Local route for the database. A route via an appropriate public NAT gateway for the intended vendor destination in this example. |
| Database zone A | Replies to the app within the VPC | Local route. No general internet default route is needed for this data path. |
An internet gateway attaches to the VPC and can serve as a target for internet routes. A subnet with an internet gateway route is commonly called public. That statement describes the subnet's routing. For direct IPv4 from the internet an EC2 instance also needs a public association along with the intended inbound policy and application listener. Applications with no direct public IPv4 can still be targets of a properly configured public load balancer. The subnet name alone does not establish any of these decisions.
A route to the proper target still does not authorize a caller. Security groups and network ACLs are two AWS controls that can operate along the path. A service can also require a hostname, valid TLS, a sign-in or a database credential. Keep a different worksheet column for route and for permission. If one engineer sees a valid route and another sees a refused request, both may be describing different truths about the same flow.
Trace a public browser request across the edge and the app
Start the request with a customer looking up tracking.example.com. A DNS record directs the name to the intended load balancer. When using Route 53, an alias record for a supported load balancer can link the name to that resource. The browser then initiates a connection using the returned address and its HTTPS port. TLS establishes the expected hostname and encryption before the service receives an authorized order tracking request.
At a typical Application Load Balancer listener the public request terminates at the load balancer. Its listener rule selects an application target group for the request. The load balancer connects to a healthy target over the permitted private path. There may be HTTPS on both legs or a design that uses a different target protocol under the team's requirements. Write the actual protocol and port for each leg rather than assuming the application listens on whichever port a customer entered.
Customer to frontend. The caller uses the tracking name and the allowed public HTTPS listener. The load balancer's security group and listener should match the intended front door and certificate.
Frontend to target. The load balancer needs a usable network path and policy permission to send the configured target and health check traffic. Give the application target group the actual serving port and a useful health check behavior.
Target to database. The application connects to the private database endpoint using the required port and identity. The database accepts access from the intended callers. The database reply and the frontend's reply are on distinct connections.
A useful health check proves what it asks for. A load balancer health check could verify an application's readiness path. It does not necessarily verify that an account can open the correct order record. Distinguish target registration, target health, network transport, TLS and expected business behavior when recording the final result. If a target uses an application configuration that points at the wrong database, opening more public ports cannot make the order lookup correct.
The direct-public EC2 version earlier in the chapter is a simpler topology. In that version the client can reach the associated public IPv4 through the internet gateway under the intended controls, and AWS maps that public IPv4 to the instance's private IPv4. The browser and server then share one connection through that mapping. In the load balancer version reliable tracing needs separate evidence for public entry and the target leg. One useful support question is “Which component actually returned the error?”
Describe a security group, subnet ACL and application sign-in separately
A security group is a stateful set of allowed network traffic for associated resources. Stateful means that replies associated with an allowed flow are permitted by the group behavior without an extra rule just for those replies. The path still needs routes and must pass any additional controls. Use the actual associated group rather than assuming two instances in the same subnet have identical group permissions.
A network ACL is applied to a subnet and evaluates incoming and outgoing traffic separately. It processes numbered rules in order and can allow or deny traffic. To permit both ways of a connection through a custom network ACL, consider the connection's reply traffic as well as its request. For an HTTPS client that opens from a temporary source port to server TCP port 443, the reply's source is 443 and its destination is the client's temporary port. Record those details in the context of the relevant subnet instead of copying an example broad rule to production.
| Control | What you ask it | Why the answer is limited to its layer |
|---|---|---|
| Application target security group | Is traffic allowed from the intended load balancer security group to the target and health check ports? | It authorizes the network connection. It doesn't validate a customer's order entitlement. |
| App and database subnet ACLs | Does ordered inbound and outbound policy permit each required traversal? | It acts at subnet scope. It doesn't decide which process is listening. |
| Application authentication and database credentials | Can this signed-in caller perform this operation? | It decides behavior after the connection reaches the service. |
In the example, the public front end allows the intended HTTPS audience. The application group allows only the app and health check traffic from the front end's group as appropriate to the setup. The database group permits its required port from the app group. A MySQL example might use TCP 3306, but use the configured engine and server port. An application that needs support access should have a separately approved administration path rather than inheriting access from the public listener's rule.
Students sometimes hear “a stateful reply is automatic” and conclude that it does not need a usable route. The stateful property refers to the security group evaluating a corresponding response. A missing route, mismatched subnet ACL or process that never replies can still fail the connection. To explain why a response works, state how the reply is sent as well as how policy treats it.
Give the app only the outbound paths and data access it needs
The application needs the database to complete tracking requests. Its destination comes from the private database name and belongs on the connected network. For a managed RDS database, use the AWS-provided endpoint and configure access for the chosen engine. Individual addresses behind that endpoint can change when the service changes placement. Record the configured endpoint and allowed callers instead of embedding an example private IPv4 in application code. A standard RDS DB subnet group uses subnets in multiple Availability Zones under the documented requirements. A subnet group provides placement choices. It does not by itself prove that the particular database deployment is a Multi-AZ deployment.
The app's package or vendor update path is a different connection. In a zonal public NAT example, the worker's private subnet points to a NAT gateway in a public subnet for selected public IPv4 destinations. The public subnet uses the internet gateway. NAT and the internet gateway present the intended outside source for that path. AWS now also documents regional public NAT gateways with a different placement and route table model. Read the selected mode before copying these zonal routes. The public NAT gateway does not accept new unsolicited internet connections to the private worker.
An S3 destination can have a service-specific endpoint route when the design uses a gateway endpoint for supported S3 access. The route and endpoint policy belong to that service's path. The application also needs its own AWS permissions for the required operation. If that request works but the external vendor is unavailable, inspect egress specifically for the vendor. A policy or route established for an AWS service tells you little about an unrelated internet host.
Database maintenance depends on its operating model. A self-managed database on an EC2 instance may need the approved repository or patch paths designed by the operator. An RDS managed service has service-managed maintenance and different connectivity requirements. In this example the database tier needs private data paths and does not get a blanket internet route. Begin with what the deployed resource actually needs, then review its service documentation and owner policy.
When you create a cost worksheet, include frontend, compute, database, retained storage, data movement, EIP and NAT resources as applicable. A closed browser tab stops your request without removing a running component. For a class exercise, decide whether the goal is to review inventory or deploy something. A read-only review teaches how to interpret topology without needing to create and then remove charges.
Explain why a default VPC lab and a custom VPC lab behave differently
A student originally launched a training web server using the default VPC. The browser could reach the site after the lab's approved permissions were added. Later the same student selected a custom subnet and reused the same machine image. The application starts, but the browser can no longer make the direct connection. Both results can be expected. A machine image controls the chosen operating system and software. It does not copy the VPC, subnet route table or public address configuration from an earlier launch.
A default VPC ordinarily comes with default subnets and an internet gateway route under AWS's standard configuration. A default subnet has auto-assignment of public IPv4 enabled by default. An account owner can change the routes and settings or remove the default VPC and its subnets. When a lab says “launch in the default VPC,” look at the actual environment and exact launch settings. A launch can have its own public address choice. Capture those facts rather than treating the word default as evidence an instance will be public.
A custom VPC starts with a design you are responsible for. If Mauli deploys its app targets in a new private subnet, those targets are supposed to receive requests from the front end over the private path. A browser at home should use the tracking name and reach the load balancer. It does not need to connect to the app target's IPv4 directly. Whether the result represents a regression depends on the intended route and permitted caller. Compare the old requirement with the new one.
Write a small comparison record. For the old launch, list its VPC, subnet, effective route and whether the instance held an associated public IPv4. For the new launch, write the same four facts, plus the target registration if a load balancer is intended. Then check the service name and listener from a permitted client. This record distinguishes copying a service installation from copying a connectivity design. It helps a teammate explain why a seemingly identical virtual machine behaves differently in a new placement.
If you need to reproduce the original connectivity lesson, select an approved isolated training topology and verify its intended state. Compare the practice goal with the actual website architecture before offering any change. A disposable direct-public exercise, an internal application on a VPN and a private target behind a public frontend use different client paths. Each has legitimate service access checks of its own.
Run a paper route lookup for the app and database subnets
You need the diagram above, a shell with Python 3, and its standard ipaddress module. Decide how four example destinations should be delivered. The lab matches CIDR prefixes and prints names for the selected targets. It does not send packets, create a VPC, or exercise an AWS routing engine. AWS can use additional rules to choose between routes of equal specificity. This example uses distinct prefix lengths and contains no overlapping candidates of equal priority.
python3 - <<'PY'
from ipaddress import IPv4Address, IPv4Network
vpc_local = (IPv4Network("10.40.0.0/16"), "local inside VPC")
app_routes = [
vpc_local,
(IPv4Network("0.0.0.0/0"), "egress to zonal NAT"),
(IPv4Network("198.51.100.64/26"), "approved private route"),
]
db_routes = [vpc_local]
def select_target(routes, value):
address = IPv4Address(value)
matches = [(block, target) for block, target in routes if address in block]
if not matches:
return "no matching route"
block, target = max(matches, key=lambda route: route[0].prefixlen)
return f"{block} to {target}"
for label, routes, target in [
("app to database", app_routes, "10.40.30.40"),
("app to vendor", app_routes, "203.0.113.70"),
("app to partner", app_routes, "198.51.100.70"),
("database to vendor", db_routes, "203.0.113.70"),
("database to app", db_routes, "10.40.20.25"),
]:
print(f"{label}: {select_target(routes, target)}")
PY
The intended outputs show the app reaching the database using the local route for the VPC range. The ordinary external example matches the app table's default route. The partner example deliberately sits inside the more-specific documentation range, so that row chooses the approved private path. A real partner route would target a supported attachment or appliance chosen by the network owner. The paper route uses an example prefix, and the label stands in for its AWS-specific next hop.
The database-to-vendor lookup has no matching route in the model. That result is expected because this database is not meant to call the vendor. The database-to-app lookup matches the local route. It still needs to send a permitted reply to the exact active connection. Be able to state why the database's inability to reach an unrelated outside address can coexist with a working database read.
Change the last octet in the partner example to 128. The prefix 198.51.100.64/26 contains values from 64 through 127 in the last octet. The new address should match only the default path in the app table. Explain how the measured example changed just by selecting a different exact destination. This is why a useful incident ticket records the resolved address as well as the service name.
If a Python error mentions host bits, inspect whether you pasted 198.51.100.70/26 into a route prefix rather than leaving 70 as an address and 64 as the base of the network. You can paste the Python body into an interpreter if your shell does not support heredocs. No cloud changes or local files are created. If you chose to save a worksheet, keep its example values separate from any real environment inventory you are permitted to handle.
Find the route table a real training subnet uses
This optional inspection needs a training VPC you have permission to read. You can complete it using the worksheet alone. Confirm the account and Region before opening resource details. A default VPC may or may not exist because an account owner may have removed it. The lesson works with either a default or custom VPC. Avoid creating resources just to make what you see match the diagram.
In the VPC console choose the approved VPC. Read its IPv4 CIDR and identify one tagged subnet that belongs to the lab. Note its subnet CIDR and Availability Zone. Compare the subnet prefix to the VPC's actual allocation. The worksheet examples are illustrative and your own resource ranges may differ.
Open the subnet's route table details and determine whether the association is explicit. Follow the selected route table ID rather than searching for a name that sounds public or private. Read each relevant destination prefix, target identifier and route state. If the subnet uses the main table, record that as an implicit association.
Choose an internal sample destination and a sample IPv4 outside the VPC. Predict the route choice for each. A route to an internet gateway lets you classify the subnet as public under the common AWS terminology. For a particular lab instance, separately inspect whether its interface has a public IPv4 association and the required listener permissions.
Review the attached security group or subnet ACL only if its inspection is permitted. On each policy row identify direction, source or destination, and the exact protocol and port. Confirm a useful result using existing lab evidence. A subnet overview and configuration are useful evidence of intent, while a successful authorized application request demonstrates the actual observed path at that time.
If AWS CLI access is already configured, the following equivalent read-only queries find the subnet and route table associations. Set the three shell variables to the existing training profile, Region and subnet identifier before running the block. The example uses placeholders deliberately. In your course worksheet, record safe aliases instead of account and resource identifiers from a real system.
LAB_PROFILE='REPLACE_WITH_TRAINING_PROFILE'
LAB_REGION='REPLACE_WITH_TRAINING_REGION'
LAB_SUBNET='REPLACE_WITH_TRAINING_SUBNET_ID'
aws ec2 describe-subnets \
--profile "$LAB_PROFILE" --region "$LAB_REGION" \
--subnet-ids "$LAB_SUBNET" \
--query 'Subnets[0].{VPC:VpcId,Zone:AvailabilityZone,CIDR:CidrBlock,AutoPublicIPv4:MapPublicIpOnLaunch}' \
--output json
aws ec2 describe-route-tables \
--profile "$LAB_PROFILE" --region "$LAB_REGION" \
--filters "Name=association.subnet-id,Values=$LAB_SUBNET" \
--query 'RouteTables[].{Table:RouteTableId,Routes:Routes}' \
--output json
The first command returns a VPC identifier, zone, IPv4 CIDR if assigned, and subnet auto-public-IPv4 setting. That setting influences assignment for a launch, and it does not prove what address a specific running instance has now. The second command returns the explicitly associated route table, if present. If it returns an empty list for the selected existing subnet, use the VPC ID from the first result and look for the VPC's main table with the next query. An access error is different from an empty result.
LAB_VPC='REPLACE_WITH_VPC_ID_FROM_SUBNET_RESULT'
aws ec2 describe-route-tables \
--profile "$LAB_PROFILE" --region "$LAB_REGION" \
--filters "Name=vpc-id,Values=$LAB_VPC" 'Name=association.main,Values=true' \
--query 'RouteTables[].{Table:RouteTableId,Routes:Routes}' \
--output json
Read DestinationCidrBlock and the returned target property in the chosen rows. A default IPv4 route may name the internet gateway in GatewayId or a NAT gateway in NatGatewayId, depending on the plan. Check whether the row is active. Destination types such as managed prefix lists can use different fields. When the console and CLI seem to disagree, confirm that both show the same account, Region, subnet and instant. Ask a training account owner to verify missing read permissions rather than working around them.
The practice succeeds when you can point to the selected table, explain whether it is explicit or implicit, and distinguish a route for the VPC's private database from the route for outside traffic. This inspection does not allocate resources. If you built a separate disposable lab, follow its own cleanup instructions after identifying attached resources and dependencies. A read-only check provides no authority to remove a shared resource.
Compare three failures that all look like a page outage
The customer support team has three reports. One says the browser never connects. Another says it connects and returns a gateway error. A third says the page appears but shows no information for a valid tracking ID. All three might be described as “the site is down.” They narrow the investigation in different ways. Work from the expected request sequence before making a network change.
| Observed result | First path to check | Evidence worth recording |
|---|---|---|
| Customer sees a connection timeout. | Caller to public endpoint. | Correct DNS answer, address family, route, public listener and intended account or edge policy. |
| Load balancer sends an error after the client connects. | Load balancer to target or the application behind it. | Observed response code, target health, target port, listener rules and approved logs. |
| Page works, but expected data is missing. | Application operation and private data path. | Expected identity, app logs, database endpoint, app-to-database permission, query outcome and relevant data state. |
For the first report, if a friend tests from a working network and your classroom device fails, compare the client DNS and chosen address family before assuming the application moved. The service may resolve differently, or an IPv6 route may behave differently from the IPv4 example. If the second report comes immediately after a release, compare the target group, health path and destination port to the new app process. A listener mismatch is narrower than a broken VPC. If the third report affects one customer account, compare the operation and authorization evidence rather than opening the database to public access.
Do not treat the explanation as determined by the symptom alone. For example, a timeout can happen at several layers and error codes can be generated by different components. Mark each line of the path as verified, failing or still unknown. Good evidence records which client, exact destination, port and protocol were used, and whether the outcome was a connection, TLS result, response status or complete application operation. It also records who is authorized to make the next test.
Turn a diagram into a reviewable AWS plan
Draw Mauli's six subnets. Write one sentence explaining why each zone has separate subnet allocations for the public entry, application and data tiers. Circle the app's specific private destination, then mark the same-zone NAT gateway for the example public path. Success includes showing an internet gateway target in the public subnet route table without placing a public address on every application target.
Prepare a handoff with one table row per connection and columns for source, destination, protocol or port, route target, network permission and application check. Use customer HTTPS, load balancer to app, app to database and app to vendor. Your answer should identify who maintains each destination and what good evidence looks like from its permitted source. A route entry alone does not complete any row.
A lab trainer launches an instance with no public IPv4 in a subnet that has a route to an internet gateway. Describe the subnet independently of the instance. Then propose a way to serve the sample page from approved public entry while the instance remains private. Identify the front end and backend target. Success means specifying the allowed public listener without creating a public database or broadly available admin port.
The application needs an internal database name and one external vendor name. Plan two small verification requests from an approved private test environment. Record the expected DNS audience and the address family before testing. For each path name the target you expect the subnet route to choose and the result that would demonstrate the intended operation. Keep production data and account identifiers out of a shared worksheet.
Interview questions and worked answers
How are a VPC and a subnet related in AWS?
A VPC is a regional virtual network. A subnet allocates an address space for resources and belongs to one Availability Zone. A VPC can contain subnets in several zones. Use the VPC as the broader address and routing scope, then check the individual subnet and its route association for a resource's path.
Why can a VPC have more than one route table?
Different subnets can need different paths. A public frontend subnet can have an internet gateway route while an app subnet sends public egress through an approved NAT gateway and a database subnet has no reason to use a general internet route. Review the actual table associated to each subnet, including fallback to the main table, and use the most-specific matching destination.
How can an app receive customer requests without a public IP on the app instance?
An internet-facing load balancer receives the public connection through its listener and contacts the app target through its private address. The app's allowed source can be the load balancer's security group where supported by the design. The customer-facing DNS and certificate belong to the public entry. The private service still needs a correct listener, relevant health checks and application authorization.
What is the practical difference between an internet gateway and a public NAT gateway?
An internet gateway gives the VPC an internet route target and performs public/private IPv4 mapping for an associated public address. In the private-worker design, the NAT gateway translates outbound IPv4 traffic and the internet gateway presents the relevant public address on the public path. New unsolicited inbound internet traffic does not use that NAT gateway as a path to the worker. Public application ingress needs its own designed entry.
Does a security group rule replace a route or a network ACL?
A security group allows matching traffic for the associated resource and handles eligible return traffic statefully. The route still has to deliver the packets. If traffic crosses policy boundaries subject to subnet ACLs, those rules are evaluated separately in each direction. Then a listening service and application controls determine whether the requested operation can actually run.
Why do you save the database endpoint rather than an example private IP?
A managed endpoint is the service name clients use. Its backing addresses can change under service maintenance or failover. Establish private name visibility and approved connectivity to the endpoint before the workload uses it. This also helps a client maintain a stable configuration when the provider changes the underlying placement.
Check your AWS diagram one decision at a time
Which scope applies to an ordinary AWS subnet? A. One Availability Zone. B. All zones in all Regions. C. The entire AWS account.
Show answer
A. A subnet is created in a single Availability Zone in the VPC's Region. A VPC can span multiple zones with different subnets. A design that places app targets in two zones plans a separate subnet allocation for each intended location.
The app route table has the VPC range
10.40.0.0/16local and0.0.0.0/0to NAT. Which applies to10.40.30.40? A. Default to NAT. B. Local route. C. Both paths at once.Show answer
B. The address matches both prefixes, but the VPC's local prefix is more specific. It wins in this example. A local route tells you how the packet is directed and still leaves policy and listener checks to verify.
What configuration helps a private application target serve a public website through an Application Load Balancer? A. Working public HTTPS listener, private target path and intended target permissions. B. A public IPv4 on the database. C. Removal of all subnet routes.
Show answer
A. The load balancer accepts the public request and makes its own backend connection to a private target. The target needs matching listener and health check configuration under the approved policy. The database can remain on its private path.
An AWS CLI subnet route table query by explicit subnet association returns an empty result. What do you inspect next? A. The VPC's main table after verifying the subnet, permissions and Region. B. An unrelated VPC in another Region. C. The site certificate only.
Show answer
A. A subnet without an explicit route association can use the VPC's main route table implicitly. First ensure the query was authorized and targeted the actual existing subnet. Then identify the VPC's main association and inspect its routes.
What does healthy load balancer target status establish? A. Every customer function will work. B. Its configured health check is satisfied under current observations. C. The target can be publicly addressed from any network.
Show answer
B. The result is tied to the configured target check. It gives useful evidence about the target path and endpoint that answered under that check. A complete tracking operation still depends on caller access, application behavior and the data path that operation uses.
Revision cards
- Region and subnet
- A VPC belongs to a Region. Each subnet belongs to one Availability Zone. Place related copies in different zone-specific subnets when the design calls for it.
- Effective route table
- Find the explicit subnet association or the VPC main route table. The longest matching destination prefix wins when lengths differ.
- Public IPv4 path
- A public subnet has an internet gateway route. Direct IPv4 for an instance also requires the intended public association, policy and listener.
- Public ingress and private egress
- A public load balancer can receive a customer's request. A public NAT gateway can carry a private worker's permitted outbound request. Write the two flows separately.
- Policy and operations
- A security group tracks eligible flow replies. A network ACL evaluates each direction at subnet scope. Application access is its own check.
- Database endpoint
- Connect to the intended service name using a private route and authorized application credentials. Leave room for backing address changes.
References
- How Amazon VPC works
- Default VPC components and behavior
- AWS subnet CIDR sizes and reservations
- VPC route table associations
- AWS route priority and longest prefix match
- Internet gateways and IPv4 association
- Security groups
- Network ACLs
- Elastic network interfaces
- Selecting an EC2 Region
- Application Load Balancer subnet and availability requirements
- Application Load Balancer target health checks
- Route 53 DNS records for a load balancer
- RDS database endpoints and subnet groups
- AWS NAT gateways
- Regional NAT gateway configuration
- VPC endpoints for Amazon S3
- AWS CLI describe-subnets
- AWS CLI describe-route-tables
- RFC 5737 IPv4 documentation prefixes