0% found this document useful (0 votes)
15 views11 pages

OSPF Configuration in Cisco Network

Uploaded by

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

OSPF Configuration in Cisco Network

Uploaded by

yacineallam00
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Pratical Lesson 5

Static/Dynamic Routing (OSPF) in an IP network


(Haidar / Ollivier / Radi / Teillac)

The objective of this practical lesson is to configure an OSPFv2 routing protocol in a network
established under the Cisco Packet Tracer simulator.

The network to build is shown in Figure 1, it is a corporate network shared on two sites
"Headquarters" and "Data Services" with a connection to the Internet.

Figure 1 Network to build


Part of the network is already preconfigured (see Figure 2), it is provided as the [Link] file on moodle.

Figure 2 : Network to complete

The main steps of this practical lesson are:

Step 1. Complete the network according to Figure 1 and configure the devices basic settings.
Step 2. Configure routers using static routing to provide connectivity between different subnets as
well as connectivity to the Internet.
Step 3. Configure routers using the OSPFv2 routing protocol and analyze the functionalities of this
protocol.
Part 1. Complete the network and configure the devices basic
settings

The first part is to complete the configuration given in the [Link] file by wiring the additional
networks and configuring the basic parameters:

Step 1. Complete the address table by adding missing IP addresses for router
and equipment interfaces in networks.

Address table

Device Interface IP Address / Prefix

P2P-1 S0/1/0 [Link]/30


P2P-1 S0/1/1 [Link]/30
P2P-1 S0/2/0 [Link]/30
P2P-2 S0/1/0 [Link]/30
P2P-2 S0/1/1 [Link]/30
P2P-2 G0/0/0 [Link]/24
P2P-2 G0/0/1 [Link]/24
P2P-3 S0/1/0 [Link]/30
P2P-3 S0/1/1 [Link]/30
P2P-3 G0/0/0 [Link]/28
BC-1 S0/1/0 [Link]/30
BC-1 S0/1/1 [Link]/30
BC-1 G0/0/0
BC-2 G0/0/0
BC-2 G0/0/1 [Link]/29
BC-3 G0/0/0
BC-3 G0/0/1 [Link]/29
Internet Server Network adapter [Link]/24
PC0 Network adapter
Laptop 1 Network adapter
Serveur Workgroup Network adapter
PC2 Network adapter [Link]/24
PC1 Network adapter [Link]/24
Step 2. Connect networks with straight Ethernet cables, respect the designation
of interfaces as shown in the figure, Use CISCO 2960 switches with 24 ports

Step 3. Configure the machines

To configure IP addresses on machines (PCs, laptops, server, etc.) according to the Addressing Table.
Click on Web Server/PC/Laptop > Desktop > IP Configuration. Enter the IPv4 address, subnet mask,
and default gateway information according to the address table.

Step 4. Configure the routes

A CISCO router works thanks to an IOS operating system, IOS is the acronym for "Internetworks Operating
System". This system is manageable through a command line interface.

The different user modes:

• User Mode: Allows you to view all the information related to the router without being able to modify it.
The shell is as follows:
Router >
• Privileged User: Allows viewing router status and importing/exporting images from IOS. The shell is as
follows:
Router #
• Global Configuration Mode: Allows you to use the router's general configuration commands. The shell
is as follows:
Router (config) #
• Interface Configuration Mode: Allows you to use interface configuration commands (IP addresses, mask,
etc.). The shell is as follows:
Router (config-if) #

The basic configuration of a router is to configure the router's interfaces by assigning them IP addresses based
on their membership in the networks of the predefined topology.

1. Basic router configuration

a. Access the router through the console and enable privileged execution mode.
Router> enable
Router#
b. Switch to global configuration mode.
Router# config terminal
Router(config)#
c. To access the initial configuration of the router
Router# show running-config
d. Disable DNS lookup to prevent the router from trying to translate the commands entered as if they
were hostnames.
R1(config)# no ip domain-lookup

