Professional Documents
Culture Documents
LAB NO. 09
DISTANCE VECTOR PROTOCOL: ROUTING
INFORMATION PROTOCOL (RIP)
CONFIGURATION
Following are the lab objectives:
Objectives
Lab
Sir Asad
Hanif
Lab Instructor
1
CS 321 – Computer Network Lab Manual
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.
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.
4
CS 321 – Computer Network Lab Manual
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,
5
CS 321 – Computer Network Lab Manual
In Router R2,
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
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
6
CS 321 – Computer Network Lab Manual
In Router R2,
R1#show ip route
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
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
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
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>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
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
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
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
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
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
17
CS 321 – Computer Network Lab Manual
The End
18