Sei sulla pagina 1di 77

Module 2 - Routing

Module 2 - Routing

2.1 Router Basic Configuration


2.2 Static and Default Routing
2.3 OSPF Point to Point and Broadcast
2.4 OSPF Multi Area
2.5 EIGRP
WHAT IS A ROUTER?
A router is a specialized networking(Interworking device) device connected to two or
more networks running software that allows the router to move data from
one network to another.
Router functions in an Internet protocol based network operate at the network layer (OSI
Model's layer 3).
The primary function of a router is to connect networks together and keep certain kinds
of broadcast traffic under control.
There are several companies that make routers: Cisco, Linksys, Juniper, Netgear, Nortel
(Bay Networks), Redback, Lucent, 3Com, HP, Dlink and Belkin just to name a few.
Note:
Broadcast domain
Collision domain
ROUTER COMPONENTS & PARTS
Since routers are just specialized computers, the have the same "parts" as other
computers:

MAJOR INTERNAL COMPONENTS OF A ROUTER:


 CPU
 RAM
 NVRAM
 FLASH
 ROM
 CONSOLE
 INTERFACES
CPU
• Executes Operating System Instructions.
• The CPU Performs Functions Just As It Does In A Normal PC.
• It Executes Commands Given By The IOS Using Other Hardware Components.

RANDOM ACCESS MEMORY (RAM)


 Contains The Running Copy Of Configuration File.
 Stores Routing Table.
 RAM Is Used To Store Operational Information Such As Routing Tables, Router's Running Configuration File.
 RAM Also Provides Caching And Packet Buffering Capabilities. Its Contents Are Lost When You Switch Off Or
Restart The Router.
READ-ONLY MEMORY (ROM)
• Holds Diagnostic Software Used When Router Is Powered Up.
• Stores The Router’s Bootstrap Program.

NON-VOLATILE RAM (NVRAM)


• Stores Startup Configuration.
• This May Include IP Addresses (Routing Protocol, Hostname Of Router).
• NVRAM Does Not Lose Its Information When Power Is Turned Off.
• This Is In Contrast To The Most Common Forms Of RAM, Such As DRAM, That Requires Continual
Power To Maintain Its Information.
• NVRAM Is Used By The Cisco IOS As Permanent Storage For The Startup Configuration File (Startup-
Config).
• All Configuration Changes Are Stored In The Running-Config File In RAM, And With Few Exceptions are
Implemented Immediately By The IOS.
• To Save Those Changes In Case The Router Is Restarted Or Loses Power, The Running-Config Must Be
Copied To NVRAM, Where It Is Stored As The Startup-Config File.
• NVRAM Retains Its Contents Even When The Router Reloads Or Is Powered Off.

FLASH MEMORY
• Contains The Operating System (Cisco IOS).
• Flash Memory Is Nonvolatile Computer Memory That Can Be Electrically Stored And Erased.
• Flash Is Used As Permanent Storage For The Operating System, Cisco IOS.
• In Most Models Of Cisco Routers, The IOS Is Permanently Stored In Flash Memory And Copied Into
RAM During The Bootup Process, Where It Is Then Executed By The CPU.
• Some Older Models Of Cisco Routers Run The IOS Directly From Flash.
Network Interfaces
 Routers always have lots of network interfaces.

 The operating system contains 'drivers' that allow the operating system to access the network
hardware in the interface modules.
 Routers will learn which networks are configured on which ports as they start up.

 After that, they will 'learn' routes from other routers they are connected to, and learn which interface
to transmit packets on to reach a remote network destination.

• Ethernet
• Fast Ethernet
• Gigabit Ethernet
• Serial interface
• console port
• Auxiliary port
• loopback interface
Ethernet
 Ethernet is the traditional technology for connecting wired local area networks (LANs),
 Enabling devices to communicate with each other via a protocol
 A set of rules or common network language.
 An Ethernet cable is the physical, encased wiring over which the data travels.
Fast Ethernet
• Fast Ethernet is a local area network (LAN) transmission standard that provides a data rate of 100
megabits per second (referred to as "100BASE-T").
Gigabit Ethernet
• Gigabit Ethernet is part of the Ethernet family of computer networking and communication standards.
• The Gigabit Ethernet standard supports a theoretical maximum data rate of 1 gigabit per second
(Gbps) (1000 Mbps)
• These cable types follow the 1000BASE-T cabling standard (also called IEEE 802.3ab).
Serial interface
 In computer networking, a serial port enables external modems to connect to a PC or network router
via a serial cable.
 The term "serial" signifies that data sent in one direction always travels over a single wire within
the cable.
console port
 Console port is used to connect a computer directly to a router or switch and manage the router or
switch since there is no display device for a router or switch .
 The console port must be used to initially to install routers onto because there is no network
connection initially to connect using SSH, HTTP or HTTPS.
Auxiliary port
 The purpose of the auxiliary port is for connecting to an external modem.
 Once configured, this modem can be used as a backup demand-dial connection to another location,
 (or)
 As a way to dial in to the router for troubleshooting purposes should regular connectivity fail.

loopback interface
 Most IP implementations support a loopback interface to represent the loopback facility.
 Any traffic that a computer program sends on the loopback network is addressed to the same
computer.
 The most commonly used IP address on the loopback network is 127.0.0.1 for IPv4 and ::1 for IPv6.
WHY DO I NEED A ROUTER?
FUNCTIONS OF A ROUTER
 Restrict broadcasts to the LAN

 Act as the default gateway.


 Perform Protocol Translation.

 Move (route) data between networks

 Learn and advertise loop free paths


 Calculate 'best paths' to reach network destinations.
Router Boot up Process
 On Power On Cisco Router First Will Perform The POST( Power On Self Test).
 The POST Tests The Hardware To Verify That All Components Of The Device Are Operational And Present.
 (For Example, The POST Checks For The Different Interfaces On The Router. The POST Is Stored In And Run From ROM)
 The Bootstrap Looks For And Loads The Cisco IOS Software.
 The Bootstrap Is A Program In ROM That Is Used To Execute Programs.
 The Bootstrap Program Is Responsible For Finding Where Each IOS Program Is Located And Then Loading The File.
 By Default, The IOS Software Is Loaded From Flash Memory In All Cisco Routers.
 The IOS Software Looks For A Valid Configuration File Stored In NVRAM. Which Is Called As Startup-Config.
 If A Startup-Config File Is In NVRAM, The Router Will Load And Run This File.
 The Router Is Now Operational. If A Startup-Config File Is Not In NVRAM, The Router Will Start The Setup-Mode Configuration
Upon Bootup.
 Any Further Modification On Running Router Will Be Stored On RAM, Where You Need To Manually Execute Command Copy
Running-Config Startup-Config To Make Your Current Configuration As A Startup-Config, Every Time You Boot Your Router.
MOVE (ROUTE) DATA BETWEEN NETWORKS
 Routers have the capability to move data from one network to another.
 This allows two networks managed by different organizations to exchange data.
 They create a network between them and exchange data between the routers on that network.
 Because a router can accept traffic from any kind of network it is attached to, and forward it to any
other network, it can also allow networks that could not normally communicate with each other to
exchange data.
 In technical terms, a token ring network and an Ethernet network can communicate over a serial
network. Routers make all this possible.
 In this way a router can also perform 'protocol conversion', provided it has the appropriate hardware
and software to support such a function.
 The whole point, however, is to forward the data from the interface it receives data on, to another
interface that retransmits the received data onto another interface serving another network.
Routing
 Processing of packets from one network to another network is known as routing. (or)
 Routing is the path that network data or a packet takes to reach its destination on a network.
 The network router is what decides the best route for each network packet.
Basic components needed to route:
• Routable Protocol (IPv4, IPv6, etc.)
• Network address with Subnet mask
• Next Hop & Metric
Points to Remember
• Router will only use routes with reachable “next hops”
• Routers will only use the “best” routes
• Routing protocols DO NOT send packets across the network. Their role is to determine the best path for
routing.
• Routed protocols actually send the data, and the most common example of a routed protocol is IP.
The routing table is concerned with two types of Layer-3 protocols:
Routed protocols - assigns logical addressing to devices, and routes
packets between networks. Examples include IP and IPX.
Routing protocols - dynamically builds the information in routing
tables. Examples include RIP, EIGRP, and OSPF.
Types of Routing
• Static Routing
• Default Routing
• Dynamic Routing
Basic Router Configuration

Console

CAT 5
CAT 5

RJ45
Enter privileged EXEC mode.
Router>enable (>disable)
Router#?
Router#interface?
R1(config)#do #show
Router##show running configuration (sh run)

Enter global configuration mode.


Router#configure terminal or config t
Router(config)#exit
Router(config)#end
Router(config)##show version or sh ver
Router(config)##show interface brief or (sh ip int bri)
Configure the router name as Cisco
Enter the command hostname Cisco at the prompt.
Router(config)#hostname Cisco
R1(config)#
Configure the EXEC mode password.
Configure the EXEC mode password using the enable secret password command. Use class for the password.
• R1(config)#enable password cisco
• R1(config)#exit
Disable DNS lookup
Disable DNS lookup with the no ip domain-lookup command.
R1(config)#no ip domain-lookup
To avoid unnecessary message
R1(config)#line console 0
R1(config)#logging synchronous
Configure a message-of-the-day banner.

Configure a message-of-the-day banner using the banner motd command.


R1(config)#banner motd &
Enter TEXT message. End with the character '&'.

********************************
!!!AUTHORIZED ACCESS ONLY!!!
********************************
&

Configure the FastEthernet0/0 interface.


Configure the FastEthernet0/0 interface with the IP address 192.168.1.1/24.
R1(config)#sh ip int bri

R1(config)#interface fastethernet 0/0


R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
Configure the console password on the router(Console).

Use cisco as the password. When you are finished, exit from line configuration mode.
R1(config)#line console 0
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
R1(config)#

Configure the password for the virtual terminal lines(Telnet).

Use cisco as the password. When you are finished, exit from line configuration mode.
R1(config)#line vty ?

R1(config)#line vty 0 4
R1(config-line)#password cisco
R1(config-line)#login
R1(config-line)#exit
R1(config)#
Configure the Serial0/0/0 interface.
Configure the Serial0/0/0 interface with the IP address 192.168.2.1/24. Set the clock
rate to 64000.
Note: The purpose of the clock rate command is explained in Chapter 2: Static
Routes.

R1(config-if)#interface serial 0/0/0


R1(config-if)#ip address 192.168.2.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
R1(config-if)#

Note: The interface will be activated until the serial interface on R2 is configured
and activated
R1(config)#clock set 10:46:03 6 march 2019
R1(config)##show clock

Return to privileged EXEC mode.


Use the end command to return to privileged EXEC mode.
R1(config-if)#end

Save the R1 configuration.


Save the R1 configuration using the copy running-config startup-config command.
R1#copy running-config startup-config (wr) (write memory)
R1##show running-config
R1##show startup-config
Deleting the configuration and reloading the device
R1#erase startup-config
R1#no

R1#reload

R1#ping ?
Static Routing & Default routing

Types of Routing
1. Static Routing
2. Default Routing
3. Dynamic Routing

1. Static routing is when you statically configure a router to send traffic for particular destinations in preconfigured
directions.

2. Default route is a setting on a computer that defines the packet forwarding rule to use when no specific route can
be determined for a given Internet Protocol (IP) destination address. All packets for destinations not established in
the routing table are sent via the default route.

3. Dynamic routing is when you use a routing protocol such as OSPF, ISIS, EIGRP, and/or BGP to figure out what paths
traffic should take.
Static Routing
Configuring Routes on Cisco Router(Static Routing)
Assign each host(PC) an IP.
Also we have to assign an IP for each interface on the router.

Assign an IP for the Router interface and start it up using the following commands:
#sh ip int bri
R1(config)#interface fa0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
(And do the same thing for the other routers)

Where:

fa0/0 is the name of the interface.


192.168.1.1 is the IP address for interface fa0/0.
255.255.255.0 is the subnet mask being used on the network that connected directly to the interface.
no shutdown to start up the interface.
Configure the Serial0/0/0 interface
R1(config-if)#interface serial 0/0/0
R1(config-if)#ip address 192.168.2.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown

R1#sh ip config
 Run the same commands for all routers interfaces and assign each interface an appropriate IP/mask pair.

 To review routing table on a router, use command “#show ip route”:

R1#sh ip route
R1#ip route 192.168.3.0 255.255.255.0 192.168.2.2 (Next hop)
R1#sh ip route
Run the same commands for all routers

 Now check the connectivity of the network using “ping” command, or “tracert” command.
Default Routing
Default Routing
#sh ip int bri
Assign an IP for the Router interface and start it up using the following commands:

R2(config)#interface fa0/1
R2(config-if)#ip address 10.0.0.1 255.0.0.0
R2(config-if)#no shutdown
#ip route 0.0.0.0 0.0.0.0 192.168.2.2(next hop)
(And do the same thing for the other router R1)
Where:
0.0.0.0 is the destination network IP [0.0.0.0 in case of default routing]
0.0.0.0 is the subnet mask being used on the destination network.
192.168.2.2 is the address of the next-hop router that will receive the packet and forward it to the
destination network.
 Now check the connectivity of the network using “ping” command, or “tracert” command.
Dynamic routing
 Dynamic routing uses a dynamic routing protocol to automatically select the best route to put into the
routing table.
 So instead of manually entering static routes in the routing table, dynamic routing automatically
receives routing updates, and dynamically decides which routes are best to go into the routing table.
 Its this intelligent and hands-off approach that makes dynamic routing so useful.
There are three major types of routing protocols.
• Routing Information Protocols(RIP)
• Interior Gateway Protocol (IGRP)
• Open Shortest Path First (OSPF)
• Exterior Gateway Protocol (EGP)
• Enhanced interior gateway routing protocol (EIGRP)
• Border Gateway Protocol (BGP)
• Intermediate System-to-Intermediate System (IS-IS)
Open Shortest Path First(OSPF)
 OSPF (Open Shortest Path First) is a link state routing protocol.
 Because it is an open standard, it is implemented by a variety of network vendors.
 OSPF will run on most routers that doesn’t necessarily have to be Cisco routers.
 Port no. 89

Here are the most important features of OSPF:

A classless routing protocol


Supports VLSM, CIDR, manual route summarization, equal cost load balancing
Incremental updates are supported
Uses only one parameter as the metric – the interface cost.
The administrative distance of OSPF routes is, by default, 110.
Uses multicast addresses 224.0.0.5 and 224.0.0.6 for routing updates.
• Routers running OSPF have to establish neighbor relationships before exchanging
routes.
• Because OSPF is a link state routing protocol, neighbors don’t exchange routing
tables. Instead, they exchange information about network topology.
• Each OSPF router then runs SPF algorithm to calculate the best routes and adds those
to the routing table.
• Because each router knows the entire topology of a network, the chance for a
routing loop to occur is minimal.

Each OSPF router stores routing and topology information in three tables:
• Neighbor table – stores information about OSPF neighbors
• Topology table – stores the topology structure of a network
• Routing table – stores the best routes
OSPF neighbors
• OSPF routers need to establish a neighbor relationship before exchanging routing
updates.
• OSPF neighbors are dynamically discovered by sending Hello packets out each OSPF-
enabled interface on a router.
• Hello packets are sent to the multicast IP address of 224.0.0.5.

The following fields in the Hello packets must be


the same on both routers in order for routers to
become neighbors:
1. Subnet
2. Area id
3. Hello and dead interval timers
4. Authentication
5. Area stub flag
6. MTU
DR and BDR
• When multiple OSPF routers are connected to a multi-access medium such as Ethernet, a Designated
Router (DR) and a Backup Designated Router (BDR) are elected.
• DR's reduce network traffic as only they maintain the complete ospf database and then send updates
to the other routers on the shared network segment.
• DR will then distribute topology information to every other router inside the same area, which greatly
reduces OSPF traffic.
• To send routing information to a DR or BDR the multicast address of 224.0.0.6 is used.
• Every router on a network segment will establish a full neighbor relationship with the DR and BDR.
 If two or more routers have the same ospf priority , the router with the highest router-id is elected
DR, and theelection process start again for BDR.
 After a DR is elected , election do not take place again unless the DR or BDR are lost. default priority is
1.
OSPF neighbor states
DBD: Data Base Description LSDB: Link State Data Base
Link State Request Link State Update
OSPF Point to Point Network Configuration

Assign the IP address to all the interfaces And PC’s

Cmd>ipconfig
#sh ip route
Implementing OSPF R1
#config t
#router ospf 1 (Process ID)
#network 192.168.3.0 0.0.0.255 area 0
#network 192.168.2.0 0.0.0.255 area 0
Implementing OSPF in R2
#config t
#router ospf 1 (Process ID)
#network 192.168.2.0 0.0.0.255 area 0
#network 192.168.1.0 0.0.0.255 area 0 Now Routers can
learn and maintain
#sh ip route their neighbor
#sh ip protocols #sh ip ospf neighbor relation
>ping #sh ip ospf database
Broadcast OSPF Configuration
• All routers should be same series.
• Assign the same network IP address(1.0)

1.1 1.2 Implement OSPF in all the routers


#router ospf 10
#network 192.168.1.0 0.0.0.255 area 0

#sh ip ospf neighbor

#sh ip ospf interface gigabitEthernet 0/0


(Priority and Broadcast N/w)

1.3 1.4
To make router as DR we have to change its IP address range

#interface gi0/0
#ip ospf priority 100

Now restart the router

#clear ip ospf process

Then clear the ospf in all the routers with same command.
OSPF Areas
 An OSPF network can be divided into sub-domains called areas.
 An area is a logical collection of OSPF networks, routers, and links that have the same area identification.
 A router within an area must maintain a topological database for the area to which it belongs.
 The router does not have detailed information about network topology outside of its area, which thereby
reduces the size of its database.

The main benefits of using areas in an OSPF network are:


 The routing tables on the routers are reduced.
 Less time is required to run the SPF( Dijkstra's algorithm) algorithm, since routers need to recalculate their
link-state database only when there’s a topology change within their own area.
 Routing updates are reduced.
 Each area in an OSPF network must be connected to the backbone area (also known as area 0).
 All routers inside an area must have the same area ID in order to become OSPF neighbors.
 A router that has interfaces in more than one area (area 0 and area 1, for example) is known as an Area
Border Router (ABR).
 A router that connects an OSPF network to other routing domains (to an EIGRP network, for example) is
called an Autonomous System Border Routers (ASBR).
OSPF SUMMARY
OSPF SHOW COMMANDS

#show ip ospf neighbor


#show ip ospf interface
#show ip protocols
#show ip route
#show ip ospf database
#show ip ospf interface gi0/0
#show ip ospf interface s0/0/0
#show ip interface brief
1. What protocol does OSPF use?
2. How does OSPF determine whether other Link State routers are operating on the
interfaces as well?
3. When a _______ routing protocol is enabled for a particular link, information associated
with that network is added to the local Link State Database (LSDB).
4. OSPF utilizes IP Multicast when sending and receiving updates on Multi-Access
networks,
such as Ethernet. True or false?
5. OSPF is a hierarchical routing protocol that logically divides the network into subdomains
referred to as _______.
6. Name at least 4 OSPF network types.
7. Name the command used to enter OSPF configuration mode.
8. When determining the OSPF router ID, Cisco IOS selects the lowest IP address of the
configured Loopback interfaces. True or false?
9. What command can you use to assign an interface to OSPF Area 2 (interface level
command)?
10. _______ can be described as interfaces over which no routing updates are sent.
Enhanced Interior Gateway Routing Protocol (EIGRP)
 EIGRP (Enhanced Interior Gateway Routing Protocol) is an advanced distance vector routing protocol.

 It is sometimes referred to as a hybrid routing protocol because it has characteristics of both distance-
vector and link-state routing protocols.
 EIGRP replaced Interior Gateway Routing Protocol (IGRP), an older proprietary Cisco routing protocol.

 EIGRP was also a proprietary protocol, but Cisco decided in 2013 to convert it to an open standard.

 This routing protocol is mostly used on Cisco devices and all routers in the network must support it.

The following features make EIGRP especially helpful in large and complex networks:
 support for classless routing and VLSM (Variable Length Subnet Masking).
 routes can be summarized on any router in the network.
 incremental routing updates.
 support for load-balancing.
 support for IPv4 and IPv6.
 EIGRP uses Cisco’s Reliable Transport Protocol (RTP) to send messages and uses the multicast address
of 224.0.0.10.
 The default administrative distance of EIGRP is 90, which is less than the default administrative distances
of RIP and OSPF, which means that EIGRP routes will be preferred over RIP and OSPF routes.
 The metric is calculated using bandwidth, delay, reliability and load.
 The hold time is the amount of time that a router will consider a neighbor alive without receiving a hello
packet. The hold time is typically three times the hello interval, by default, 15 seconds.
 Port no.88
 Diffusing Update Algorithm (DUAL)
EIGRP neighbors
 Routers that run EIGRP must become neighbors before exchanging routing information.
 To dynamically discover neighbors on the directly attached networks, EIGRP routers use the multicast
address of 224.0.0.10 to send Hello packets every couple of seconds.
Configuration of EIGRP
Verifying EIGRP
Router#show ip eigrp neighbors
Router#show ip eigrp traffic
Router#show ip route
Router#show ip route eigrp

Potrebbero piacerti anche