# Troubleshooting with show ip route

### <mark style="color:blue;">**Course Objectives:**</mark>

By the end of this course, you will be able to:

* Understand the structure of the routing table in Cisco routers.
* Use the `show ip route` command to analyze and troubleshoot network connectivity issues.
* Identify missing, incorrect, or suboptimal routes in a network topology.
* Implement corrective measures to resolve routing issues.

### <mark style="color:blue;">**Module 1: Introduction to**</mark><mark style="color:blue;">**&#x20;**</mark><mark style="color:blue;">**`show ip route`**</mark>

#### **1.1 What is the Routing Table?**

* Definition of a routing table
* How routers forward packets based on routes
* Types of routes:
  * Directly connected routes
  * Static routes
  * Dynamic routes (RIP, EIGRP, OSPF, BGP)

#### **1.2 Understanding the `show ip route` Command**

* Syntax:

```
Router# show ip route
```

* Explanation of output fields:
  * Route codes (C = Connected, S = Static, R = RIP, etc.)
  * Network destination and subnet mask
  * Administrative distance and metric
  * Next-hop and outgoing interface

### <mark style="color:blue;">**Module 2: Practical Scenario - Troubleshooting a Routing Issue**</mark>

#### **2.1 Network Topology**

**Scenario:** A company has three routers (R1, R2, R3) connected in a triangle using OSPF. However, hosts in R1's LAN cannot reach hosts in R3's LAN.

**Topology Diagram:**

<figure><img src="/files/vDMt3pAfRULhkgDZSHDM" alt=""><figcaption><p>Topology</p></figcaption></figure>

* R1 to R2: **10.0.0.0/30**
* R2 to R3: **10.0.0.4/30**
* R1's LAN: **192.168.1.0/24**
* R3's LAN: **192.168.2.0/24**
* Routing Protocol: OSPF

#### **2.2 Configuring the Routers**

* Step 1: Basic Configuration (R1)

```
R1#configure terminal
R1(config)#interface fastEthernet 1/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 10.0.0.1 255.255.255.252
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#router ospf 1
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0
R1(config-router)#network 10.0.0.0 0.0.0.3 area 0
```

* Step 2: Basic Configuration (R2)

```
R2#configure terminal
R2(config)#interface fastEthernet 0/0
R2(config-if)#ip address 10.0.0.2 255.255.255.252
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#interface fastEthernet 1/0
R2(config-if)#ip address 10.0.0.5 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#router ospf 1
R2(config-router)#network 10.0.0.0 0.0.0.3 area 0
R2(config-router)#network 10.0.0.4 0.0.0.3 area 0
```

* Step 3: Basic Configuration (R3)

```
R3#configure terminal
R3(config)#interface fastEthernet 1/0
R3(config-if)#ip address 10.0.0.6 255.255.255.252
R3(config-if)#no shut
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface fastEthernet 0/0
R3(config-if)#ip address 192.168.2.1 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#router ospf 1
R3(config-router)#network 10.0.0.4 0.0.0.3 area 0
R3(config-router)#network 192.168.2.0 0.0.0.255 area 0
```

* Step 4: Basic Configuration (PC1)

```
PC1> ip 192.168.1.100/24 192.168.1.1
Checking for duplicate address...
PC1 : 192.168.1.100 255.255.255.0 gateway 192.168.1.1

PC1> show ip

NAME        : PC1[1]
IP/MASK     : 192.168.1.100/24
GATEWAY     : 192.168.1.1
DNS         :
MAC         : 00:50:79:66:68:00
LPORT       : 20020
RHOST:PORT  : 127.0.0.1:20021
MTU         : 1500

PC1> save
Saving startup configuration to startup.vpc
.  done

PC1>
```

* Step 5: Basic Configuration (PC2)

```
PC2> ip 192.168.2.100/24 192.168.2.1
Checking for duplicate address...
PC2 : 192.168.2.100 255.255.255.0 gateway 192.168.2.1

PC2> show ip

NAME        : PC2[1]
IP/MASK     : 192.168.2.100/24
GATEWAY     : 192.168.2.1
DNS         :
MAC         : 00:50:79:66:68:01
LPORT       : 20022
RHOST:PORT  : 127.0.0.1:20023
MTU         : 1500

PC2> save
Saving startup configuration to startup.vpc
.  done

PC2>
```

**2.3 Verify OSPF Neighbor Relationships**

Check that R1 and R2 have formed an adjacency:

* R1

