Excalibur's Sheath

Routing Basics for Your Homelab: Static and Dynamic Routing Explained

Jun 22, 2025 By: Jordan McGilvray

Homelab: Mastering the Network: Part 3 of 3

In the previous guide on VLANs and traffic segmentation, we explored how to divide your homelab network into isolated segments—separating lab environments, IoT devices, and guest traffic for both performance and security. But while VLANs are a powerful tool for segmentation at Layer 2, they don’t operate in isolation. To make your VLANs communicate—or intentionally keep them apart—you need to understand routing.

That brings us to the world of Layer 3 networking, also known as routing.

Routing ties your segmented homelab together—it’s the invisible glue turning separate VLANs into a cohesive network. In this guide, you’ll learn not just what routing does, but how to implement it step-by-step, with examples on Linux, pfSense, VyOS, and ASCII diagrams to illustrate each concept.

By the end, you’ll be confidently using static routes and dipping your toes into dynamic protocols like OSPF and BGP—the same fundamentals modern networks rely on.

Understanding the OSI Model

The OSI (Open Systems Interconnection) model is a framework used to understand and design networks by breaking communication down into seven abstract layers. Each layer serves a specific function and interacts with the layers directly above and below it.

Layer Name Description
7 Application Apps (web browsers, SSH, etc.)
6 Presentation Data formatting, encryption
5 Session Connection management
4 Transport TCP/UDP, ports, flow control
3 Network IP addresses, routing
2 Data Link MAC addresses, VLANs, switching
1 Physical Ethernet cables, Wi-Fi signals

In this series so far, we’ve primarily focused on:

  • Layer 1: Hardware like switches, routers, and cabling.
  • Layer 2: VLANs, which operate at the Data Link layer.
  • Layer 3: This guide introduces the Network layer, where IP addresses, routing, and subnet boundaries live.

Understanding how Layer 2 segmentation (VLANs) connects with Layer 3 routing is essential for designing networks that are both isolated and interconnected where appropriate.

This article picks up right where the last guide left off, introducing you to Layer 3 routing in the homelab. We’ll break down the difference between static and dynamic routing, walk through real setups, and show how to configure protocols like OSPF and BGP using platforms such as pfSense, OPNsense, VyOS, or Linux-based routers.

Whether you’re interconnecting VLANs, designing multi-router test labs, or experimenting with dynamic routing protocols, mastering routing is essential for building a resilient and scalable homelab network.

Let’s get started.

Why Routing Matters in the Homelab

In a small home network, routing is often handled invisibly by your all-in-one consumer router. But as your homelab grows more complex—especially when you introduce VLANs or multiple subnets—routing becomes something you need to control directly.

Routing determines how packets move between networks. For example, if you’ve created a separate VLAN for your IoT devices and another for lab VMs, routing governs whether those networks can communicate and how. Without a proper routing configuration, devices in one VLAN might not be able to reach services in another—even if they’re physically connected to the same switch.

In homelab topologies where you’re running multiple routers, virtual firewall appliances, or segmented environments for testing, routing is the glue that connects everything logically. Understanding routing allows you to:

  • Create granular communication paths between segments.
  • Control which devices or subnets can talk to each other.
  • Simulate real-world enterprise network designs.
  • Build redundant or multi-path networks.

In short, routing is what turns a cluster of isolated network segments into an intelligently organized system. And for homelabbers aiming to grow their skills, it’s a must-have.

What is a Subnet and an IP Route?

A subnet is a smaller network segment within a larger network, defined by a range of IP addresses (like 192.168.20.0/24). It helps organize devices and control traffic boundaries.

An IP route is an instruction in a router’s routing table that tells it where to send packets destined for a specific subnet. Think of it like a GPS waypoint directing traffic to the right neighborhood.

Understanding Static Routing

Static routing gives you complete control over traffic paths. It’s perfect for small, stable setups—or when you want total clarity over your network flows.

A gateway is the device (usually a router) that acts as the “next hop” for traffic leaving your subnet. It’s the IP address where packets are sent when they need to reach a different network.

Why use it?

  • Simplicity — easy to configure, low resource usage.
  • Predictability — no surprises from protocol flaps or dynamic updates.
  • Learning ground — strong foundation before moving on to OSPF/BGP.

Pro tip: Always verify routes with ip route show before assuming a network is reachable.

What is an IP route?

An IP route is a rule in your device’s routing table that tells it where to send packets for a specific destination network (subnet). It typically includes the destination subnet and the next hop (gateway) IP address.

Step-by-step

In Linux:

ip route add 192.168.20.0/24 via 192.168.10.1
ip route show
ip route del 192.168.20.0/24 via 192.168.10.1

In pfSense/OPNsense:

  1. Navigate to System → Routing → Static Routes, click + Add.
  2. Add destination network and gateway.
  3. Apply changes, then verify with ping or traceroute.

Introduction to Dynamic Routing

When networks become more complex—or when you want routers to automatically adapt to changes—you’ll want to implement dynamic routing protocols. These protocols let routers share route information with each other, automatically learning the best paths through a network.

