You are on page 1of 18

CS 321 – Computer Network Lab Manual

LAB NO. 09
DISTANCE VECTOR PROTOCOL: ROUTING
INFORMATION PROTOCOL (RIP)
CONFIGURATION
Following are the lab objectives:
Objectives
Lab

1. Understand the concept of dynamic routing


2. Implement the configurations of RIP

Roll No. 4979 Name Mubashir Hussain


Obtained
Marks Comments
Marks
Task 1 40
Total
40
Marks

Sir Asad
Hanif
Lab Instructor

1
CS 321 – Computer Network Lab Manual

Lab Objectives and CLOs Mapping

CLOs
Lab Objectives
a B C
1
2

Instructions
 This is individual Lab work/task.
 Complete this lab work within lab timing.
 Discussion with peers is not allowed.
 You can consult any book, notes & Internet.
 Copy paste from Internet will give you negative marks.
 Lab work is divided into small tasks, complete all tasks sequentially.
 Show solution of each lab task to your Lab Instructor.
 In-Lab Exercises/Tasks
 Write your code at provided space after each question
 You need to upload code for all tasks at Google Class.

2
CS 321 – Computer Network Lab Manual

NETWORK ROUTING
IP routing is the process of moving packets from one network to another network
using routers. But, you must first understand the difference between a routing
protocol and a routed protocol. A routing protocol is used by routers to dynamically
find all the networks in the internetwork and to ensure that all routers have the same
routing table. Basically, a routing protocol determines the path of a packet through an
internetwork. Examples of routing protocols are RIP, IGRP, EIGRP, and OSPF. Once
all routers know about all networks, a routed protocol can be used to send user data
(packets) through the established internetwork. Routed protocols are assigned to an
interface and determine the method of packet delivery. Examples of routed protocols
are IP and IPX.
Routing Basics
The term routing is used for taking a packet from one device and sending it through
the network to another device on a different network. Routers don't really care about
hosts—they only care about networks and the best path to each network. The logical
network address of the destination host is used to get packets to a network through a
routed network, and then the hardware address of the host is used to deliver the
packet from a router to the correct destination host.
If your network has no routers, then it should be apparent that you are not routing.
Routers route traffic to all the networks in your internetwork. To be able to route
packets, a router must know, at a minimum, the following:
• Destination address
• Neighbor routers from which it can learn about remote networks
• Possible routes to all remote networks
• The best route to each remote network
• How to maintain and verify routing information

The different types of routing you'll learn about in this section are:
• Static routing
• Default routing
• Dynamic routing

Static Routing

3
CS 321 – Computer Network Lab Manual

Static routing occurs when you manually add routes in each router's routing table.
Static routing has the following benefits:
• There is no overhead on the router CPU, which means you could possibly buy
a cheaper router than if you were using dynamic routing.
• There is no bandwidth usage between routers, which means you could possibly
save money on WAN links.
• It adds security, because the administrator can choose to allow routing access
to certain networks only.

Static routing has the following disadvantages:


• The administrator must really understand the internetwork and how each router
is connected in order to configure routes correctly.
• If a network is added to the internetwork, the administrator has to add a route
to it on all routers—by hand.
• It's not feasible in large networks because maintaining it would be a full-time
job in itself.

Default Routing
We use default routing to send packets with a remote destination network not in the
routing table to the next-hop router. You can only use default routing on stub
networks—those with only one exit path out of the network.
Dynamic Routing
Dynamic routing is when protocols are used to find networks and update routing
tables on routers.
True—this is easier than using static or default routing, but it'll cost you in terms of
router CPU processes and bandwidth on the network links. A routing protocol defines
the set of rules used by a router when it communicates routing information between
neighbor routers. There is number of routing protocols such as RIP, IGRP, EIGRP
and OSPF. In this lab, we will learn the RIP protocol only.

ROUTING INFORMATION PROTOCOL (RIP)

4
CS 321 – Computer Network Lab Manual

