9.
5 Exploring the Functions of Routing
Routing Table
Remaining Time -0:00
1x
In this next lesson, we're going to touch on the routing table in a little bit more depth. Now,
we do have directly connected routes. And I want to come back to this slide. We do have
dynamic routes as well. I want to touch on that and we also have static routes. So of course,
we have default routes too. But really, what I wanted to do before we sort of drill down into
each of these is just kind of look at what the routing table looks like from the command line.
So if I do a show ip route on a router, this is going to be one indication of my default route.
It's going to be my gateway of last resort. So we'll touch on this here in a second. But this is
basically going to be the next hop IP or the IP address that I'm going to be forwarding my
traffic to. We are going to have connected and local routes.
So these directly connected prefixes are the subnets or the prefixes that I have configured,
let's say, for example on this gig 00 interface. The connected is just going to show me the
actual network or the subnets. It's the [Link]/24 subnet. And the actual IP that's on the
interface is .2.
Now, with so little older versions of code, we didn't have the local or the out route here. And
so if we wanted to see the IP that was actually on this interface, we'd have to do a show ip
interface brief. So it's kind of nice with the newer versions of code that they have the actual
IP on the interface from the output of show ip route.
Now, they're also giving us some examples of multiple different types of dynamic routing
protocols. We have RIP. We have OSPF. And D actually stands for EIGRP, all right? And
each of those dynamic routing protocols, usually, we're just going to be running one, maybe
two. But they give us an example of all three here. Usually, an easy way other than that icon
all the way over on the left to be able to determine, hey, what type of dynamic routing
protocol is you can also look at the administrative distance.
Now, we'll touch on that administrative distance again. But basically, administrative distance
is a way for us to say, hey, I want to prefer the EIGRP dynamic routing protocol over OSPF
or RIP. So just by looking at these numbers, you might be able to allude that a lower number
is more preferred. And you're absolutely right. When we think about administrative distance,
think lower is better. Just like when you're shopping, you want to look for the lowest price.
So you'll eventually get to a point where you'll memorize these administrative distances. And
you'll know that 110 is OSPF, and 120 is RIP. Now, we'll also see that we have static routes.
This is where me as an administrator, I manually configure this. Dynamic routes can
automatically learn subnets, but static routes, we have to manually configure them. So
usually, a static route is going to have an AD of one. And we can see that value listed right
there.
Now, some of the other items that we see here are going to be how are we getting to that
network? Well, we're getting there through the [Link] IP. And you can actually see
that we're using that same IP and that same egress interface for some of the other routes.
Now, we have another example of a directly connected. And then this is an example of the
default route. So essentially, when we see an S, we know it's a static route. And a default
route is just one example of a default route. It is the gateway of last resort.
So in other words, if I have traffic that's destined for, I don't know, let's say the [Link]
subnet, I don't have an entry for that in my routing table. So I might decide, hey, this default
route is probably going to be where I want to punt this traffic to, rather than any of the more
specific entries in my routing table.
So we'll circle back to that conversation again. But let's go backwards and let's just look at
this one more time. Directly connected, remember, when we see this in our network-- sorry,
our routing table, C means it's the network. L means it's the actual IP that's assigned to the
interface. Here's the actual destination network, or the prefix that we're connected to. And
then here is the exit interface or the egress interface that we're using when we need to forward
ID packets to that destination.
Dynamic routes, we can see what dynamic routing protocol is, what's the actual network. We
just touched on the AD. Remember, that's the level of trustworthiness, or how preferred is it.
The metric is going to vary many times based on the dynamic routing protocol.
So every dynamic routing protocol has a little bit of a different way to say which one is the
best path. So we'll get into that too. And then here's the actual prefix. Here is how long the
network has been discovered. And then here again is that outgoing or that exit interface to get
to that network.
Now, static routes-- manually configured. We as the administrator say, hey, what is the
destination network that we want to tell this router about? So we might want to create an
entry for that 192.168.30 subnet. Or like that example that I gave a minute ago with the
[Link], we didn't know about it. So we could, if we wanted to, create a static route for
it.
What's the administrative distance? Static routes are always going to, by default, have an AD
of one. But we can always change that. What's the metric? And what is the next hop IP? So in
other words, if this is the router that I'm logged into, and I'm using this router that I'm
connected to to get to that prefix, whatever IP address is on this device, that's the next hop
over is the IP address that I'll use in my static route statement. And we'll touch on those
configs later.
Here's the example of the default route. We'll also look at this config a little later. [Link] is a
very broad statement. It basically says, if you don't have anything more specific, where do we
send it to? So sometimes, this might be the IP address of whoever our neighboring router is.
And maybe that neighboring router is a router in our service provider, or a device that's
outside of our local area network.
A routing table contains a list of all networks that are known to the router and information
about how to reach those networks. Each line or entry of the routing table lists a destination
network and the interface or next-hop address by which that destination network can be
reached.
A routing table may contain four types of entries:
• Directly connected networks
• Dynamic routes
• Static routes
• Default routes
Directly Connected Networks
All directly connected networks are added to the routing table automatically. A newly
deployed router, without any configured interfaces, has an empty routing table. The directly
connected routes are added after you assign a valid IP address to the router interface, enable it
with the no shutdown command, and when it receives a carrier signal from another device
(router, switch, end device, and so on). In other words, when the interface status is up/up, the
network of that interface is added to the routing table as a directly connected network. If the
hardware fails or is administratively shut down, the entry for that network is removed from
the routing table. The following figure shows examples of routing table entries for directly
connected networks. An active, properly configured, directly connected interface actually
creates two routing table entries. The following figure displays the IPv4 routing table entries
on R1 for the directly connected network [Link]/24.
The entries contain the following information:
• Route source: Identifies how the route was learned. Directly connected interfaces
have two route source codes. "C" identifies a directly connected network. "L"
identifies the local IPv4 address assigned to the router’s interface.
• Destination network: For directly connected networks, the destination networks are
local to the router. The destination network address is indicated with network address
and subnet mask in the form of the prefix. Note that "L" entries, which identify the
local IPv4 address of the interface, have a prefix of /32.
• Outgoing interface: Identifies the exit interface to use when forwarding packets to
the destination network.
Dynamic Routes
Dynamic routing protocols are used by routers to share information about the reachability and
status of remote networks. A dynamic routing protocol allows routers to automatically learn
about remote networks from other routers. These networks, and the best path to each, are
added to the routing table of the router, and identified as a network learned by a specific
dynamic routing protocol. Cisco routers can support a variety of dynamic IPv4 and IPv6
routing protocols, such as Border Gateway Protocol (BGP), Open Shortest Path First (OSPF),
Enhanced Interior Gateway Routing Protocol (EIGRP), Intermediate System-to-Intermediate
System (IS-IS), Routing Information Protocol (RIP), and so on. The routing information is
updated when changes in the network occur. Larger networks require dynamic routing
because there are usually many subnets and constant changes. These changes require updates
to routing tables across all routers in the network, to prevent connectivity loss. Dynamic
routing protocols ensure that the routing table is automatically updated to reflect changes in
network. The following figure displays an IPv4 routing table entry on R1 for the route to
remote network [Link]/24.
From the example entry, you can tell the following:
• Route source: Identifies how the route was learned. "O" in the figure indicates that
the source of the entry was the OSPF dynamic routing protocol.
• Destination network: Identifies the address of the remote network. The router knows
how to reach [Link]/24 network.
• Administrative distance: Identifies the trustworthiness of the route source. Lower
values indicate preferred route source. OSPF has a default administrative distance
value of 110.
• Metric: Identifies the value assigned to reach the remote network. Lower values
indicate preferred routes. This OSPF route has a metric of 2 for the destination
network [Link]/24.
• Next-hop: Identifies the IPv4 address of the next router to forward the packet to. The
IPv4 address of the next-hop is [Link].
• Route timestamp: Identifies how much time has passed since the route was learned.
The information in the example entry was learned 3 minutes and 23 seconds ago.
• Outgoing interface: Identifies the exit interface to use to forward a packet toward the
final destination. The packets destined to the [Link]/24 network will be forwarded
out of the GigabitEthernet 0/1 interface.
Static Routes
Static routes are entries that you manually enter directly into the configuration of the router.
Static routes are not automatically updated and must be manually reconfigured if the network
topology changes. Static routes can be effective for small, simple networks that do not
change frequently. The benefits of using static routes include improved security and resource
efficiency. The main disadvantage of using static routes is the lack of automatic
reconfiguration if the network topology changes. There are two common types of static
routes in the routing table—static routes to a specific network and the default static route.
From the example entry, you can tell the following:
• Route source: Identifies how the route was learned. Static routes have a route source
code "S".
• Destination network: The destination network address is indicated with network
address and subnet mask in the form of the prefix. The router knows how to reach
[Link]/24 network.
• Administrative distance: Identifies the trustworthiness of the route source. Lower
values indicate preferred route source. Static routes have a default administrative
distance value of 1.
• Metric: Identifies the value assigned to reach the remote network. Static routes do not
calculate metric the same way as dynamic routes, metric is set. Default value for
administrative distance of a static route is 0.
• Next-hop: Identifies the IPv4 address of the next router to forward the packet to. The
IPv4 address of the next-hop is [Link].
Default Routes
A default route is an optional entry, which is used by the router if a packet does not match
any other, a more specific route in the routing table. A default route can be dynamically
learned or statically configured. There may be more than one source providing the default
route, but the selected default route is presented in the routing table as Gateway of last resort.
From the example entry, you can tell the following:
• Route source: Identifies how the route was learned. Default route is marked with an
asterisk (*). Depending on the source of a default route, asterisk is added to the route
source (S* in the example.)
• Destination network: The destination network for default route is [Link]/0.
• Administrative distance: Identifies the trustworthiness of the route source. Lower
values indicate preferred route source. Default route has the same administrative
distance as a source of a default route. In the example, the default route's source is a
static route, with a default administrative distance value of 1.
• Metric: Identifies the value assigned to reach the remote network. The default route
inherits the metric value from the route source. In the example, since the default route
is statically configured, the metric is 0.
• Next-hop: Identifies the IPv4 address of the next router to forward the packet to. The
IPv4 address of the next-hop for the default route in the example is [Link].
IPv4 Routing Table Example
On a Cisco router, the show ip route command can be used to display the IPv4 routing
table of a router. The command output is used to verify that IPv4 networks and specific
interface addresses have been installed in the IPv4 routing table. The following output
displays the routing table of RouterA.
RouterA# 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, + - replicated route
Gateway of last resort is [Link] to network [Link]
C [Link]/24 is directly connected, GigabitEthernet0/0
L [Link]/32 is directly connected, GigabitEthernet0/0
R [Link]/16 [120/1] via [Link], 00:01:08, GigabitEthernet0/1
O [Link]/24 [110/2] via [Link], 00:03:23, GigabitEthernet0/1
D [Link]/24 [90/156160] via [Link], 00:01:23, GigabitEthernet0/0
S [Link]/24 [1/0] via [Link]
C [Link]/24 is directly connected, GigabitEthernet0/1
L [Link]/32 is directly connected, GigabitEthernet0/1
S* [Link]/0 [1/0] via [Link]
The output shows that RouterA has received routes from multiple sources (static routes and
routing protocols), which would be uncommon in a production network. However, this table
is used here to demonstrate the various route sources. The first part of the output explains the
codes, presenting the letters and the associated sources of the entries in the routing table.
The letters are:
• C: Indicates directly connected networks; the first and seventh entries are directly
connected networks.
• L: Indicates local interfaces within connected networks; the second and eighth entries
are local interfaces.
• R: Indicates RIP; the third entry is RIP route.
• O: Indicates OSPF; the fourth entry is an OSPF route.
• D: Indicates EIGRP; the fifth entry is an EIGRP route. The letter D stands for
Diffusing Update Algorithm (DUAL), which is the update algorithm that EIGRP uses.
The code letter E was previously taken by the legacy exterior gateway protocol
(EGP).
• S: Indicates static routes; the sixth and ninth entries are static routes.
• Asterisk (*): Indicates that this static route is a candidate for the default route.
Content Review Question
Correct
Refer to the show ip route command output from RouterA above. If you ping a device in
the network [Link] from the router, what does the router do with the packets?
• It drops the packets.
• It forwards the packets to next-hop address [Link].
• It forwards the packets to next-hop address [Link].
• It forwards the packets to network [Link]/24.
• It forwards the packets to next-hop address [Link].
• It delivers the packets directly to the device on network [Link].
Was this helpful?