Part 18 – Static Route Configuration

Static Route Configuration

Introduction

Welcome to Part 18 of the Network Fundamentals study notes! If you haven’t already, we recommend watching the video first.

Moving traffic between networks is one of the most important jobs in networking. In this part — the first of three on routing — we look at how routers make forwarding decisions, how to read a routing table, and how to configure static routes.

Routers and Layer 3 Switches

When we say “router”, we mean any device that routes packets between networks. Dedicated routers are still common — especially for internet connections and WAN links — but many modern switches are also capable of routing. These are called layer 3 switches or multi-layer switches, and they’re particularly useful for routing traffic between VLANs. The routing principles covered here apply equally to both.

The Routing Table

Every layer 3 device maintains a routing table — a list of known networks and how to reach them. You can view it with show ip route. Each entry has a code on the left that indicates where the route came from:

  • C – connected route: a network the router is directly attached to via one of its interfaces
  • L – local route: the router’s own IP address within a connected network, shown as a /32 (a host route pointing to a single address)
  • S – static route: manually configured by an administrator

Connected and local routes appear in the routing table automatically whenever an active interface is configured with an IP address. A router starts by knowing only what it’s directly connected to — it needs to be told (or learn) about everything else.

Next to each network entry you’ll see the prefix and subnet mask in CIDR notation, and information about which interface the router uses to reach it. You’ll also see numbers in square brackets — we’ll explain those in Part 19.

Static Routes

To reach networks that aren’t directly connected, we can configure a static route. The command is:

ip route <destination-network> <subnet-mask> <next-hop-ip>

The next-hop IP is the address of the next router along the path — it must be in a network that this router is directly connected to. For example, if R5 and R3 are both connected to the same network, R5 can use R3’s IP as its next hop to reach networks beyond R3.

An alternative form uses an outgoing interface instead of a next-hop IP. The router will then use ARP to find the next-hop dynamically. This works in simple two-router scenarios, but using an explicit next-hop IP is generally preferred.

Static Routes and Link Failures

If the interface connecting to the next-hop network goes down, the static route is automatically removed from the routing table. When the interface comes back up, the route reappears.

You can override this with the permanent keyword at the end of the route command. This keeps the route in the table regardless of interface state — but it doesn’t make the route work; it just prevents it from being removed. Use this carefully.

There’s a more subtle failure scenario worth understanding. If a distant link fails — one that the router isn’t directly connected to — the local interface stays up, so the static route stays in the routing table. But traffic using that route flows into a black hole, silently dropped. This is a key limitation of static routing: it isn’t aware of what’s happening further down the path.

How Packets Are Forwarded

Here’s what happens when a packet arrives at a router:

  1. The router checks the Ethernet frame for errors (FCS). If the frame is corrupt, it’s discarded.
  2. The frame is decapsulated, leaving just the IP packet.
  3. The router reads the destination IP address and looks it up in the routing table.
  4. If a matching route is found, the router determines the next-hop IP and uses ARP to get its MAC address.
  5. The packet is re-encapsulated with a new Ethernet frame (new source and destination MACs) and forwarded out the appropriate interface.
  6. If no matching route is found, the packet is dropped.

Each router along the path makes its own independent forwarding decision based on its own routing table. A router will not check whether the next hop is reachable — if it forwards to an unreachable next hop, the packet is dropped there.

Also remember: routing is bidirectional. If you configure a route so R5 can reach a network on R3, you also need to make sure R3 has a route back to wherever R5’s traffic came from. A common mistake is configuring the forward path but forgetting the return path.

Default Routes

A default route is a catch-all — if no more specific route exists for a destination, the router uses the default. It’s configured as:

ip route 0.0.0.0 0.0.0.0 <next-hop-ip>

The destination 0.0.0.0 0.0.0.0 matches everything. You’ll see it appear in the routing table marked with an asterisk (*), which means “candidate default”. It’s also shown at the top of the routing table as the gateway of last resort.

The most common use case is internet access — you can’t have a specific route for every destination on the internet, so you point a default route at your upstream router. Default routes are also useful for “stub” networks — routers with only one way in and out. Rather than listing every network in the topology, just configure a single default route.

Floating Static Routes

A floating static route is a backup route that sits in the background, only becoming active when a primary route disappears. It works by assigning a higher administrative distance to the backup route.

For example, if you have a primary route with AD 1 (the default for static routes), you can configure a backup route over a different path with AD 20. Under normal conditions, the primary route (lower AD) is used and the backup stays hidden. If the primary interface fails and its route is removed, the backup with AD 20 takes its place.

This gives static routing a basic form of redundancy — without needing a dynamic routing protocol.

Resources

Test your knowledge with the Introduction to Networking quizzes.