Routing Information Protocol (RIP) is a true distance-vector routing protocol which


based on finding the best path of a remote network by judging distance Each time a
packet goes through a router, that’s called hop. The route with the least number of
hops to the network is determined to be the best route.
RIP sends the complete routing table out to all active interfaces every 30 seconds.
RIP only uses hop count to determine the best way to a remote network, but it has a
maximum allowable hop count of 15 by default, meaning that 16 is deemed
unreachable. RIP works well in small networks, but it's inefficient on large networks
with slow WAN links or on networks with a large number of routers installed.

Configuring RIP Routing

Step 1: Create a topology like this and do basic configurations ip address to the router
interfaces, ip address and default gateway to the host same as in topology.

In Router R1,

R1(config)#interface fastethernet 2/0


R1(config-if)#ip address 10.0.0.1 255.0.0.0
R1(config-if)#no shutdown
R1(config-if)#exit

R1(config)#interface serial 1/0

5
CS 321 – Computer Network Lab Manual

R1(config-if)#ip address 20.0.0.1 255.0.0.0


R1(config-if)#clock rate 64000
R1(config-if)#encapsulation ppp
R1(config-if)#no shutdown
R1(config-if)#exit

In Router R2,

R2(config)#interface serial 1/0


R2(config-if)#ip address 20.0.0.2 255.0.0.0
R2(config-if)#encapsulation ppp
R2(config-if)#no shutdown
R2(config-if)#exit

R2(config)#interface fastethernet2/0
R2(config-if)#ip address 30.0.0.1 255.0.0.0
R2(config-if)#no shutdown
R2(config-if)#exit

By default routers know directly connected network. 

Step 2: Check the routing table of the router R1 and R2 by giving the command show
ip route in privileged mode,

In Router R1,

R1#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

6
CS 321 – Computer Network Lab Manual

Gateway of last resort is not set

C    10.0.0.0/8 is directly connected, FastEthernet2/0


C    20.0.0.0/8 is directly connected, Serial1/0

In Router R2,

R1#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    30.0.0.0/8 is directly connected, FastEthernet2/0


C    20.0.0.0/8 is directly connected, Serial1/0

Step 3: Now, Run Rip protocols on R1 and R2 .What rip will do is, it will create a
routing update by adding directly connected networks information and it will send to
neighbor routers, just add directly connected networks

In Router R1,

R1(config)#router rip
R1(config-router)#network 10.0.0.0
R1(config-router)#network 20.0.0.0
R1(config-router)#exit

7
CS 321 – Computer Network Lab Manual

In Router R2,

R2(config)#router rip
R2(config-router)#network 20.0.0.0
R2(config-router)#network 30.0.0.0
R2(config-router)#exit

Now routers learns network information automatically through routing updates

Step 4: Now give show ip route command in R1 and R2 and check the routing table

In Router R1,

R1#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    10.0.0.0/8 is directly connected, FastEthernet0/0


C    20.0.0.0/8 is directly connected, Serial2/0
R    30.0.0.0/8 [120/1] via 20.0.0.2, 00:00:28, Serial2/0

Here, network 30.0.0.0 learned by the router R1 via Serial 2/0 by routing update from
R2, that will be reachable via 20.0.0.2(next hop).

In Router R2,

R2#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

8
CS 321 – Computer Network Lab Manual

       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

R    10.0.0.0/8 [120/1] via 20.0.0.1, 00:00:16, Serial2/0


C    20.0.0.0/8 is directly connected, Serial2/0
C    30.0.0.0/8 is directly connected, FastEthernet0/0

Here, network 10.0.0.0 learned by the router R2 via Serial 2/0 by routing update from
R1, that will be reachable via 20.0.0.1(next hop).

Step 5: Now ping from the Host 10.0.0.10 to Host 30.0.0.10 by giving command 

ping 30.0.0.10

9
CS 321 – Computer Network Lab Manual

