Skip to content

Static Routing — Manually Defining Paths Between Networks

Static Routing is a routing method where network administrators manually configure routes in a router or Linux system. Unlike dynamic routing protocols, static routes do not change automatically when the network topology changes. They are simple, predictable, secure, and ideal for small networks, branch offices, default routes, and specific routing requirements. Every Linux administrator, DevOps engineer, Cloud Architect, Platform Engineer, Site Reliability Engineer (SRE), and Network Engineer should understand when and how to use static routing.


Learning Path

Networking Mastery → Module 5: Routing → Lesson 2

Difficulty: Beginner

Reading Time: 90 Minutes

Course Progress

Course: Networking Mastery

Module: Routing

Lesson: 2 of 10


What You'll Learn

After completing this lesson, you'll be able to:

  • Understand Static Routing
  • Configure static routes
  • Learn default static routes
  • Understand next-hop routing
  • Learn recursive routing
  • Understand floating static routes
  • Configure static routes in Linux
  • Apply static routing in enterprise environments

Prerequisites

Complete:


Why Learn Static Routing?

Imagine two office networks:

Office A

192.168.10.0/24

Router A

Router B

Office B

192.168.20.0/24

Router A must know:

How do I reach

192.168.20.0/24?

One solution is:

Static Route

What is Static Routing?

A Static Route is a manually configured route that tells a router how to reach a destination network.

Example:

Destination

192.168.20.0/24


Next Hop

192.168.1.2

The router always forwards traffic using this path.


Static Routing Workflow

Packet Arrives


Routing Table Lookup


Static Route Found


Forward Packet


Next Hop

Example Network

LAN A


Router A


Router B


LAN B

Networks:

LAN A

192.168.10.0/24
LAN B

192.168.20.0/24

Router A requires a route to LAN B.


Static Route Entry

Example:

Destination Next Hop
192.168.20.0/24 192.168.1.2

When packets are destined for:

192.168.20.x

Router A forwards them to:

192.168.1.2

Direct vs Static Routes

Direct Route:

Connected Interface


Automatically Added

Static Route:

Administrator


Manually Configured

Next-Hop Address

The Next Hop is the IP address of the next router in the path.

Example:

Destination

10.1.1.0/24


Next Hop

172.16.0.2

The router forwards the packet to 172.16.0.2.


Exit Interface

Some platforms allow a route to reference an interface instead of a next-hop address.

Example:

Destination

192.168.30.0/24


Exit Interface

eth1

The router sends packets out through eth1.


Recursive Routing

Example:

Destination

192.168.20.0/24


Next Hop

192.168.1.2

Before forwarding, the router must determine:

How do I reach

192.168.1.2?

This additional lookup is called Recursive Routing.


Default Static Route

Instead of configuring many individual routes:

192.168.x.x

10.x.x.x

172.x.x.x

Use one default route:

0.0.0.0/0

Everything not matched elsewhere follows the default route.


IPv6 Static Route

IPv6 uses the same concept.

Default Route:

::/0

Example:

Destination

2001:db8:20::/64


Next Hop

2001:db8:1::2

Floating Static Route

A Floating Static Route acts as a backup route.

Example:

Primary Route:

Dynamic Routing

Administrative Distance

110

Backup Static Route:

Administrative Distance

200

The backup route is used only if the primary route becomes unavailable.


Administrative Distance

Administrative Distance (AD) measures the trustworthiness of a route source.

Common examples:

Route Type Administrative Distance
Connected 0
Static 1
OSPF 110
RIP 120

Lower values are preferred.

Note: Default administrative distances may vary slightly between vendors.


Advantages of Static Routing

  • Simple
  • Predictable
  • Low CPU Usage
  • No Routing Protocol Traffic
  • Better Security
  • Full Administrative Control

Disadvantages of Static Routing

  • Manual Configuration
  • Difficult to Scale
  • No Automatic Failover
  • High Maintenance
  • Not Suitable for Large Networks

Enterprise Example

Branch Office:

Small Office


Router


Head Office

Only one path exists.

A static default route is sufficient.


Cloud Perspective

Cloud platforms commonly use static routes inside:

  • Virtual Private Cloud (VPC) Route Tables
  • Virtual Networks
  • Transit Gateways
  • Virtual Private Network (VPN) Connections
  • Hybrid Cloud Networks

