---
title: "Quiz: Cloud Networking: Virtual Networks, Subnets and Gateways"
domain: cloud-computing
level: intermediate
questions: 10
---

# Quiz: Cloud Networking: Virtual Networks, Subnets and Gateways

## Questions

### 1. A company uses `10.0.0.0/8` on premises: the offices use `10.10.0.0/16` and the data centres use `10.20.0.0/16`. It plans a first cloud VPC, which it will later join to the office network with a site-to-site VPN. Which VPC range is the right choice?
*Objective: 1. Design a virtual network (VPC) with public and private subnets across availability zones, choosing non-overlapping address ranges.*

- A) `10.10.64.0/18`, because it is a small range that is easy to remember.
- B) `10.50.0.0/16`, because it is private and doesn't overlap any range already in use.
- C) `10.0.0.0/8`, because a bigger range leaves more room to grow.
- D) `203.0.113.0/24`, because a public-looking range avoids clashes with private networks.

### 2. An application must stay up if one availability zone (AZ) fails, and its servers must not be reachable directly from the Internet. Which layout meets both requirements?
*Objective: 1. Design a virtual network (VPC) with public and private subnets across availability zones, choosing non-overlapping address ranges.*

- A) One public subnet in one AZ with two servers, each with a firewall rule that allows only the load balancer.
- B) Two private subnets in the same AZ, so that the servers fail independently of each other.
- C) A public subnet (load balancer, NAT gateway) and a private subnet (servers) in each of two AZs.
- D) One large private subnet that spans both AZs, with one NAT gateway in a single AZ.

### 3. A subnet's route table is shown below. Where does the VPC send a packet for `10.21.4.4`, and why?
*Objective: 2. Explain how route tables, the Internet gateway and the NAT gateway decide where traffic goes.*

```text
Destination      Target
10.20.0.0/16     local
10.21.0.0/16     pcx-1   (peering connection)
0.0.0.0/0        nat-a
```

- A) To `pcx-1`, because `10.21.0.0/16` is a longer match than `0.0.0.0/0`.
- B) To `nat-a`, because the default route catches all traffic that is not local.
- C) To `local`, because every `10.x.x.x` address is inside the VPC.
- D) It is dropped, because a route table can't contain two private ranges.

### 4. A server has a public IP address and runs a web server, and its security group allows TCP 443 from anywhere. Users on the Internet can't connect. The server's subnet has this default route: `0.0.0.0/0 → nat-a`. What is the cause and the fix?
*Objective: 2. Explain how route tables, the Internet gateway and the NAT gateway decide where traffic goes.*

- A) The security group needs an outbound rule for TCP 443; add it.
- B) The NAT gateway blocks outbound traffic; replace it with a bigger one.
- C) The public IP is not in the route table; add a route to it.
- D) The subnet is private, because its default route goes to a NAT gateway, which is outbound only; route it to an Internet gateway, or put a load balancer in a public subnet in front of it.

### 5. Which description of the two filter layers is correct?
*Objective: 3. Compare stateful security groups with stateless network access control lists (ACLs), and write rules for a two-tier application.*

- A) Security groups are attached to subnets and are stateless; network ACLs are attached to interfaces and are stateful.
- B) Security groups are attached to interfaces, are stateful and have only allow rules; network ACLs are attached to subnets, are stateless and have numbered allow and deny rules.
- C) Both are stateful, but only network ACLs support deny rules.
- D) Both are attached to subnets, and the rule with the highest number is evaluated first.

### 6. A web server's security group has one inbound rule, TCP 443 from `0.0.0.0/0`, and no outbound rules at all. A client opens `https://203.0.113.10`. What happens?
*Objective: 3. Compare stateful security groups with stateless network access control lists (ACLs), and write rules for a two-tier application.*

- A) The page loads, because the reply to an allowed connection is allowed automatically; only connections that the server starts are blocked.
- B) The client's request arrives but the reply is dropped, so the page times out.
- C) The page loads, but only if the ACL also allows port 443 out.
- D) The request is dropped, because a security group needs a matching rule in both directions.

### 7. An administrator at `198.51.100.7` can't connect to a server by SSH. The subnet's network ACL has these inbound rules, and the security group allows TCP 22 from `198.51.100.7`. Which statement explains the symptom, and what should be changed?
*Objective: 5. Troubleshoot reachability problems caused by routes, NAT or filtering rules.*

```text
Rule   Action   Protocol/port   Source
100    deny     tcp 22          198.51.100.0/24
200    allow    tcp 22          0.0.0.0/0
*      deny     all             any
```

