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¶
Course Progress
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:
↓
↓
↓
Router A must know:
One solution is:
What is Static Routing?¶
A Static Route is a manually configured route that tells a router how to reach a destination network.
Example:
The router always forwards traffic using this path.
Static Routing Workflow¶
Example Network¶
Networks:
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:
Router A forwards them to:
Direct vs Static Routes¶
Direct Route:
Static Route:
Next-Hop Address¶
The Next Hop is the IP address of the next router in the path.
Example:
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:
The router sends packets out through eth1.
Recursive Routing¶
Example:
Before forwarding, the router must determine:
This additional lookup is called Recursive Routing.
Default Static Route¶
Instead of configuring many individual routes:
Use one default route:
Everything not matched elsewhere follows the default route.
IPv6 Static Route¶
IPv6 uses the same concept.
Default Route:
Example:
Floating Static Route¶
A Floating Static Route acts as a backup route.
Example:
Primary Route:
Backup Static Route:
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:
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.
Add a static route.
Add a default route.
Delete a route.
Display IPv6 routes.
Add an IPv6 static route.
Static Routing Workflow¶
Packet Arrives
↓
Read Destination IP
↓
Lookup Static Route
↓
Forward to Next Hop
↓
Destination Network
Static Routing Example¶
Router A:
Router B:
Communication succeeds in both directions.
Hands-on Lab¶
Task 1¶
Display your routing table.
Task 2¶
Add a static route.
Task 3¶
Verify the route.
Task 4¶
Delete the route.
Task 5¶
Display IPv6 routes.
Task 6¶
Add an IPv6 static route.
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¶
- What is a static route?
- What is a next-hop address?
- What is a default route?
- What is the difference between a connected route and a static route?
Intermediate¶
- Explain recursive routing.
- What is a floating static route?
- What is Administrative Distance?
- When should static routing be used?
Architect Level¶
- Design a branch office network using static routing.
- When would you choose static routing instead of dynamic routing?
- 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?¶
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.