---
title: "Routing Fundamentals"
domain: networking
level: intermediate
duration: "3h total"
---

# Routing Fundamentals

Every packet that leaves its local network is passed from router to router until it arrives. This module explains how a router decides where each packet goes, how to configure static and default routes, how dynamic routing protocols build routing tables for you, what OSPF and BGP do, and how to troubleshoot a path that doesn't work.

## Learning objectives
By the end of this module you will be able to:
1. Explain how a router forwards a packet: routing table, longest prefix match, next hop, metric and administrative distance.
2. Configure static routes and a default route.
3. Compare static and dynamic routing, and distance-vector and link-state protocols.
4. Describe the basics of Open Shortest Path First (OSPF) and the role of the Border Gateway Protocol (BGP) between networks on the Internet.
5. Troubleshoot routing problems with `traceroute`, `ip route get` and reasoning about return paths.

## Prerequisites
- [06 — Subnetting](../06-subnetting/README.md) and [09 — Switching and VLANs](../09-switching-vlans/README.md).
- For the lab: a Linux machine or virtual machine (VM) with `sudo` and iproute2. The optional OSPF part also needs Podman or Docker to run FRRouting containers.

## Contents
| Type | Duration |
|---|---|
| [Theory](lesson.md) | 60 min |
| [Hands-on lab: three routers with static routes, then OSPF](lab.md) | 75 min |
| [Assessment (10 questions)](quiz.md) | 20 min |

## Further reading
- [RFC 1812](https://www.rfc-editor.org/rfc/rfc1812) — Requirements for IP Version 4 Routers
- [RFC 2328](https://www.rfc-editor.org/rfc/rfc2328) — OSPF Version 2
- [RFC 4271](https://www.rfc-editor.org/rfc/rfc4271) — A Border Gateway Protocol 4 (BGP-4)
- [FRRouting documentation](https://docs.frrouting.org/)
