Will router 1 be able to ping the loopback of router 3?
on router 3 a loopback is being configured as 3.3.3.3
it's available in the local router's routing table
as a directly connected interface onloopback 0.
Will router 1 be able to ping that loopback?
and the answer is no because router 1 doesn’t have a route
to that loopback interface. we can prove that by using the command
sh ip route
again notice there’s no route to 3.3.3.3 debug ip packet
do the ping again notice unroutable.
So the router doesn’t know how to get to that loopback
so we would need to configure static routes for that loopback.
So here’s the question, how many static routes would we need
to configure in this network to enable full connectivity?
To answer the question look at which networks are not directly connected to router 1.
Router 1 has this loopback and this network directly connected to it
but network 2.2.2.2 this network 10.1.2.0
and this network 3.3.3.3 are not connected to router 1
so 3 networks would need to be configured on router 1.
on router 2 this network and this network are directly connected to the router
we can prove that by using the command sh ip route
notice 3 networks are directly connected to router 2
but this network and this network are not directly connected.
so we had 3 on router 1, we have to configure 2 routes on router 2
on router 3, this network and this network are directly connected
but this network this network and this network
are not directly connected, so router 3 needs 3 static routes.
So in this small topology just using this network
as shown in the diagram I would need to add in total 8 static routes.
3 + 2 + 3 however on router 1
I added some additional networks 10.1.1.2 and 10.1.10.0
so that means we need to add 2 additional routes
to router 2, plus 2 additional routes to router 3
assuming that is, that we don’t summarize.
So it’s quite a bit of work.
So this is the problem with static routes, there can be a lot of work
especially if you have a large topology.
So sh run | include route
will show me my static routes in the running config of the router
at the moment I've only configured 1
so I'll have to type IP route 2.2.2.2
and the next hop 10.1.1.2
that adds that route to router's 1 routing table
and I have to do something similar for the loopback of router 3
notice the same next hop IP address is used from router's 1 point of view
the next hop IP address is this IP address
when getting to anyone of these 3 networks.
So can router 1 ping 3.3.3.3? No, it can’t, why?
So turn off debugging, let’s try again.
Can we ping 3.3.3.3?
No, let’s see if there’s a problem
so let’s use the command traceroute 3.3.3.3
Notice to get to 3.3.3.3 the traceroute command shows me
that router 1 sends the traffic to 10.1.1.2
and that’s because that route is in the local routing table of router 1
but when it gets to router 2 it fails.
So router 1 sends the traffic to router 2
router 2, however, when it receives the traffic from router 1
doesn’t know where 3.3.3.3 is.
So to prove that let's do a debug IP packet on router 2.
I'll ping the loopback of router 3 from router 1
so the traffic will go from router 1 to router 2
and then let’s see what happens
hopefully, it well go to router, 3 but will it?
And we can see here that router 2 is saying
host unreachable sent to 10.1.1.1 for network 3.3.3.3
router 2 doesn’t know how to get to this destination network
and therefore tells router 1 network is unreachable.
This is an example, of the hop by hop paradigm used in IPv4 and IPv6.
The hop by hop paradigm means that every router
makes its own local routing decision independent of other routers.
So just because router 1 knows how to get to router 3
doesn’t mean that router 2 knows how to get to router 3.
Router 1 actually only knows the next hop
in the path to get to that destination
and doesn’t know the entire path, so sh ip route
Notice router 1 knows that to get to this network 3.3.3.3
it needs to send the traffic to router 2
but it's reliant on router 2 to know what to do with traffic.
And in this case router 2 doesn’t know how to get to router 3
so unreachable massage is send back to router 1.
So once again, on router 2, there are no static routes.
So I need to configure a static route for the loopback of router 3
and in this case, notice the next hop
from router 2 point of view is 10.1.2.2
Now does the ping succeed? And the answer is yes.
the ping succeeds because when router 1 pings the loopback of router 3
and forwards the traffic to router 2.
Router 2 knows where to send the traffic
because that route is in its local routing table
and it can, therefore, forward the traffic to router 3 and in this case
router 3 knows how to get back to 10.1.1.1 so the ping succeeds.
we can see that on router 3, that it's sending a reply to 10.1.1.1 from 3.3.3.3
Now here's another question:
if we'll look at the routing table of router 2 it says that the next hop is 10.1.2.2
but it doesn't show us that the traffic must go out of F0/1
rather than F0/0 how does the router know which interface to use?
Well it knows because this IP address is part of this subnet
and that subnet is directly connected to F0/1
so router 2 knows that to get to 3.3.3.3
it needs to forward the traffic to this IP address
and this IP address is part of this network which is available
through this interface so it knows to forward
the traffic out of this local interface
we can see that in the CEF table by using the command
show ip cef
show ip cef shows us that this network is available
via this next hop out of this interface.
So with Cisco express forwarding
the router pre-builds this information into the CEF table
so it doesn’t have to do a double lookup on the routing table.
in the old days when traffic arrived going to this network
the router would have to do a double lookup, in other words, it would
this entry in the routing table and then have to look at this entry
in the routing table to determine the outgoing interface.
Now that information is pre-built in the CEF table
to speed up the forwarding of traffic.