0% found this document useful (0 votes)
66 views14 pages

Lecture 5 - Static and Default Routing

The document discusses configuring static routing between three routers connected in a network. It provides detailed steps for configuring hostnames, IP addresses and static routes on each router. Static routes are configured to connect all networks together, with next hop IP addresses specified for routes to non-directly connected networks. The routing tables on each router are checked to verify that the static routes were added correctly.

Uploaded by

Oge Esther
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views14 pages

Lecture 5 - Static and Default Routing

The document discusses configuring static routing between three routers connected in a network. It provides detailed steps for configuring hostnames, IP addresses and static routes on each router. Static routes are configured to connect all networks together, with next hop IP addresses specified for routes to non-directly connected networks. The routing tables on each router are checked to verify that the static routes were added correctly.

Uploaded by

Oge Esther
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

LECTURE 5

Static Routing Configuration Guide with Examples


This tutorial explains how to configure static routing step by step in detail including
advantage of static routing and disadvantage of static routing. Learn how to enable,
configure, manage and delete static route in Cisco router with practical example in
packet tracer.

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.

Advantage of static routing

 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.

Disadvantage of static routing

 It is suitable only for small network.


 If a link fails it cannot reroute the traffic.

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.

Static Routing - Lab Practice

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

Enter configuration commands, one per line. End with CNTL/Z.

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

Enter configuration commands, one per line. End with CNTL/Z.

Router01(config)#interface fa0/0

Router01(config-if)#ip address 172.16.0.1 255.255.0.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

Enter configuration commands, one per line. End with CNTL/Z.

Router01(config)#interface s0/0

Router01(config-if)#clock rate 64000

Router01(config-if)#ip address 172.17.0.1 255.255.0.0

Router01(config-if)#no shutdown

Do remember to run the "copy running-config startup-config" command from enable


mode, if you want to save the changes you have made in the router.

Hostname and IP address configuration in Router02


Connect to Router02 console and use the following IOS commands to configure host
name as Router02.

Router>enable

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

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

Enter configuration commands, one per line. End with CNTL/Z.

Router02(config)#interface fa0/0

Router02(config-if)#ip address 172.18.0.1 255.255.0.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

Enter configuration commands, one per line. End with CNTL/Z.

Router02(config)#interface s0/0

Router02(config-if)#ip address 172.17.0.2 255.255.0.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

Enter configuration commands, one per line. End with CNTL/Z.

Router02(config)#interface s0/1

Router02(config-if)#clock rate 64000

Router02(config-if)#ip address 172.19.0.1 255.255.0.0

Router02(config-if)#no shutdown

Do remember to run the "copy running-config startup-config" command from enable


mode, if you want to save the changes you have made in the router.

Hostname and IP address configuration in Router03


Connect to Router03 console and use the following IOS commands to configure host
name as Router03.

Router>enable

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

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

Enter configuration commands, one per line. End with CNTL/Z.

Router03(config)#interface fa0/0

Router03(config-if)#ip address 172.20.0.1 255.255.0.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

Enter configuration commands, one per line. End with CNTL/Z.

Router03(config)#interface s0/1

Router03(config-if)#ip address 172.19.0.2 255.255.0.0

Router03(config-if)#no shutdown

Do remember to run the "copy running-config startup-config" command from enable


mode, if you want to save the changes you have made in the router..

Static Routing configuration in Router01


Connect to Router01 console and use the following IOS commands to configure static
routing in Router01. The "ip route" commands shown below states that to reach
172.18.0.0/16, 172.19.0.0/16 and 172.20.0.0/16 networks, handover the packets to the
gateway ip address 172.17.0.2. The networks 172.16.0.0/16 and 172.17.0.0/16 are
conneted directly to Router01.

Router01>enable

Router01#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router01(config)#ip route 172.18.0.0 255.255.0.0 172.17.0.2

Router01(config)#ip route 172.19.0.0 255.255.0.0 172.17.0.2


Router01(config)#ip route 172.20.0.0 255.255.0.0 172.17.0.2

Do remember to run the "copy running-config startup-config" command from enable


mode, if you want to save the changes you have made in the router.

To view the routing table in Router01, run "show ip route" command in Router01 as
shown below.

Router01#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

C 172.16.0.0/16 is directly connected, FastEthernet0/0

C 172.17.0.0/16 is directly connected, Serial0/0

S 172.18.0.0/16 [1/0] via 172.17.0.2

S 172.19.0.0/16 [1/0] via 172.17.0.2

S 172.20.0.0/16 [1/0] via 172.17.0.2

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.

Static Routing configuration in Router02


Connect to Router02 console and use the following IOS commands to configure static
routing in Router02. The "ip route" commands shown below states that to reach
172.16.0.0/16 network, handover the packets to the gateway ip address 172.17.0.1 and
to reach 172.20.0.0/16 network, handover the packets to the gateway ip address
172.19.0.2. The networks 172.17.0.0/16, 172.18.0.0/16 and 172.19.0.0/16 are
connected directly to Router02.

