Tip:
Highlight text to annotate it
X
Now let's move on to another routing scenario.
This time we have two routers called HeadQuarters and BranchOffice.
If we look at their routing table you will find that:
HeadQuarters router has two interfaces, FastEthernet 0/0 and FastEthernet 0/1 . Network 192.168.10.0
/24 is configured on FastEthernet 0/0 and 1.1.1.0 /24 has been configured on FastEthernet
0/1.
BranchOffice router also has two interfaces, FastEthernet 0/0 and FastEthernet 0/1. Network
192.168.10.0 /24 has been configured on FastEthernet 0/0 and 2.2.2.0 /24 has been configured
on FastEthernet 0/1.
Each router has a routing table with only his directly connected interfaces.
Starting from now I will use HQ router instead of Headquartes router and BO instead of BranchOffice
router.
So what about if HQ router wants to know about the network 2.2.2.0 /24 behind the BO router,
and BO router wants to know about the 1.1.1.0 /24 behind the HQ router.
To reach that, we have to make it into the routing table somehow.
After making that, HQ router and BO router know about these networks behind each other.
There are 2 ways to make the routing table on each router to learn this information,
the Static Routing and Dynamic Routing. If you use static routing you will have to
do everything yourself. You tell the router where to send IP packets for a certain network,
it's a lot of work. Dynamic routing means we use a routing protocol that will be responsible
about exchanging the network information between routers.
Let's start with the static routing: Here we have a network with two sites, headquarters
and a branch office.
We want to make sure that both networks can reach each other.
Let's start by configuring those routers'
interfaces with the IP addresses. And don't forget to do a “no shutdown” on the interfaces.
Let's do it Now Let’s view the routing tables of both
routers using the show ip route command: This is what a router uses to make decisions
where to forward IP packets to. By default a router only knows its directly connected
networks as we learned that in a previous video. We configured an IP address with a
subnet mask on the interface so the router also knows the network address.
• Router HQ knows about network 192.168.10.0/24
and 1.1.1.0/24. • Router BO knows about network 192.168.10.0/24
and 2.2.2.0/24.
At this moment our HQ router has no idea how to reach network 2.2.2.0 because there is
no entry in the routing table regarding this network. What will happen when we try to reach
it?
Let's check: ping 2.2.2.1
The ping failed. This router checked its routing table, and discovered that it doesn't know
how to reach network 2.2.2.0 so it dropped the traffic.
Now Let's use a static route to tell HQ router how to reach this network!
To create a static route, we use the IP route command.
Let me break it down for you:
• 2.2.2.0 is the network we want to reach. • 255.255.255.0 is the subnet mask of this
network. • 192.168.10.2 is called the next hop IP
address. It's the IP address where we want to send traffic to. In this example that's
the branch router IP address.
So here, I'm telling the HQ router that it can reach network 2.2.2.0 by sending traffic
to IP address 192.168.10.2 which is our BO router.
Let's take another look at the routing table to see if anything has changed:
As you see, now we can see an entry for network 2.2.2.0/24 in our routing table. Whenever
HQ router has traffic for network 2.2.2.0 it will send it to the IP address 192.168.10.2
which is the BO router. Let's see if our ping is now working:
Yes, it's working. Because now the HQ router knows how to reach network 2.2.2.0 through
our static route. Now we will do the same configuration on BO
router to make it reach network 1.1.1.0 behind HQ router.
Now it's ready, let's ping 1.1.1.1
Yes, it's working.
So Whenever an IP packet arrives at a router it will check its routing table to see if
it knows about the destination network. If it does it will forward the IP packet and
if it has no idea where to send traffic it will drop the IP packet.