A CISCO router has two configuration files, the file called startup-config and a file called running-
config. The configuration called startup-config is the configuration used the router starts, the
configuration called running-config is the current configuration used by the router.

Thus, when starting the router, the startup-config and running-config configurations are the same.

If a configuration change is made, the running-config will be modified. However, the startup-config
will not be modified. To change the boot configuration, you will have to save the current configuration
(running-config) in the startup-config.

Therefore, any changes made and not saved will be undone the next time the router starts.

e. The following two commands can be used to save the current configuration:
R1# copy running-config startup-config
R1# write

2. Configure the router interfaces

Un routeur assure l’interconnexion de plusieurs réseaux. En conséquence, chaque interface du routeur fait partie
d’un réseau donné. Pour configurer une interface, il faut lui attribuer une adresse IP en fonction de son
appartenance aux réseaux de la topologie prédéfinie (selon la table d’adressage).

A router role is to interconnect multiple networks. As a result, each interface of the router is part of a given
network. An IP address has to be assigned to each of the router network interface according to the predefined
topology (see the addressing table) and to which network the network interface is attached to.
Commands used to assign the IP address on a router interface:

R1(config)# interface interface-name

Router(config-if)# ip address interface-address network-mask

Router(config-if)# no shutdown

Below is an example of assigning an IP address a R1 router interface. The interface must be explicitly enabled
with the no shutdown command.

R1(config)# interface FastEthernet0


R1(config-if)# ip address [Link] [Link]
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# exit
R1#

Save the current configuration to the initial configuration file.

R1# copy running-config startup-config


Destination filename [startup-config]?
Building configuration...
[OK]
R1#

1. Configure router interfaces for the added networks.


2. Check this part by pinging from the machines to the gateway routers.
3. Have this part validated by your teacher.

Before proceeding to Part II, save two copies of the packet tracer file :
• as Lab5_Static.pkt (which will be used in Part 2 of this practical lesson);
• and Lab5_Dynamic.pkt file (which will be used in Part 3).
Part 2. Static Routing

In this part you must use the TP5_Static.pkt file.

A router uses a routing table to determine where packets are sent. The routing table contains a set of routes that
indicate which gateway or interface the router uses to reach a given network. The routing table initially contains
the networks directly connected. In order to allow communication with remote networks, routes must be created
and added to the routing table.

Step 1. Check the routing tables


Using the command:

Router# show ip route

1. Check the router routing tables before adding static routes.

Step 2. Configure the static routes

With a static route, the IP address of the next node is specified. Use the following commands to configure static
routes:

Router(config)# ip route network-address subnet-mask ip-address-next-hop

For the default route, you can use the commands:

Router(config)# ip route [Link] [Link] ip-address-next-hop

Or :

Router(config)# ip route [Link] [Link] interface-sortie

2. Configure the static routes on the routers so that full connectivity can be provided between all
network segments.

3. Configure a default route on the Se0/1/1 interface to allow access to the internet.

4. Configure default routes on routers to allow Internet access.

5. Check the routers routing tables.

6. Cross-ping between PC1 and Laptop1, PC1 and Workgroup Server, PC1 and PC2, PC1 and PC3.

7. Have this part validated by your teacher.


Part 3. Dynamic Routing

You have seen in the second part the difficulty related to the configuration of static routing, indeed static routing
has disadvantages in the case of expanding networks:

• Initial setup and maintenance takes time.


• Configuration is error-prone, especially in large networks.
• Administrator intervention is required to keep routing informations up to date.
• Requires complete knowledge of the entire network for proper implementation.
• With the evolution of the network size, maintenance becomes tedious.

The Open Shortest Path First (OSPF) protocol is a dynamic routing protocol of the "link states" type. It is based
on the periodic delivery by each OSPF router of Link State Advertisment (LSA) link state packets, containing
information about the state of its interfaces and adjacent relationships with its neighboring routers.

LSAs are spread to all neighbors except the one from where they originate. All of these link states form the
topological database of the Link State Database (LSD) network.