- A) The ACL should be stateful: replace it with a security group.
- B) Rule 200 is evaluated first because it has the highest number; delete rule 100.
- C) The security group rule is ignored when an ACL exists; remove the security group.
- D) Rule 100 matches first and denies the address; the first match wins, so move an allow for `198.51.100.7` before it, with a lower number.

### 8. Staging VPC S is peered with production VPC P, and P is peered with a shared-services VPC T (logging, directory). The staging team wants its servers to send logs to T. The ranges don't overlap, and routes and filters on the S–P and P–T peerings are correct. What happens, and why?
*Objective: 4. Explain how virtual networks are connected (peering, transit hubs, VPN) and why peering is not transitive.*

- A) It works, because P forwards traffic between its two peers.
- B) It works only if S uses a NAT gateway to hide its addresses from P.
- C) It fails, because peering is not transitive: S needs its own peering with T, or both must attach to a transit hub.
- D) It fails, because a VPC may have only one peering connection at a time.

### 9. A company has eight VPCs, and every pair of them must be able to communicate, with central control over which pairs are allowed. Which approach fits best?
*Objective: 4. Explain how virtual networks are connected (peering, transit hubs, VPN) and why peering is not transitive.*

- A) A full mesh of peerings: 28 connections, each with its own routes, with no central control point.
- B) A transit hub: each VPC has one attachment, and the hub's route tables decide which pairs may talk.
- C) A site-to-site VPN between every pair of VPCs over the Internet.
- D) A single shared NAT gateway, so that all VPCs appear as one address.

### 10. From a server in a private subnet, `curl https://example.com` fails immediately with "Network is unreachable", with no waiting. Which cause fits this symptom best?
*Objective: 5. Troubleshoot reachability problems caused by routes, NAT or filtering rules.*

- A) The subnet's route table has no default route, so no route matches the destination.
- B) A network ACL denies outbound TCP 443, so the packets are dropped.
- C) The NAT gateway was deleted, so the replies can't come back.
- D) The security group has no outbound rule for TCP 443.

---

## Answer key

<details>
<summary>Show answers</summary>

| # | Answer | Explanation |
|---|---|---|
| 1 | B | `10.50.0.0/16` is private (RFC 1918) and outside both on-premises ranges, so the VPN can route to it. A lies inside the offices' `10.10.0.0/16` and C contains every on-premises range, so both overlap; D is a public documentation range, not a private one. |
| 2 | C | One public and one private subnet per AZ gives the load balancer and NAT gateway in front, the servers out of reach, and no single-zone dependency. A and B keep everything in one AZ; D makes the NAT gateway in one AZ a single point of failure for both. |
| 3 | A | Longest prefix match: `10.21.0.0/16` (16 bits) beats `0.0.0.0/0` (0 bits), so the packet goes to the peering connection. The default route is only used when nothing more specific matches, and `10.21.4.4` is not in the local range `10.20.0.0/16`. |
| 4 | D | A default route to a NAT gateway makes the subnet private: the NAT gateway is outbound only and has no entry for connections started from the Internet. The security group and public address are fine; it needs a route to an Internet gateway (or a public load balancer in front). |
| 5 | B | Security groups: on interfaces, stateful, allow-only. Network ACLs: on subnets, stateless, ordered, allow and deny. A swaps them, C wrongly says ACLs are stateful, and in D ACL rules are evaluated lowest number first. |
| 6 | A | Security groups are stateful: the reply to an allowed inbound connection is allowed whatever the outbound rules say. The missing outbound rules only block connections the server itself starts. B and D describe a stateless filter. |
| 7 | D | ACL rules are evaluated in number order and the first match wins: rule 100 denies the whole `198.51.100.0/24` before the allow of rule 200 is reached. Add an allow for `198.51.100.7` with a number below 100. B is wrong because the lowest number goes first, and the security group is a separate layer that doesn't override the ACL. |
| 8 | C | A peering connects exactly two VPCs and is not transitive: P doesn't forward S's traffic to T. S needs a peering with T (with routes and filters), or all three can attach to a transit hub. NAT doesn't change this, and a VPC can have many peerings. |
| 9 | B | A transit hub scales with one attachment per VPC and gives one place to control which pairs communicate. A full mesh needs 8 × 7 / 2 = 28 peerings, each with its own routes. A VPN per pair is slower and more complex, and a NAT gateway is for outbound access, not for joining networks. |
| 10 | A | "Network is unreachable" immediately means the sender's route table has no matching route: the packet never leaves the instance. Filter drops (B, D) and missing NAT or return path (C) produce a silent timeout instead. |

</details>
