To enable connectivity in this network
we can configure static routes
so on router 1, as an example, conf t ip route
and notice we have various options, destination prefix, profile, static and VRF
it’s important that you know the options for static route.
so as an example, the destination prefix
or destination network that I want to configure is 10.1.2.0
and the reason that I want to use 10.1.2.0
is because this is a /24 network.
Now you can implement summarization of your static routes
but for now use the exact mask, question mark is destination prefix mask.
so 255.255.255.0 because this is a /24 question mark
I can now specify the next hop router or an outgoing interface
when setting up routing look at it from routers point of view.
From router's 1 point of view, what is the next hop IP address
that he uses to get to this network?
In other words, when router 1 sends traffic out of this interface
what’s the next IP address that it's going to hit?
it's going be this IP address 10.1.1.2
So if router 1 was trying to get to a network somewhere on the right here
the next hop would still be 10.1.1.2
because that’s the next hop IP address that the router is forwarding traffic to.
So just think what’s the next IP address that going to be hit
when the router forwards the traffic out of an interface
that’s your next hop IP address.
So, in this case, it's 10.1.1.2 we can specify various options here
such as an administrative distance make the route permanent
and other options but for now that’s all I’m going to specify.
Notice we’ve got the option carriage return
and that’s what we’ve used now
in other words, routes has been added to the routing table.
Let’s confirm that so sh ip route
shows us that this network 10.1.2.0
has been added to the routing table as a static route.
S means static, route is available via 10.1.1.2
in other words, this IP address.
So can we ping 10.1.2.2? Ping 10.1.2.2 pings failed
but we are getting output on router 3
so on router 3, it’s sending an echo reply back
from 10.1.2.2 to destination 10.1.1.1
so in other words, the traffic is getting from router 1 to router 3
but it’s not getting back again.
And the reason for that is router 3 doesn’t have a route back to router 1.
We can see that by using the command sh ip route
back to 10.1.1.0. as an example, if I try and ping 10.1.1.1
the IP address of this router, router 1
in network 10.1.1.0/24 pings failed
and we can use the command debug ip packet
to show us that the router doesn’t know how to get to that network.
The traffic is unroutable.
So how do we fix this? Well, we need to create a static route back again.
So IP route 10.1.1.0 with the mask /24
and in this case we're going to use the next hop IP address 10.1.2.1
now you can use the local outgoing interface
but that’s not recommended on Ethernet interfaces
only do that on point to point links such as serial interfaces on Ethernet
use a next hop IP address not the local outgoing interface
so does the ping work now?
Yes it does and you can see a lot of output
so let’s turn off debugging
un all or undebug all turns off debugging
I’ll only enable ICMP
so debug ip icmp
we can see the echo replies are sent and the pings succeed
in other words, the traffic got from router 1 to router 3 and arrive back again.