Lecture 5 - Static and Default Routing
Lecture 5 - Static and Default Routing
Static routing is the most secure way of routing. It reduces overhead from network
resources. In this type of routing we manually add routes in routing table. It is useful
where numbers of route are limited. Like other routing methods static routing also has
its pros and cons.
It is easy to implement.
It is most secure way of routing, since no information is shared with other routers.
It puts no overhead on resources such as CPU or memory.
To explain static routing, I will use packet tracer network simulator software. You can use
any network simulator software or can use a real Cisco devices to follow this guide.
There is no difference in output as long as your selected software contains the
commands explained in this tutorial.
The following diagram shows our lab setup. We have three routers, three switches and
three hosts connected as below. The host names, IP addresses and the interfaces of
the routers are shown in diagram. The IP addresses of the hosts are also shown in the
diagram.
Hostname and IP address configuration in Router01
Connect to Router01 console and use the following IOS commands to configure host
name as Router01.
Router>enable
Router#configure terminal
Router(config)#hostname Router01
Router01(config)#
Use the following IOS commands to open the fast ethernet interface Fa0/0 configuration mode on
Router01 and configure IP address as 172.16.0.1/16.
Router01>enable
Router01#configure terminal
Router01(config)#interface fa0/0
Router01(config-if)#no shutdown
Use the following IOS commands to open the serial interface S0/0 configuration mode
on Router01 and configure IP address as 172.17.0.1/16. You have to set a clock
rate also using the "clock rate" command on S0/0 interface, since this is the DCE side.
Router01>enable
Router01#configure terminal
Router01(config)#interface s0/0
Router01(config-if)#no shutdown
Router>enable
Router#configure terminal
Router(config)#hostname Router02
Router02(config)#
Use the following IOS commands to open the fast ethernet interface Fa0/0
configuration mode on Router02 and configure IP address as 172.18.0.1/16.
Router02>enable
Router02#configure terminal
Router02(config)#interface fa0/0
Router02(config-if)#no shutdown
Use the following IOS commands to open the serial interface S0/0 configuration mode
on Router02 and configure IP address as 172.17.0.2/16.
Router02>enable
Router02#configure terminal
Router02(config)#interface s0/0
Router02(config-if)#no shutdown
Use the following IOS commands to open the serial interface S0/1 configuration mode
on Router02 and configure IP address as 172.19.0.1/16. You have to set a clock
rate also using the "clock rate" command on S0/1 interface, since this is the DCE side.
Router02>enable
Router02#configure terminal
Router02(config)#interface s0/1
Router02(config-if)#no shutdown
Router>enable
Router#configure terminal
Router(config)#hostname Router03
Router03(config)#
Use the following IOS commands to open the fast ethernet interface Fa0/0
configuration mode on Router03 and configure IP address as 172.20.0.1/16.
Router03>enable
Router03#configure terminal
Router03(config)#interface fa0/0
Router03(config-if)#no shutdown
Use the following IOS commands to open the serial interface S0/1 configuration mode
on Router03 and configure IP address as 172.19.0.2/16.
Router03>enable
Router03#configure terminal
Router03(config)#interface s0/1
Router03(config-if)#no shutdown
Router01>enable
Router01#configure terminal
To view the routing table in Router01, run "show ip route" command in Router01 as
shown below.
Router01#show ip route
The "S" character at the beginning of a line in routing table shows that it is a static route
and "C" character shows that it is a directly connected network.
Router02>enable
Router02#configure terminal
To view the routing table in Router02, run "show ip route" command in Router02 as
shown below.
Router02#show ip route
The "S" character at the beginning of a line in routing table shows that it is a static route
and "C" character shows that it is a directly connected network.
Router03>enable
Router03#configure terminal
To view the routing table in Router03, run "show ip route" command in Router03 as
shown below.
Router03#show ip route
When a packet arrives on an interface of a router, the router checks the destination network
address of the arrived-packet and finds that destination address in the routing table. If the router
finds an entry for the destination network, the router forwards the incoming packet from the
interface that is specified in the entry.
If the router does not find an entry for the destination network, the router checks the default
route. If the default route is available, the router forwards the incoming packet from the interface
that is specified in the default route.
If the default route is not available, the router drops the incoming packet. A router uses a default
route to forward all incoming packets; those destination addresses are not available in the routing
table.
In the below section, we will understand how to configure a default route to forward all packets
to a single destination through a practical example.
This is the first part of the article. This part describes how a default route works as well as also
explains the command syntax that is used to configure the default route.
The Packet tracer is a network simulator software. To download and learn how to install it, check
the following article.
Open the packet tracer and create an example LAB as shown in the following image. Or,
download the following pre-created LAB and load it on the packet tracer.
To configure a default route from all four remote sites (RS1, RS2, RS3, and RS4) use the
following global configuration command.
If you want to use the IP address of the next-hop in the configuration, specify the IP address of
the interface of the central office’s router that is connected to this (local) router.
Configure a default route on RS1 and RS2 using the exit-interface option.
Remote site 1 (RS1)
Configure a default route on RS1 and RS2 using the IP address of the next-hop option.
As discussed earlier, when a packet arrives on an interface of a router, the router finds the
destination network of the incoming packet in the routing table. If the routing table contains an
entry for the destination network, the router uses that entry to forward the packet.
If the routing table does not contain an entry for the destination network, the router uses the
default route to forward the packet. Since we did not configure any other route except the default
route on any remote site, all remote sites will use their default routes to forward all incoming
packets.
After this configuration, all remote sites can forward their data packets to the central office but
they will not get any return data packet from the central office as we haven’t configured any
routing information on the router of the central office.
To verify this, ping the server of the central office from the PC of the remote site RS1. The
following image shows the response of the ping command with the output.
Since the central office’s router has multiple exit points, we can’t use a default route for the
routing on this router. We can also not configure a routing protocol on this router, as a routing
protocol depends on routing broadcasts from neighboring routers and we did not configure a
routing protocol on any remote site.
In this situation, we can configure the static routing on the central office’s router. To configure
static routing on the central office’s router, use the following global configuration commands.
To verify this, ping the server of the central office and PCs of other remote sites from the PC of
the remote site RS1.
The following image shows the response of the ping command from all sites with the output.