Static
routing
Overview
Welcome to the world of
routing. In the next few chapters, we will look at how packets find their way
in networks through routers. In this chapter, we will learn static routing.
Routers in our networks
discover remote networks in one of two ways;
1. Statically
configured routes
2. Dynamic
routing protocols
Introduction
as you may already know,
the work of the router is to forward packets from the source device to the
destination device. In between there may be several routers. The router uses a
database known as the routing table to forward these packets.
See the topology below :
The
network above shows a small network consisting of 3 routers and 2 hosts. As
discussed earlier, each connection to a router should have its own network
segment and this is shown in the diagram.
The
network administrator also configured R1’s and R3’s serial interfaces as the
DCE and all other configurations are correct.
In
this scenario, R1 can ping HOST A, R1 can ping R2 s0/0/0 interface but not
interface s0/0/1.
R3
can ping HOST B, R3 can ping R2’s s0/0/1 interface ONLY. HOST A and HOST B
cannot communicate. As shown in the exhibit below.
In
this chapter, we will explain the reasons as to why these two computers cannot
communicate and resolve this problem.
KEEP THIS TOPOLOGY IN MIND AS IT WILL BE USED
THROUGHOUT THIS CHAPTER.
Directly connected networks
The
routing table is the database that contains information about various networks,
we have said that these remote networks may either be learnt through routing
protocols or manually configured routes.
The
output of the “show ip route” command on a router, shows the routes that a
particular router can reach. By default, a router will only know of directly
connected routes.
Directly
connected routes in our scenario, from R1’s perspective are the network
connected to HOST A and the network between R1 and R2.
Since
no other configuration has been made on these routers, R2 and R3, should only
have directly connected routes.
The
directly connected networks are the only networks that can be reached by a
particular router. In our scenario, this means that;
§ Host
A can ping R1
§ R1
can ping R2’s s0/0/0 interface but not interface s0/0/1
§ R2
can ping R1’s s0/0/0 interface but not interface fa0/0 or HOST A
§ R2
can ping R3’s s0/0/0 interface but not interface fa0/0 or HOST B
§ R3
can ping R2’s s0/0/1 interface but not interface s0/0/0
§ HOST
B can ping R3.
§ Neither
hosts can ping each other
§ R1
and R3 cannot ping each other.
The
figure shown below shows all the directly connected networks.
Static routing
Static routes are one way we can communicate to remote networks.
In production networks, static routes are mainly configured when routing from a
particular network to a stub network.
stub networks are networks that can
only be accessed through one point or one interface.
In
the above scenario, the 192.168.1.0/24 and 192.168.4.0/24 networks are stub
networks. This means that for hosts in these network segments only have one way
to communicate with other hosts, which is R1 and R3 for the 192.168.1.0/24 and
192.168.4.0/24 networks respectively.
Understanding
stub networks is crucial in understanding static routing.
The
command needed to configure a static route is shown below.
Router(config)# ip route (network-address)
(subnet-mask) (next-hop ip address/ exit interface)
The
table below explains the meaning of each of the parameters in the ip route
command as well as an example of the command which would be used on R1 to
configure a static route to R3’s LAN network (192.168.4.0/24).
Parameter
|
Meaning
|
example
|
Ip route
|
State that the route being configured is a
static route
|
Ip route
|
Network-address
|
The network address of the destination
network. This is the network I am trying to reach.
|
192.168.4.0
|
Subnet-mask
|
The network address of the destination
network that I am trying to reach
|
255.255.255.0
|
Next hop ip address
|
This is the ip address of the router that is
connecting me to the desired network
|
192.168.2.4
|
Exit interface
|
This is the exit point interface on my router
that connects to the router that will take me to the desired network
|
s0/0/0
|
Refer to the exhibit.
Therefore to configure a static route on R1 for network 192.168.4.0/24, the
command to be issued on R1 is:
R1(config)# ip route 192.168.3.0 255.255.255.0 192.168.2.4
R1(config)# ip route 192.168.4.0 255.255.255.0 192.168.2.4
OR
R1(config)# ip route 192.168.3.0 255.255.255.0 s0/0/0
R1(config)# ip route 192.168.4.0 255.255.255.0 s0/0/0
Routing table principles
There
are three routing table principles that dictate how routers communicate.
Principle 1:
“routers
forward packets based on information contained in their routing tables ONLY.”
R1
has 2 routes 192.168.3.0/24 which is the connection between R2 and R3, and
192.168.4.0/24, which is the network on which HOST B is located. Therefore,
based on the first principle, R1 will make its forwarding decisions based on
this information only. It will not consult R2 or R3.Nor does it know whether or
not those routers have routes to other networks. As a network administrator, it
is your responsibility to make sure that all the routers in a network know
about remote networks.
Principle 2:
” Routing information on one router does not
mean that other routers in the domain have the same information.”
R1
doesn’t know about the information in R2’s routing table. The same can be said
of R2 and R3. Therefore, the fact that R1 has a path to the networks connected
to R2 and R3 does not mean that R2 and R3 have the same information.
For
example, can reach the network 192.168.4.0/24 on R3 through R2. R1 does not
know whether R2 can reach the network connected to R3. Therefore, we need to
configure routes from R2 to the LAN connected to R3.
Using Principle 2, we
still need to configure the proper routing on the other routers (R2 and R3) to
make sure that they have routes to these three networks.
Principle 3:
“Routes on a router to a remote network do not mean that the remote router has return paths.”
This
principle means that when a route is configured on one router, the remote
router must be configured with a return route. In our networks, most of the
communication is bidirectional, this means that for every message we send, a
reply is expected.
If
we use the analogy of the post office, it would be like sending a letter
without a return address. The recipient cannot reply to a letter without a
return address, and the postman would not know where to send the letter.
In
our scenario, this means that, when we configure a route to network
192.168.4.0/24 on R1, we need to configure a route on the remote routers that
leads to the LANs connected to R1.
Using Principle
3 as guidance, we will configure proper static routes on
the other routers to make sure they have routes back to the 192.16.1.0/24
network.
No comments:
Post a Comment