Computer Networks

[Day 7] 1. Static Routes

D
DITISS Admin
••3 min read

Network Topology

Consider a network with three routers—A, B, and C—connected in a triangular fashion:

  • Router A:

    • 172.16.10.1/24
    • 172.16.20.1/24
    • 172.16.60.1/24
  • Router B:

    • 172.16.20.2/24
    • 172.16.30.1/24
    • 172.16.40.1/24
  • Router C:

    • 172.16.60.2/24
    • 172.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

    1
    for directly connected and static routes.

  • AD can range from 0 to 255.

    • Lower AD values are preferred.
    • Higher AD values are less preferred.

    For example, if we wrote

    0
    instead of
    5
    in 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.


Syntax for Static Route Configuration

  1. Basic Static Route Command:

    ip route <Destination> <Subnet Mask> <Next-Hop Address> <Administrative Distance>
    
  2. Permanent Static Route:

    ip route <Destination> <Subnet Mask> <Next-Hop Address> <Administrative Distance> permanent
    

    The 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.0
. In this scenario, we have alternate paths for every router to reach another, making two options available for each router.

However, as the number of routers increases, programming static routes can become complicated. To solve this, we use Dynamic Routing protocols.


Read Next

8/26/2026

[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...

8/26/2026

[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...