[Day 7] 1. Static Routes
Network Topology
Consider a network with three routers—A, B, and C—connected in a triangular fashion:
-
Router A:
172.16.10.1/24172.16.20.1/24172.16.60.1/24
-
Router B:
172.16.20.2/24172.16.30.1/24172.16.40.1/24
-
Router C:
172.16.60.2/24172.16.40.2/24
Routing Configuration
If the path via Router B fails, Router A will have an alternate path via Router C, but this is not the primary route—it is an alternate route.
Primary Route (via Router B):
A(config)# ip route 172.16.30.0 255.255.255.0 172.16.20.2
Alternate Route (via Router C):
A(config)# ip route 172.16.30.0 255.255.255.0 172.16.60.2 5
- The 5 in the second command is called the Administrative Distance (AD).
Administrative Distance (AD)
-
By default, AD is set to
for directly connected and static routes.1 -
AD can range from 0 to 255.
- Lower AD values are preferred.
- Higher AD values are less preferred.
For example, if we wrote
instead of0in the second command, the route via Router C would be preferred since the AD would be lower. However, this could make the longer path (via C) the primary route, which might not be desirable.5
Syntax for Static Route Configuration
-
Basic Static Route Command:
ip route <Destination> <Subnet Mask> <Next-Hop Address> <Administrative Distance> -
Permanent Static Route:
ip route <Destination> <Subnet Mask> <Next-Hop Address> <Administrative Distance> permanentThe permanent keyword ensures that the static route remains in the routing table even if the primary path becomes unreachable.
Example with Alternate Path (Router C as 172.16.50.0)
We can consider Router C's network as
172.16.50.0However, as the number of routers increases, programming static routes can become complicated. To solve this, we use Dynamic Routing protocols.
Read Next
[Day 7] 2. Dynamic Routes
### **Dynamic Routing** Dynamic routing refers to the process by which routers automatically learn and update routes in the routing table based on...
[Day 7] 3. RIP Configuration
### **RIP Configuration Scenario** #### **Network Setup** - **Router A**: - `172.16.10.1/24`, `202.208.220.1/24` - **Router B**: - `1...