Router02>enable
Router02#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router02(config)#ip route 172.16.0.0 255.255.0.0 172.17.0.1

Router02(config)#ip route 172.20.0.0 255.255.0.0 172.19.0.2

Do remember to run the "copy running-config startup-config" command from enable


mode, if you want to save the changes you have made in the router.

To view the routing table in Router02, run "show ip route" command in Router02 as
shown below.

Router02#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

S 172.16.0.0/16 [1/0] via 172.17.0.1

C 172.17.0.0/16 is directly connected, Serial0/0

C 172.18.0.0/16 is directly connected, FastEthernet0/0

C 172.19.0.0/16 is directly connected, Serial0/1

S 172.20.0.0/16 [1/0] via 172.19.0.2

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.

Static Routing configuration in Router03


Connect to Router03 console and use the following IOS commands to configure static
routing in Router03. The "ip route" commands shown below states that to reach
172.16.0.0/16, 172.17.0.0/16 and 172.18.0.0/16 networks, handover the packets to the
gateway ip address 172.19.0.1. The networks 172.19.0.0/16 and 172.20.0.0/16 are
conneted directly to Router03.

Router03>enable

Router03#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router03(config)#ip route 172.16.0.0 255.255.0.0 172.19.0.1

Router03(config)#ip route 172.17.0.0 255.255.0.0 172.19.0.1

Router03(config)#ip route 172.18.0.0 255.255.0.0 172.19.0.1

Do remember to run the "copy running-config startup-config" command from enable


mode, if you want to save the changes you have made in the router.

To view the routing table in Router03, run "show ip route" command in Router03 as
shown below.

Router03#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

S 172.16.0.0/16 [1/0] via 172.19.0.1

S 172.17.0.0/16 [1/0] via 172.19.0.1

S 172.18.0.0/16 [1/0] via 172.19.0.1

C 172.19.0.0/16 is directly connected, Serial0/1

C 172.20.0.0/16 is directly connected, FastEthernet


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.

How to configure Default Routing in Cisco Routers


This tutorial explains how to configure and use a default route in routing through a practical
example in the Packet Tracer. Learn how to configure default routing in Cisco routers.

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.

Usually, a default route is used in the following situations.

 To forward all packets to a single destination.


 To forward all unknown packets (whose destination network addresses are not available in the
routing table) to a server or a device for logging and troubleshooting purposes.
 To forward all packets to a device or a router that knows how to reach remote networks or has a
routing table that has entries for all remote networks.

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.

Default Routes in Cisco Routers Explained

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.

Configure default routing for a single exit point


If two sites are connected through a single connection, instead of a routing protocol that
consumes precious bandwidth by sending broadcast messages, they can use a default route. For
example, suppose a company has a central office and several remote sites. Each remote site has
only one possible physical route to send packets to the central office. Since each site has only
one route to reach the central office, it can use a default route.

Let’s simulate this example in the packet tracer.

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.

Router(config)#ip route 0.0.0.0 0.0.0.0 [exit-interface or IP address of the next-hop]


If you want to use the exit-interface in the configuration, specify the name of the local interface
that is connected to the central office.

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.

Let’s use both options in the configuration.

Configure a default route on RS1 and RS2 using the exit-interface option.
Remote site 1 (RS1)

Router(config)#ip route 0.0.0.0 0.0.0.0 serial 0/0/0


Remote site 2 (RS2)

Router(config)#ip route 0.0.0.0 0.0.0.0 serial 0/0/0


Since both routers RS1 and RS2 are connected to the central office through their serial 0/0/0
interfaces, I specified the value "serial 0/0/0" in the exit-interface option of both commands.

The following image shows both commands in the packet tracer.

Configure a default route on RS1 and RS2 using the IP address of the next-hop option.

Remote site 3 (RS3)

Router(config)#ip route 0.0.0.0 0.0.0.0 30.0.0.1


Remote site 4 (RS4)

Router(config)#ip route 0.0.0.0 0.0.0.0 40.0.0.1


Remote sites RS3 and RS4 are connected to the central office’s router’s serial 0/1/0 and serial
0/1/1 interfaces, respectively. IP addresses 30.0.0.1 and 40.0.0.1 are configured on serial 0/1/0
and serial 0/1/1 interfaces, respectively. Thus, to configure default routes, I specified these
addresses in the next-hop options of both commands.
The following image shows both commands in the packet tracer.

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.

Router(config)#ip route 60.0.0.0 255.0.0.0 10.0.0.2


Router(config)#ip route 70.0.0.0 255.0.0.0 20.0.0.2
Router(config)#ip route 80.0.0.0 255.0.0.0 30.0.0.2
Router(config)#ip route 90.0.0.0 255.0.0.0 40.0.0.2
The following image shows these commands with output.
Once the static routing has configured on the central office’s router, all remote sites can not only
exchange data from the central office’s network but can also communicate with each other
through the central office’s router.

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy