What code is used to identify the routes learned via OSPF in the routing table?

You are here: Home / Cisco Routers / Cisco Show IP Route Command (Routing Table)-Example and Explanation

Routing and Switching form the foundation of computer networks and the Internet in general. A network engineer must know routing principles like the back of his/her hand!!

In this practical tutorial we will discuss the Cisco “show ip route” command which allows a network engineer to examine the routing table of a router device in a network.   

What code is used to identify the routes learned via OSPF in the routing table?

The core functionality of Layer 3 in the OSI model (Network Layer) is to forward (route) packets received on an interface of a routing device to the best destination.

It is the router’s job to select the best path that will deliver a packet to its destination as quickly and efficiently as possible.

This path selection process depends on the destination IP address of the packet received and the knowledge that the Router has about reaching that destination.

Table of Contents

  • Routing and Routing Tables
    • Dynamic Routing
    • Static Routing
  • The “show ip route” command explained
    • Routing Table with RIP
    • Routing Table with EIGRP
  • Other “Show IP Route” command options

The “knowledge” that a Router has about the way to reach destination networks is stored in the “Routing Table” of the device.

This Routing Table contains all known destination networks, how they were learned and how to reach them (outgoing Interface).

The entire process of building this Routing Table relies on the information from neighboring routers (dynamic routes) or from statically configured entries by the network administrator (static routes).

This means when a network topology is created, there has to be some kind of configuration for the devices on that network to communicate with each other.

The two major options are dynamic routing and static routing – these are basically how routers learn about routes to destination networks.

Dynamic Routing

When dynamic routing is used, a routing protocol has to be configured on the Layer3 devices on the network, in order for them to share routing information.

Some popular routing protocols supported by Cisco routers include Routing Information Protocol (RIP), Open Shortest Path First Protocol (OSPF), Interior Gateway Routing Protocol (IGRP) and Extended Interior Gateway Routing Protocol (EIGRP), among others.

When you opt for the implementation of dynamic routing, note that all routers on the network must be configured with one or more dynamic routing protocols.

If multiple routing protocols are used, then you have to implement what is known as “route redistribution”, which allows multiple routing protocols to work together and share routing information.

Although dynamic routing has the advantage of automatically updating the routing table, it has a disadvantage of overusing router resources due to its nature of sending periodic updates. When dynamic routing is used, routing information is automatically learned and added to the routing table.

Static Routing

Static routing deals with the manual configuration of routes by the administrator. This means routing information is manually inserted into the routing table.

This information includes things such as destination IP addresses, administrative distance or cost of getting to the destination network, and gateway IP to reach the destination network.

The “show ip route” command explained

Once a routing table is created i.e. there is convergence in the network, a logical topology is created from the physical network topology.

At this stage, routers on the network will have all the necessary information to forward packets they receive to the right destination.

As a network administrator, it is important that you know how to verify this information. It is crucial that you know how to check the routing table to see if you have all the routes needed for complete network communication to take place.

The “show ip route” command is one of the most important commands related to routing on Cisco IOS devices in order to show the routing table of the router.

It gives you detailed information about the networks that are known to the router, either directly connected to the router, statically configured using static routing or automatically added to the routing table using dynamic routing protocols.

Let us take a look at the output from a show ip route command to understand how it works using the example networks depicted below.

We have two example topologies below, one using RIP and another one using EIGRP so that to see how the routing table looks in both cases:

Routing Table with RIP

The command was executed on router R2 shown in the figure below.

What code is used to identify the routes learned via OSPF in the routing table?

R2#show ip route

Codes:

C – connected, S – static, I – IGRP, 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, E – EGP
i – IS-IS, 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 Gateway of last resort is not set.

C    192.168.1.0/24 is directly connected, Serial0/0/0
C    192.168.2.0/24 is directly connected, Serial0/1/0
R    192.168.3.0/24 [120/1] via 192.168.1.1, 00:00:18, Serial0/0/0
R    192.168.4.0/24 [120/2] via 192.168.1.1, 00:00:18, Serial0/0/0

The C in the routing table output means that the networks listed are “directly connected”. These represent the networks of the IP addresses configured on the physical (or virtual) interfaces of the device.

The R in the routing table shows destination networks learned via RIP dynamic routing protocol. If we were running OSPF, the entry would show O instead of R.

So, Router R2 is learning about the other networks via RIP routing protocol, which is depicted as R in the codes as we’ve said above.

For example, network 192.168.3.0/24 has been learned via 192.168.1.1 and can be reached via Serial0/0/0. This route has been added to the routing table by RIP.

As mentioned earlier, the routing table contains ALL the information about routes that are known to the router.

Administrative Distance

From the routing table above, notice the number [120/1]  shown in the RIP route. This is the default Administrative Distance of RIP which is 120.

Routing Table with EIGRP

In the following network topology the three routers implement EIGRP to dynamically distribute routing information between each other.

What code is used to identify the routes learned via OSPF in the routing table?

We will not examine how EIGRP is configured but let’s discuss and explain the “show ip route” output from each router:

R1#show ip route
Codes: C – connected, S – static, I – IGRP, 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, E – EGP
i – IS-IS, 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

Gateway of last resort is not set

10.0.0.0/30 is subnetted, 2 subnets
C 10.10.10.0 is directly connected, Serial0/0/0
D 10.10.10.4 [90/2172416] via 10.10.10.2, 01:00:09, Serial0/0/0
C 192.168.10.0/24 is directly connected, FastEthernet0/0
D 192.168.20.0/24 [90/2172416] via 10.10.10.2, 01:00:09, Serial0/0/0
D 192.168.30.0/24 [90/2174976] via 10.10.10.2, 01:00:09, Serial0/0/0