```
Neighbor ID     Pri   State           Dead Time   Address         Interface
10.0.0.5          1   FULL/BDR        00:00:39    10.0.0.2        FastEthernet0/0
R1#
```

* R2

```
Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.2.1       1   FULL/BDR        00:00:37    10.0.0.6        FastEthernet1/0
192.168.1.1       1   FULL/DR         00:00:31    10.0.0.1        FastEthernet0/0
R2#
```

* R3

```
R3#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
10.0.0.5          1   FULL/DR         00:00:33    10.0.0.5        FastEthernet1/0
R3#
```

### <mark style="color:blue;">**Module 3: Troubleshooting Using**</mark><mark style="color:blue;">**&#x20;**</mark><mark style="color:blue;">**`show ip route`**</mark>

#### **3.1 Identifying the Issue**

* On **R1**, check if a route to **192.168.2.0/24** exists:

```
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C        10.0.0.0/30 is directly connected, FastEthernet0/0
L        10.0.0.1/32 is directly connected, FastEthernet0/0
O        10.0.0.4/30 [110/2] via 10.0.0.2, 00:12:08, FastEthernet0/0
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, FastEthernet1/0
L        192.168.1.1/32 is directly connected, FastEthernet1/0
O     192.168.2.0/24 [110/3] via 10.0.0.2, 00:08:48, FastEthernet0/0
R1#
```

{% hint style="danger" %}
If the route is missing, OSPF may not be learning it from R2/R3.
{% endhint %}

* On **R2**, check if it has a route to **192.168.2.0/24**:

```
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C        10.0.0.0/30 is directly connected, FastEthernet0/0
L        10.0.0.2/32 is directly connected, FastEthernet0/0
C        10.0.0.4/30 is directly connected, FastEthernet1/0
L        10.0.0.5/32 is directly connected, FastEthernet1/0
O     192.168.1.0/24 [110/2] via 10.0.0.1, 00:13:45, FastEthernet0/0
O     192.168.2.0/24 [110/2] via 10.0.0.6, 00:10:15, FastEthernet1/0
R2#
```

{% hint style="danger" %}
If R2 sees the route, but R1 does not, the issue is between R1 and R2.
{% endhint %}

* On **R3**, check if it has a route to **192.168.1.0/24**:

```
R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
O        10.0.0.0/30 [110/2] via 10.0.0.5, 00:11:33, FastEthernet1/0
C        10.0.0.4/30 is directly connected, FastEthernet1/0
L        10.0.0.6/32 is directly connected, FastEthernet1/0
O     192.168.1.0/24 [110/3] via 10.0.0.5, 00:11:33, FastEthernet1/0
      192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.2.0/24 is directly connected, FastEthernet0/0
L        192.168.2.1/32 is directly connected, FastEthernet0/0
R3#
```

{% hint style="danger" %}
If missing, R2 might not be redistributing routes correctly.
{% endhint %}

#### **3.2 Common Troubleshooting Steps**

Step 1: Check OSPF Configuration

* On **R2**, verify OSPF settings:

```
R2#show running-config | section ospf
router ospf 1
 network 10.0.0.0 0.0.0.3 area 0
 network 10.0.0.4 0.0.0.3 area 0
```

{% hint style="danger" %}
Ensure the correct networks are advertised.
{% endhint %}

Step 2: Verify OSPF Neighbor Adjacency

```
R2#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.2.1       1   FULL/BDR        00:00:36    10.0.0.6        FastEthernet1/0
192.168.1.1       1   FULL/DR         00:00:36    10.0.0.1        FastEthernet0/0

```

{% hint style="danger" %}
If adjacency is missing, check interface settings.
{% endhint %}

Step 3: Debug Routing Updates

```
R1#debug ip ospf events
OSPF events debugging is on
```

{% hint style="danger" %}
Look for OSPF update failures.
{% endhint %}

### <mark style="color:blue;">Keywords</mark>

`show ip route`, `Cisco troubleshooting`, `routing table`, `OSPF troubleshooting`, `static routes`, `dynamic routes`, `administrative distance`, `next-hop address`, `subnet mask`, `connected routes`, `route codes`, `network topology`, `packet forwarding`, `IP routing`, `missing routes`, `debug ip route`, `show ip ospf neighbor`, `route filtering`, `routing protocols`, `routing errors`, `سیسکو`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://netsec.nerd-cafe.ir/network-engineering/ccna/troubleshooting-with-show-ip-route.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