LAB TASKS
Task
According to the following figure and table, create the internetwork and configure the
network. Now apply routing information protocol (RIP) to perform dynamic routing.

10
CS 321 – Computer Network Lab Manual

ANS:
Router 0 Interface FastEthernet0/0

Router>enable
Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router rip
Router(config-router)#
Router(config-router)#end
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface FastEthernet0/0
Router(config-if)#
%SYS-5-CONFIG_I: Configured from console by console
ip address 172.16.20.1 255.255.0.0
Router(config-if)#ip address 172.16.20.1 255.255.0.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

11
CS 321 – Computer Network Lab Manual

Router 1 Interface GigabitEthernet0/0

Router>enable
Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router rip
Router(config-router)#
Router(config-router)#end
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router rip
Router(config-router)#
%SYS-5-CONFIG_I: Configured from console by console

Router(config-router)#end
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface GigabitEthernet0/0
Router(config-if)#
%SYS-5-CONFIG_I: Configured from console by console

Router(config-if)#exit
Router(config)#interface GigabitEthernet0/0
Router(config-if)#ip address
% Incomplete command.
Router(config-if)#ip address 172.16.20.1 255.255.0.0
Router(config-if)#ip address 172.16.20.1 255.255.0.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

12
CS 321 – Computer Network Lab Manual

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up


%IP-4-DUPADDR: Duplicate address 172.16.20.1 on GigabitEthernet0/0, sourced by
00D0.FF8C.064D
%IP-4-DUPADDR: Duplicate address 172.16.20.1 on GigabitEthernet0/0, sourced by
00D0.FF8C.064D

Router>enable
Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router rip
Router(config-router)#
Router(config-router)#end
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router rip
Router(config-router)#
%SYS-5-CONFIG_I: Configured from console by console

Router(config-if)
Router(config-if)#ip address 172.15.10.2 255.255.0.0
Router(config-if)#ip address 172.15.10.2 255.255.0.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up

13
CS 321 – Computer Network Lab Manual

Router>enable
Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface GigabitEthernet0/0
Router(config-if)#
Router(config-if)#exit
Router(config)#interface GigabitEthernet0/0
Router(config-if)#ip address 172.16.20.2 255.255.0.0
Router(config-if)#ip address 172.16.20.2 255.255.0.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

14
CS 321 – Computer Network Lab Manual

Router>enable
Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface GigabitEthernet0/0
Router(config-if)#
Router(config-if)#exit
Router(config)#interface GigabitEthernet0/0
Router(config-if)#ip address 172.16.20.2 255.255.0.0
Router(config-if)#ip address 172.16.20.2 255.255.0.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

Router(config-if)#exit
Router(config)#interface GigabitEthernet0/1
Router(config-if)#no ip address
Router(config-if)#ip address 172.15.40.1 255.255.0.0
Router(config-if)#ip address 172.15.40.1 255.255.0.0
Router(config-if)#ip address 172.15.40.1 255.255.0.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up

15
CS 321 – Computer Network Lab Manual

Router>enable
Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface GigabitEthernet0/0
Router(config-if)#
Router(config-if)#exit
Router(config)#interface GigabitEthernet0/0
Router(config-if)#ip address 172.15.40.2 255.255.0.0
Router(config-if)#ip address 172.15.40.2 255.255.0.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

16
CS 321 – Computer Network Lab Manual

Router>enable
Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface GigabitEthernet0/0
Router(config-if)#
Router(config-if)#exit
Router(config)#interface GigabitEthernet0/0
Router(config-if)#ip address 172.15.40.2 255.255.0.0
Router(config-if)#ip address 172.15.40.2 255.255.0.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

Router(config-if)#exit
Router(config)#interface GigabitEthernet0/1
Router(config-if)#no ip address
Router(config-if)#no ip address
Router(config-if)#no ip address
Router(config-if)#ip address 172.14.50.1 255.255.0.0
Router(config-if)#ip address 172.14.50.1 255.255.0.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

17
CS 321 – Computer Network Lab Manual

The End

18

You might also like