The routing table of Router R1 shows three networks learnt via EIGRP (denoted as D) and also two directly connected routes denoted as C.

For example, destination network 192.168.30.0 is learnt via EIGRP and can be reached via 10.10.10.2 from the Serial0/0/0 interface. 

R2#show ip route
Codes: C – connected, S – static, I – IGRP, 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, E – EGP
i – IS-IS, 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

Gateway of last resort is not set

10.0.0.0/30 is subnetted, 2 subnets
C 10.10.10.0 is directly connected, Serial0/0/0
C 10.10.10.4 is directly connected, FastEthernet0/1
D 192.168.10.0/24 [90/2172416] via 10.10.10.1, 01:05:11, Serial0/0/0
C 192.168.20.0/24 is directly connected, FastEthernet0/0
D192.168.30.0/24 [90/30720] via 10.10.10.6, 01:12:53, FastEthernet0/1

The second router in the topology shows three directly connected routes and two dynamic routes from EIGRP. 

R3#show ip route
Codes: C – connected, S – static, I – IGRP, 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, E – EGP
i – IS-IS, 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

Gateway of last resort is not set

10.0.0.0/30 is subnetted, 2 subnets
D 10.10.10.0 [90/2172416] via 10.10.10.5, 01:16:22, FastEthernet0/1
C 10.10.10.4 is directly connected, FastEthernet0/1
D 192.168.10.0/24 [90/2174976] via 10.10.10.5, 01:16:22, FastEthernet0/1
D 192.168.20.0/24 [90/30720] via 10.10.10.5, 01:15:40, FastEthernet0/1
C 192.168.30.0/24 is directly connected, FastEthernet0/0

Administrative Distance

The number [90/2172416] in the EIGRP routes above shows the default administrative distance of EIGRP which is 90 and the metric value.

Other “Show IP Route” command options

show ip route [ip address] : shows only information about the specified IP address.

show ip route [ospf, rip, eigrp, etc] : shows only routing information learned from the specified routing protocol (e.g show ip route ospf).

show ip route static : displays information about statically configured routes.

show ip route connected : displays information about directly connected networks.

show ip route summary : shows summary information about ALL IP routes in the routing table.

Let’s see the above commands on the EIGRP network scenario shown above:

R1#show ip route eigrp
10.0.0.0/30 is subnetted, 2 subnets
D 10.10.10.4 [90/2172416] via 10.10.10.2, 01:19:53, Serial0/0/0
D 192.168.20.0/24 [90/2172416] via 10.10.10.2, 01:19:53, Serial0/0/0
D 192.168.30.0/24 [90/2174976] via 10.10.10.2, 01:19:53, Serial0/0/0

The above shows only routes learned by EIGRP.

R1#show ip route connected
C 10.10.10.0/30 is directly connected, Serial0/0/0
C 192.168.10.0/24 is directly connected, FastEthernet0/0

The above displays only directly connected routes.

R1#show ip route summary
IP routing table name is Default-IP-Routing-Table(0)
IP routing table maximum-paths is 16
Route Source   Networks   Subnets   Overhead   Memory (bytes)
connected             1                   1                 144             256
static                     0                   0                  0                 0
eigrp 10                 2                   1                216               384
internal                 1                                                          1148
Total                      4                   2                 360             1788

The above displays a summary of all the routes and their source in the routing table.

R1#show ip route 192.168.30.0
Routing entry for 192.168.30.0/24
Known via “eigrp 10“, distance 90, metric 2174976, type internal
Redistributing via eigrp 10
Last update from 10.10.10.2 on Serial0/0/0, 01:30:17 ago
Routing Descriptor Blocks:
* 10.10.10.2, from 10.10.10.2, 01:30:17 ago, via Serial0/0/0
Route metric is 2174976, traffic share count is 1
Total delay is 20200 microseconds, minimum bandwidth is 1544 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 2

If you insert a specific destination network in the command (for example 192.168.30.0 as shown above) then you will get all details about how this destination network is learned by the device. In our example above, network 192.168.30.0 is known via EIGRP process 10, from interface Serial0/0/0. 

  • Comparison of Static vs Dynamic Routing in TCP/IP Networks
  • Cisco OSPF DR-BDR Election in Broadcast Networks – Configuration Example
  • How to Configure Port Forwarding on Cisco Router (With Examples)
  • Adjusting MSS and MTU on Cisco 800 routers for PPPoE over DSL
  • The Most Important Cisco Show Commands You Must Know (Cheat Sheet)

What code is used to identify directly connected routes in the routing table?

Directly connected interfaces have two route source codes. 'C' identifies a directly connected network. 'L' identifies the IPv4 address assigned to the router's interface. Identifies the destination network and how it is connected.

How does OSPF identify routes?

To display the Open Shortest Path First (OSPF) routing table entries to an Area Border Router (ABR) and Autonomous System Boundary Router (ASBR), use the show ip ospf border-routers command. Use the show ip ospf border-routers command to display information on ABRs. and ASBRs.

What command would you use to only see the OSPF routes in the routing table?

The show ip route [ospf | subnet mask] command can be used to display OSPF routes in the current routing table.

What is the code used in the routing table to identify the routes that are recognized via Eigrp?

The code letter D is used to identify routes that are learned through EIGRP. What is the purpose of a routing protocol? It allows a router to share information about known networks with other routers.