For example, if one router fails or a link goes down, a dynamic routing protocol like OSPF or BGP can find another path without manual intervention. This is incredibly useful in homelabs where:

  • You’re simulating enterprise environments.
  • You want to test high-availability routing.
  • You’re learning how large-scale networks operate.

Dynamic routing helps automate:

  • Route discovery.
  • Path redundancy.
  • Network topology changes.

There are several protocols to choose from—some are lightweight and beginner-friendly, while others are robust and used in production Internet backbones. In the next section, we’ll compare three key protocols: RIP, OSPF, and BGP, with homelab use cases for each.

Key Dynamic Routing Protocols (Homelab Friendly)

RIP (Routing Information Protocol)

RIP is one of the oldest dynamic routing protocols. It’s simple and easy to configure, making it a good starting point for beginners. However, RIP has limitations in scalability and convergence speed, so it’s best suited for very small homelabs or learning environments.

OSPF (Open Shortest Path First)

OSPF is a widely used protocol in enterprise networks. It supports fast convergence and scales well for medium to large networks. OSPF organizes routers into areas to optimize routing efficiency, which can be helpful in complex homelab designs with multiple subnets and VLANs.

BGP (Border Gateway Protocol)

BGP is the protocol that powers the internet’s routing. It is complex but invaluable for advanced homelabs simulating ISP or data center environments. BGP is used for inter-domain routing and supports policies and path control, making it ideal for hybrid cloud or multi-homed network labs.

Static vs. Dynamic: Choosing the Right Approach

Feature Static Routing Dynamic Routing
Complexity Simple, manual configuration Automated, protocol-based
Scalability Best for small networks Best for large, changing networks
CPU/Memory Usage Low Higher due to protocol overhead
Flexibility Limited Highly adaptable
Use Case Small, stable setups Growing or complex labs

Hybrid models often combine static cores with dynamic routing in lab segments, balancing control and automation.

Configuring Dynamic Routing in the Lab

FRRouting or Quagga on Linux/pfSense

Both FRRouting and Quagga are open-source routing suites supporting various protocols like OSPF and BGP. They can be installed on Linux routers or appliances like pfSense via packages.

VyOS as an All-in-One Routing Platform

VyOS is a Linux-based router OS designed for advanced routing. It provides CLI configuration similar to enterprise gear and supports static and dynamic routing protocols.

OSPF Configuration Example (VyOS CLI style)

set protocols ospf area 0 network 192.168.0.0/16
commit
save

View OSPF neighbors on pfSense (command line)

vtysh -c "show ip ospf neighbor"

Visual Examples and Lab Topologies

Static Routing Topology (ASCII Diagram)

[Router1] ---eth0--- [Switch VLAN10] --- Devices in 192.168.10.0/24
   |
   | Static Route to 192.168.20.0/24 via Router2
   |
[Router2] ---eth1--- [Switch VLAN20] --- Devices in 192.168.20.0/24

Two routers connected with static routes allow VLAN 10 and VLAN 20 to communicate.

Dynamic Routing (OSPF) Topology (ASCII Diagram)

[Router1]----\
              \
               [Router3]----[Router4]
              /
[Router2]----/

OSPF enables routers to discover neighbors automatically and share routes dynamically.

Troubleshooting Flowchart (ASCII Decision Tree)

Is the route in the routing table?
   |
  Yes ------------------> Is traffic reaching destination?
   |                             |
  No                         Yes      No
   |                           |        |
Add route or check configs    Check firewall or interfaces

Security Considerations in Routing

  • Use route filtering to control which routes are accepted or advertised, preventing malicious or incorrect routing updates.
  • Implement firewall rules on inter-VLAN routing to limit unnecessary traffic between segments, reducing attack surfaces.
  • Monitor routing protocol peers to detect unauthorized neighbors.

How Routing Affects Network Performance

  • Efficient routing reduces latency by choosing optimal paths.
  • Dynamic routing protocols can introduce CPU overhead on routers, especially with many routes.
  • Misconfigured routes may cause loops or blackholes, leading to dropped packets and slow connections.

Conclusion

Mastering Layer 3 routing opens up powerful possibilities for your homelab. It allows you to intelligently connect segmented networks, simulate real-world enterprise environments, and build scalable, resilient topologies tailored to your needs.

By starting with static routes, you gain a solid foundation in how traffic flows between networks. Moving into dynamic routing protocols like OSPF and BGP introduces automation, adaptability, and deeper insight into how large-scale networks manage complexity and redundancy.

These skills are not just academic — they translate directly into real-world networking, from managing corporate infrastructures to cloud architectures and beyond. As you experiment and refine your routing setups, you’ll develop troubleshooting strategies and architectural best practices that are invaluable for any IT or networking professional.

So, ready to take your homelab to the next level? Grab your routers, configure your routes, and explore the fascinating world of Layer 3 networking!

Happy routing!

Tools Mentioned

For a deeper dive into networking tools and commands, check out these guides on Excalibur’s Sheath:

More from the "Homelab: Mastering the Network" Series: