---
title: "Quiz: Routing Fundamentals"
domain: networking
level: intermediate
questions: 10
---

# Quiz: Routing Fundamentals

## Questions

### 1. A router has a static route to `10.20.0.0/16` and an OSPF route to `10.20.8.0/21`. It receives a packet for `10.20.12.7`. Which route does it use?
*Objective: 1 — Explain how a router forwards a packet*

- A) The static route, because its administrative distance (1) is lower than OSPF's (110)
- B) The OSPF route, because `10.20.8.0/21` is the longer prefix and longest prefix match is applied first
- C) Both routes, alternating packets, because both cover the destination
- D) Neither: the router drops the packet because two sources disagree

### 2. A Cisco router with default settings learns `10.50.0.0/16` from three places: RIP with a metric of 2, OSPF through neighbour X with a cost of 30, and OSPF through neighbour Y with a cost of 20. Which route is installed?
*Objective: 1 — Explain how a router forwards a packet*

- A) The RIP route, because 2 is the lowest metric
- B) Both OSPF routes, because OSPF always shares the load between all its paths
- C) The RIP route and the OSPF route through Y, sharing the load
- D) The OSPF route through Y: OSPF's administrative distance (110) beats RIP's (120), then the lower cost wins

### 3. A Linux router has `eth0` with `172.16.4.1/24` and `eth1` with `192.168.1.1/24`. An administrator runs this command:
*Objective: 2 — Configure static routes and a default route*

```text
$ sudo ip route add 10.9.0.0/16 via 172.16.5.1
Error: Nexthop has invalid gateway.
```

What is the cause?

- A) A route to `10.9.0.0/16` already exists
- B) IP forwarding is disabled on the router
- C) `172.16.5.1` is not inside any subnet the router is directly connected to
- D) `10.9.0.0/16` is not a valid network address

### 4. Branch router BR has the LAN `10.40.1.0/24` and a single /30 link to the head-office router HQ (HQ is `10.0.40.1`, BR is `10.0.40.2`). HQ already has a default route to the Internet. There is no dynamic routing. Which static routes let branch users reach the head office and the Internet, and receive the replies?
*Objective: 2 — Configure static routes and a default route*

- A) On BR: `default via 10.0.40.1`. On HQ: `10.40.1.0/24 via 10.0.40.2`.
- B) On BR: `default via 10.0.40.1`. Nothing on HQ, because replies follow the same path back automatically.
- C) On BR: `10.40.1.0/24 via 10.0.40.1`. On HQ: `default via 10.0.40.2`.
- D) On HQ only: `default via 10.0.40.2`.

### 5. A small office has one router with two LAN subnets and a single Internet uplink. The network rarely changes and there are no other routers. Which routing approach fits best?
*Objective: 3 — Compare static and dynamic routing, and distance-vector and link-state protocols*

- A) OSPF with a separate area for each subnet, so that changes are detected quickly
- B) BGP with the provider, receiving the full Internet routing table
- C) The connected routes for the two LANs, plus a static default route toward the provider
- D) RIP on the router, so that it learns its own LAN subnets

### 6. In a large network, a link fails. Why does a link-state protocol usually converge faster than a distance-vector protocol?
*Objective: 3 — Compare static and dynamic routing, and distance-vector and link-state protocols*

- A) Link-state routers send their whole routing table to their neighbours every 30 seconds
- B) The change is flooded to every router in an LSA, and each router recomputes its paths on its own copy of the topology
- C) Link-state protocols use the hop count, which is faster to calculate than a cost
- D) Link-state protocols have a lower administrative distance, so their routes are installed first

### 7. On an FRRouting router, `show ip route` contains this line. What does it tell you?
*Objective: 4 — Describe the basics of OSPF and the role of BGP*

```text
O>* 10.8.0.0/24 [110/40] via 10.0.1.2, eth1, weight 1, 00:12:31
```

- A) The route was learned by OSPF, has administrative distance 110 and a total cost of 40, and is selected and installed with next hop `10.0.1.2`
- B) The route was learned by OSPF, has a cost of 110, and the destination is 40 hops away
- C) The route belongs to OSPF area 110 and was advertised by the router with ID 40
- D) The route was learned by OSPF but isn't used, because its distance (110) is higher than its metric (40)

### 8. Your router receives a BGP route for `203.0.113.0/24` from an eBGP neighbour, with the AS_PATH `64497 64499 64496`. Which statement is correct?
*Objective: 4 — Describe the basics of OSPF and the role of BGP*