Administrators define routes manually to control traffic flow.


Kubernetes Perspective

Kubernetes nodes automatically receive routes from the Container Network Interface (CNI).

However, static routes may still be used for:

  • Hybrid Clusters
  • External Storage Networks
  • On-Premises Connectivity
  • Specialised Network Integrations

Linux Perspective

Display routing table.

ip route

Add a static route.

sudo ip route add 192.168.20.0/24 via 192.168.1.2

Add a default route.

sudo ip route add default via 192.168.1.1

Delete a route.

sudo ip route del 192.168.20.0/24

Display IPv6 routes.

ip -6 route

Add an IPv6 static route.

sudo ip -6 route add 2001:db8:20::/64 via 2001:db8:1::2

Static Routing Workflow

Packet Arrives


Read Destination IP


Lookup Static Route


Forward to Next Hop


Destination Network

Static Routing Example

Client


Router A


Router B


Server

Router A:

192.168.20.0/24


192.168.1.2

Router B:

192.168.10.0/24


192.168.1.1

Communication succeeds in both directions.


Hands-on Lab

Task 1

Display your routing table.

ip route

Task 2

Add a static route.

sudo ip route add 192.168.20.0/24 via 192.168.1.2

Task 3

Verify the route.

ip route

Task 4

Delete the route.

sudo ip route del 192.168.20.0/24

Task 5

Display IPv6 routes.

ip -6 route

Task 6

Add an IPv6 static route.

sudo ip -6 route add 2001:db8:20::/64 via 2001:db8:1::2

Task 7

Draw a network containing:

  • Two Routers
  • Two LANs

Show how static routes enable communication.


Task 8

Compare:

  • Connected Routes
  • Static Routes
  • Dynamic Routes

Linux Commands

Command Purpose
ip route Display IPv4 routing table
ip route add Add static route
ip route del Delete static route
ip -6 route Display IPv6 routing table
ip -6 route add Add IPv6 static route

Common Mistakes

❌ Forgetting the return route.

✅ Configure routes in both directions when required.


❌ Incorrect next-hop address.

✅ Verify the next hop is reachable.


❌ Using static routes in large dynamic networks.

✅ Prefer dynamic routing protocols for scalability.


❌ Forgetting the default route.

✅ Configure a default route for Internet access.


❌ Ignoring route verification.

✅ Always verify routing tables after configuration.


Best Practices

  • Use static routes for small, stable networks.
  • Use default routes for Internet-bound traffic.
  • Document all static routes.
  • Use floating static routes for backup paths.
  • Verify route reachability after deployment.
  • Prefer dynamic routing for large enterprise environments.

Interview Questions

Beginner

  1. What is a static route?
  2. What is a next-hop address?
  3. What is a default route?
  4. What is the difference between a connected route and a static route?

Intermediate

  1. Explain recursive routing.
  2. What is a floating static route?
  3. What is Administrative Distance?
  4. When should static routing be used?

Architect Level

  1. Design a branch office network using static routing.
  2. When would you choose static routing instead of dynamic routing?
  3. How would you implement backup routing using floating static routes?

Summary

In this lesson, you learned:

  • Static Routing
  • Next-Hop Routing
  • Exit Interfaces
  • Recursive Routing
  • Default Routes
  • Floating Static Routes
  • Administrative Distance
  • Linux Static Route Configuration
  • Enterprise Static Routing

Static routing provides a simple, reliable, and predictable method of forwarding packets between networks. While it requires manual configuration and maintenance, it is highly effective for small, stable environments, default routes, and backup routing scenarios.


Key Takeaways

  • Static routes are manually configured.
  • Static routing is simple, secure, and predictable.
  • A next-hop address tells the router where to forward packets.
  • The default IPv4 route is 0.0.0.0/0.
  • The default IPv6 route is ::/0.
  • Floating static routes provide backup connectivity.
  • Static routing is ideal for small or stable network environments.

What's Next?

Dynamic Routing

In the next lesson, you'll learn about Dynamic Routing.

You'll explore:

  • What dynamic routing is
  • Why dynamic routing is needed
  • Routing protocols
  • Route exchange
  • Convergence
  • Metrics
  • Enterprise routing design

By the end of the lesson, you'll understand how routers automatically learn, update, and optimise routes across large enterprise and cloud networks.