The OSPF is mainly based on two phases:

(1) learning the network topology by exchanging LSA packets between the different routers;

(2) calculating the shortest paths – using the Dijkstra algorithm (SFP) – to each destination and building the
routing table by choosing the best routes.

Step 1. Configurez le routage OSPF sur les routeurs:

OSPFv2 is enabled by using the following command in global configuration mode:

Router(config)# router ospf process-id

The process-id value represents a number between 1 and 65,535 and is selected by the network administrator.
The process-id value is locally significant, which means that it does not need to be the same on other OSPF
routers to establish adjacencies with these neighbors. It is recommended to use the same process-id on all OSPF
routers.

1. Configure OSPF routing on all routers.

Step 2. Configure the networks that are part of the dynamic routing process.
The networks adjacent to each router that will come into play in the routing process must be explicitly declared
on the router, this declaration is made at the following command:

Router(config-router)# network network-address wildcard-mask area area-id

This command must be launched in the mode (config-router), i.e. after entering the routing configuration mode
with the command: router ospf process-id

The wildcard-mask is usually the inverse of the subnet mask configured on this interface.

The simplest method to calculate a wildcard mask is to subtract the subnet mask from [Link], as shown
for the /24 and /26 subnet masks in the following figure.

2. Add the networks to the dynamic routing process on each router.

3. Check the routers routing tables

4. Cross-pings between machines in different networks

5. Validate this part by your teacher.

Step 3. Propagate a default route with OSPF

Users on your network will need to send packets outside the network to non-OSPF networks, such as the Internet.
This is where you'll need a default static route that they can use. In the topology in the figure, BC1 is connected
to the Internet and should propagate a default route to other routers.

To propagate a default route, the default router (BC1) must be configured:

• Add a default static route using the command :


ip route [Link] [Link] [next-hop-address | exit-interface]
• Propagate the route thanks to the following command
Router(config-router)#default-information originate

BC1 becomes the source of the default route information and the default static route is propagated in OSPF
updates.
6. Check the routers routing tables to see the default route added using OSPF

7. Ping the Internet.

8. Have this part validated by your teacher

Step 4. Check and change costs

OSPF calcule le coût pour chaque routeur pour atteindre chaque réseau, le coût d'une route OSPF est
la valeur cumulée depuis un routeur jusqu'au réseau de destination. Par exemple, le coût total pour
P2P-2 pour atteindre le réseau [Link]/24 est de 130. En effet, le coût du lien série (câble rouge)
entre P2P-2 → P2P-1 est de 64, et le coût du lien série (câble rouge) entre P2P-1 → BC-1 est de
64 et le coût des réseaux Gigabit Ethernet [Link]/29 et [Link]/24 est de 1 chacun, le coût total
est alors 64 + 64 +1 +1 = 130 comme le montre la table de routage ci-dessous.

OSPF calculates the cost for each router to reach each network, the cost of an OSPF route is the
cumulative value from a router to the destination network. For example, the total cost for P2P-2 to
reach the [Link]/24 network is 130.

Indeed, the cost of the serial link (red cable) between P2P-2 P2P-1 is 64, and the cost of the serial link
(red cable) between P2P-1 BC-1 is 64 and the cost of Gigabit Ethernet networks [Link]/29 and
[Link]/24 is 1 each, the total cost is then 64 + 64 +1 +1 = 130 as shown in the routing table
below.→→
OSPF cost values can be manipulated to influence the route chosen by OSPF.

1. Change the costs of links on routers and check the effect on the routing table.

2. Have this part validated by your teacher

Commands used to change the cost on a link are the following:

Router(config)# interface g0/0/1


Router(config-if)# ip ospf cost 30

Step 5. Test failover to new routes

3. Stop the serial interface between the two routers P2P-1 and P2P-2 with the shutdown
command and check the update on the routing table specifically for the path to the network
[Link]/24

4. Have this part validated by your teacher

You might also like