- A) AS 64497 originated the prefix, and you received it from AS 64496
- B) The route crossed AS 64496 three times
- C) Your router rejects the route because the AS_PATH contains more than two ASes
- D) AS 64496 originated the prefix, it crossed AS 64499, and you received it from your neighbour in AS 64497

### 9. From a workstation, you trace the path to a server and get this output. What do you conclude?
*Objective: 5 — Troubleshoot routing problems*

```text
traceroute to 10.30.5.10 (10.30.5.10), 30 hops max, 60 byte packets
 1  10.20.1.1  0.412 ms  0.388 ms  0.371 ms
 2  10.255.0.2  1.104 ms  1.090 ms  1.077 ms
 3  10.255.0.6  1.932 ms !N  1.950 ms !N  *
```

- A) The server `10.30.5.10` is switched off
- B) The router at `10.255.0.6` has no route to the server's network, so you check its routing table next
- C) The router at hop 3 rate-limits ICMP, so the path probably works beyond it
- D) The return route from the server to the workstation is missing

### 10. Users in `10.20.1.0/24` can't reach a server at `10.30.5.10`. Pings fail with 100% loss and no error message. The users' router has a route to `10.30.5.0/24`, and every router on the way agrees with `ip route get 10.30.5.10`. On R-SRV, the server's gateway, you see this:
*Objective: 5 — Troubleshoot routing problems*

```text
$ ip route get 10.20.1.15
RTNETLINK answers: Network is unreachable
```

What should you do?

- A) Add a route to `10.20.1.0/24` (or a suitable default route) on R-SRV
- B) Add a `/32` route for `10.30.5.10` on the users' router, so it wins the longest prefix match
- C) Allow ICMP Time Exceeded messages on the users' router
- D) Change the server's default gateway to the users' router

---

## Answer key

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

| # | Answer | Explanation |
|---|---|---|
| 1 | B | `10.20.8.0/21` covers `10.20.8.0` to `10.20.15.255`, so both routes match, and longest prefix match is applied before administrative distance. Distance only compares routes for exactly the same prefix, so A's reasoning doesn't apply here. |
| 2 | D | Same prefix from different sources: the lowest administrative distance wins (OSPF 110 against RIP 120). Then the lowest metric wins within OSPF: cost 20. Metrics from different protocols are never compared, and OSPF only shares the load between paths with *equal* cost. |
| 3 | C | A next hop must be reachable through a connected route. `172.16.5.1` is outside `172.16.4.0/24` and `192.168.1.0/24`, so Linux rejects it. An existing route would give `File exists`, and forwarding doesn't affect adding routes. |
| 4 | A | BR is a stub, so a default route toward HQ covers everything. HQ must also know how to reach the branch LAN, or every reply is dropped (or sent to the Internet by HQ's own default route). Routing in each direction is independent, so B fails. C points the routes the wrong way. |
| 5 | C | With one exit and no other routers, a dynamic protocol has nothing to learn and nothing to react to. Connected routes cover the LANs and a default route covers everything else. The LANs are already connected routes, so RIP adds nothing (D), and a full BGP table (B) is for networks with several providers and their own routing policy. |
| 6 | B | Link-state routers flood the change once and each runs SPF on the same updated map. Sending the whole table every 30 seconds (A) and using the hop count (C) describe RIP, a distance-vector protocol. Administrative distance (D) only chooses between sources for the same prefix. |
| 7 | A | In FRRouting and Cisco IOS output, `[110/40]` is *[administrative distance/metric]*: OSPF's distance 110 and a path cost of 40. `O` means OSPF, and `>*` means selected and installed in the forwarding table. Distance and metric are never compared with each other (D). |
| 8 | D | Each AS prepends its number when it passes the route on, so the rightmost ASN (64496) is the origin and the leftmost (64497) is the neighbour you received it from. A reverses the order. There is no limit of two ASes. A router rejects a route only if its *own* ASN is in the AS_PATH. |
| 9 | B | `!N` means the router at hop 3 answered ICMP *network unreachable*: it has no route to `10.30.5.0/24` (or the address range containing it). That is a forward-path problem at a known router. A rate-limited hop shows `*`, not `!N`, and a missing return route usually gives silence, not an error. |
| 10 | A | The forward path is fine, but R-SRV has no route back to the users, so it drops the server's replies. That is why there's no error message. A `/32` on the users' side (B) doesn't change the return path, and a server can only use a gateway on its own subnet (D). |

</details>
