Dynamic Routing Using RIP Version 2

 

Experiment: Dynamic Routing Using RIP  Version 2

1. Aim

To configure dynamic routing using Routing Information Protocol (RIP Version 2) between two routers in Cisco Packet Tracer and verify communication between two different LANs.


2. Objectives

After completing this experiment, students should be able to:

  1. Create two separate LANs using switches.
  2. Connect two routers using an inter-router link.
  3. Configure IPv4 addresses on PCs and router interfaces.
  4. Configure default gateways on PCs.
  5. Understand the need for routing between different networks.
  6. Configure RIP Version 2 on Cisco routers.
  7. Understand how routers dynamically exchange routing information.
  8. Verify dynamically learned routes using show ip route.
  9. Verify RIP configuration using show ip protocols.
  10. Test end-to-end connectivity using ping.
  11. Understand the difference between static routing and dynamic routing.
  12. Troubleshoot common RIP configuration errors.

3. Theory

In the previous experiment, we configured static routes manually.

For example, Router0 was manually told:

192.168.2.0/24 → 10.0.0.2

and Router1 was manually told:

192.168.1.0/24 → 10.0.0.1

This works, but if the network becomes larger, manually configuring routes on every router becomes difficult.

Dynamic routing protocols solve this problem.

A dynamic routing protocol allows routers to:

  • Discover networks
  • Exchange routing information
  • Learn remote networks
  • Add routes to their routing tables
  • Update routes when network conditions change

In this experiment, we use RIP Version 2 (RIPv2).

RIP

RIP — Routing Information Protocol

RIP is a distance-vector routing protocol.

RIP uses hop count as its routing metric.

For example:

Router0 → Router1 → Network

The network is considered to be one router hop away from Router0 through Router1.

RIP has a maximum usable hop count of 15. A metric of 16 represents an unreachable network.


4. Network Topology

We will use the same basic topology as the previous static-routing experiment, so students can clearly compare static routing and dynamic routing.

                    ROUTER-TO-ROUTER LINK
                       10.0.0.0/30

 LAN 1                                                    LAN 2
192.168.1.0/24                                         192.168.2.0/24

 PC0       PC1                                         PC2       PC3
  |         |                                           |         |
  |         |                                           |         |
  +----+----+                                           +----+----+
       |                                                     |
    Switch0                                               Switch1
       |                                                     |
       |                                                     |
     G0/0                                                   G0/1
  Router0                                                   Router1
     G0/1                                                   G0/0
       +------------------ 10.0.0.0/30 ---------------------+

A simpler representation:

       LAN 1                         LAN 2
 192.168.1.0/24                 192.168.2.0/24

 PC0   PC1                         PC2   PC3
  |     |                           |     |
  +-- Switch0 -- R0 ---- R1 -- Switch1 --+
                    |
              10.0.0.0/30





5. IP Addressing Scheme

We will use three networks.

LAN 1

192.168.1.0/24

Router-to-router network

10.0.0.0/30

LAN 2

192.168.2.0/24

Complete Addressing Table

DeviceInterface    IP Address    Subnet Mask    Default Gateway
PC0    FastEthernet0    192.168.1.10    255.255.255.0    192.168.1.1
PC1    FastEthernet0    192.168.1.11    255.255.255.0    192.168.1.1
Router0    G0/0    192.168.1.1    255.255.255.0    —
Router0    G0/1    10.0.0.1    255.255.255.252    —
Router1    G0/0    10.0.0.2    255.255.255.252    —
Router1    G0/1    192.168.2.1    255.255.255.0    —
PC2    FastEthernet0    192.168.2.10    255.255.255.0    192.168.2.1
PC3    FastEthernet0    192.168.2.11    255.255.255.0    192.168.2.1

6. Devices Required

DeviceQuantity
Cisco Router2
Cisco 2960 Switch2
PC4
Copper Straight-Through Cable6
Router-to-router Ethernet cable1

If your selected Packet Tracer router/interface setup uses traditional Ethernet cabling, use a Copper Cross-Over cable between the two routers. If Auto-MDIX is supported, a straight-through cable may also work.


7. Important Difference from the Previous Experiment

In the static routing experiment, we used:

ip route ...

In this experiment, do not configure static routes.

Instead, the routers will exchange routing information using:

router rip

The objective is to observe the routers automatically learning the remote networks.


8. Procedure

Students should perform the following tasks in the given order.


Task 1: Open Cisco Packet Tracer

  1. Start Cisco Packet Tracer.
  2. Create a new blank workspace.

Task 2: Place Two Routers

  1. Select Network Devices → Routers.
  2. Place two routers with at least two Ethernet interfaces.
  3. Use:
Router0
Router1

Task 3: Place Two Switches

Place two Cisco 2960 switches:

Switch0 → LAN 1
Switch1 → LAN 2

Task 4: Place Four PCs

Place:

PC0
PC1
PC2
PC3

Arrange them as:

             LAN 1                         LAN 2

          PC0     PC1                  PC2     PC3
           |       |                    |       |
           +--- Switch0 --- R0 ---- R1 --- Switch1 ---+

Task 5: Connect LAN 1

Use Copper Straight-Through cables.

Connect:

PC0 FastEthernet0 → Switch0 Fa0/1
PC1 FastEthernet0 → Switch0 Fa0/2
Switch0 Fa0/24 → Router0 G0/0

Task 6: Connect the Two Routers

Connect:

Router0 G0/1
     |
     | Router-to-router Ethernet connection
     |
Router1 G0/0

Use the appropriate Ethernet cable supported by your router/interface setup.


Task 7: Connect LAN 2

Connect:

Router1 G0/1 → Switch1 Fa0/24

Switch1 Fa0/1 → PC2 FastEthernet0

Switch1 Fa0/2 → PC3 FastEthernet0

9. Configure the PCs

Task 8: Configure PC0

Go to:

PC0 → Desktop → IP Configuration

Enter:

IP Address:       192.168.1.10
Subnet Mask:      255.255.255.0
Default Gateway:  192.168.1.1

Task 9: Configure PC1

Enter:

IP Address:       192.168.1.11
Subnet Mask:      255.255.255.0
Default Gateway:  192.168.1.1

Task 10: Configure PC2

Enter:

IP Address:       192.168.2.10
Subnet Mask:      255.255.255.0
Default Gateway:  192.168.2.1

Task 11: Configure PC3

Enter:

IP Address:       192.168.2.11
Subnet Mask:      255.255.255.0
Default Gateway:  192.168.2.1

10. Configure Router0

Task 12: Configure Router0 G0/0

Click:

Router0 → CLI

Enter:

Router> enable
Router# configure terminal
Router(config)# interface gigabitEthernet 0/0
Router(config-if)# ip address 192.168.1.1 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)# exit

Task 13: Configure Router0 G0/1

Enter:

Router(config)# interface gigabitEthernet 0/1
Router(config-if)# ip address 10.0.0.1 255.255.255.252
Router(config-if)# no shutdown
Router(config-if)# exit

Then:

Router(config)# end

11. Configure Router1

Task 14: Configure Router1 G0/0

Click:

Router1 → CLI

Enter:

Router> enable
Router# configure terminal
Router(config)# interface gigabitEthernet 0/0
Router(config-if)# ip address 10.0.0.2 255.255.255.252
Router(config-if)# no shutdown
Router(config-if)# exit

Task 15: Configure Router1 G0/1

Enter:

Router(config)# interface gigabitEthernet 0/1
Router(config-if)# ip address 192.168.2.1 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)# exit
Router(config)# end

12. Verify Router Interfaces

Task 16: Check Router0

On Router0:

show ip interface brief

Expected:

InterfaceIP AddressStatusProtocol
G0/0192.168.1.1upup
G0/110.0.0.1upup

Task 17: Check Router1

On Router1:

show ip interface brief

Expected:

InterfaceIP AddressStatusProtocol
G0/010.0.0.2upup
G0/1192.168.2.1upup

Important

Both router interfaces should show:

up    up

before proceeding.


13. Verify the Router-to-Router Connection

Task 18: Ping Router1 from Router0

On Router0:

ping 10.0.0.2

Expected:

Success

Task 19: Ping Router0 from Router1

On Router1:

ping 10.0.0.1

Expected:

Success

If this does not work, do not proceed to RIP configuration. Troubleshoot the physical connection and IP addresses first.


14. Check the Routing Tables Before RIP

This is an important teaching step.

Task 20: Check Router0's Routing Table

On Router0:

show ip route

Router0 should know about:

192.168.1.0/24
10.0.0.0/30

But it should not yet know about:

192.168.2.0/24

Task 21: Check Router1's Routing Table

On Router1:

show ip route

Router1 should know about:

10.0.0.0/30
192.168.2.0/24

But it should not yet know about:

192.168.1.0/24

This is the starting point for dynamic routing.


15. Test Connectivity Before RIP

Task 22: Test PC0 to PC1

From PC0:

ping 192.168.1.11

This should succeed because both PCs are in LAN 1.


Task 23: Test PC2 to PC3

From PC2:

ping 192.168.2.11

This should succeed because both PCs are in LAN 2.


Task 24: Test PC0 to PC2

From PC0:

ping 192.168.2.10

Expected result:

Failure

Why?

Because Router0 does not yet have a route to:

192.168.2.0/24

Similarly, Router1 does not have a route to:

192.168.1.0/24

16. Configure RIP Version 2 on Router0

Task 25: Enable RIPv2 on Router0

Go to Router0 CLI.

Enter:

Router0> enable
Router0# configure terminal
Router0(config)# router rip

The prompt becomes:

Router0(config-router)#

Now specify RIP Version 2:

Router0(config-router)# version 2

Disable automatic classful summarization:

Router0(config-router)# no auto-summary

Now specify the networks connected to Router0:

Router0(config-router)# network 192.168.1.0
Router0(config-router)# network 10.0.0.0

Exit:

Router0(config-router)# end

Complete Router0 configuration

Router0> enable
Router0# configure terminal
Router0(config)# router rip
Router0(config-router)# version 2
Router0(config-router)# no auto-summary
Router0(config-router)# network 192.168.1.0
Router0(config-router)# network 10.0.0.0
Router0(config-router)# end

17. Configure RIP Version 2 on Router1

Task 26: Enable RIPv2 on Router1

On Router1:

Router1> enable
Router1# configure terminal
Router1(config)# router rip
Router1(config-router)# version 2
Router1(config-router)# no auto-summary

Specify Router1's connected networks:

Router1(config-router)# network 10.0.0.0
Router1(config-router)# network 192.168.2.0

Then:

Router1(config-router)# end

Complete Router1 configuration

Router1> enable
Router1# configure terminal
Router1(config)# router rip
Router1(config-router)# version 2
Router1(config-router)# no auto-summary
Router1(config-router)# network 10.0.0.0
Router1(config-router)# network 192.168.2.0
Router1(config-router)# end

18. What Did We Just Configure?

This is a very important point for students.

Router0 advertises:

192.168.1.0/24

and:

10.0.0.0/30

Router1 advertises:

192.168.2.0/24

and:

10.0.0.0/30

The routers exchange routing information through the:

10.0.0.0/30

network.

Router0 eventually learns:

192.168.2.0/24

through Router1.

Router1 eventually learns:

192.168.1.0/24

through Router0.

No ip route command was entered.

That is the key difference from static routing.


19. Verify RIP Configuration

Task 27: Use show ip protocols

On Router0:

show ip protocols

Look for information indicating that:

Routing Protocol is "rip"

and that:

version 2

is being used.

Also observe the networks participating in RIP.

Repeat on Router1:

show ip protocols

20. Verify Dynamically Learned Routes

Task 28: Check Router0's Routing Table

Wait a few seconds for RIP to exchange routing information.

Then execute:

show ip route

Router0 should now have a route similar to:

R    192.168.2.0/24 [120/1] via 10.0.0.2

The exact formatting can vary slightly by IOS/Packet Tracer version.

The important part is:

R

R means:

RIP-learned route


21. Check Router1's Routing Table

Task 29

On Router1:

show ip route

You should find something similar to:

R    192.168.1.0/24 [120/1] via 10.0.0.1

Again:

R = route learned through RIP

22. Compare the Routing Tables

This is a very useful observation for students.

Before RIP

Router0:

C  192.168.1.0/24
C  10.0.0.0/30

Router1:

C  10.0.0.0/30
C  192.168.2.0/24

After RIP

Router0:

C  192.168.1.0/24
C  10.0.0.0/30
R  192.168.2.0/24

Router1:

C  10.0.0.0/30
C  192.168.2.0/24
R  192.168.1.0/24

This is the central observation of the experiment.


23. Test Inter-LAN Connectivity

Task 30: Ping PC2 from PC0

From PC0:

ping 192.168.2.10

This should now succeed.

The path is:

PC0
 ↓
Switch0
 ↓
Router0
 ↓
Router1
 ↓
Switch1
 ↓
PC2

24. Test Reverse Connectivity

Task 31

From PC2:

ping 192.168.1.10

This should also succeed.


25. Test PC1 to PC3

Task 32

From PC1:

ping 192.168.2.11

Expected:

Successful


26. Test PC3 to PC1

Task 33

From PC3:

ping 192.168.1.11

Expected:

Successful


27. Connectivity Verification Table

Students should complete the following table.

SourceDestinationCommand    Expected Result
PC0PC1ping 192.168.1.11    Success
PC2PC3ping 192.168.2.11    Success
PC0PC2ping 192.168.2.10    Success
PC2PC0ping 192.168.1.10    Success
PC1PC3ping 192.168.2.11    Success
PC3PC1ping 192.168.1.11    Success

28. Task 34: Use tracert

From PC0:

tracert 192.168.2.10

The output should show that the packet passes through the routers before reaching the destination.

Conceptually:

PC0
 ↓
Router0
 ↓
Router1
 ↓
PC2

This demonstrates that the packet is being routed between two different networks.


29. Task 35: Examine the RIP Information

On Router0:

show ip protocols

Students should record:

  • Routing protocol: __________
  • RIP version: __________
  • Networks participating in RIP: __________
  • RIP timers, if displayed: __________

Repeat on Router1.


30. Task 36: Examine RIP Routes

Use:

show ip route

Students should identify routes beginning with:

R

Record:

RouterRIP-learned NetworkNext Hop
Router0____________________
Router1____________________

Expected:

Router    RIP-learned Network    Next Hop
Router0    192.168.2.0/24    10.0.0.2
Router1    192.168.1.0/24    10.0.0.1

31. Task 37: Understand the RIP Metric

RIP uses hop count as its routing metric.

In this experiment:

Router0 → Router1 → LAN2

The LAN2 network is one router hop away from Router0.

Therefore, the route may appear as:

[120/1]

where:

120 = RIP administrative distance
1   = RIP metric / hop count

Students do not need to memorize the administrative distance at this stage, but they should understand:

RIP selects routes based on hop count.


32. Task 38: Deliberately Disable RIP on Router0

This is an optional troubleshooting exercise.

On Router0:

configure terminal
router rip
no network 10.0.0.0

Then observe the routing table:

show ip route

Students should investigate whether the RIP-learned route to LAN2 remains available.

Then restore the configuration:

configure terminal
router rip
network 10.0.0.0
end

Wait for the routers to exchange routing information again.


33. Task 39: Introduce a Routing Error

On Router1, temporarily remove the LAN2 network from RIP:

configure terminal
router rip
no network 192.168.2.0
end

Check:

show ip protocols

and:

show ip route

Then try from PC0:

ping 192.168.2.10

Students should observe the effect of removing a network from the RIP configuration.

Restore it:

configure terminal
router rip
network 192.168.2.0
end

34. Task 40: Save the Configuration

Once the experiment is working correctly, save the configurations.

On Router0:

copy running-config startup-config

On Router1:

copy running-config startup-config

Press Enter when prompted for the destination filename.


35. Important RIP Commands

PurposeCommand
Enter privileged modeenable
Enter configuration modeconfigure terminal
Start RIProuter rip
Select RIP version 2version 2
Disable automatic summarizationno auto-summary
Advertise a networknetwork NETWORK
View routing protocolsshow ip protocols
View routing tableshow ip route
View interfacesshow ip interface brief
Test connectivityping IP
Trace routetracert IP
Save configurationcopy running-config startup-config

36. RIP Configuration Summary

Router0

Router0(config)# router rip
Router0(config-router)# version 2
Router0(config-router)# no auto-summary
Router0(config-router)# network 192.168.1.0
Router0(config-router)# network 10.0.0.0

Router1

Router1(config)# router rip
Router1(config-router)# version 2
Router1(config-router)# no auto-summary
Router1(config-router)# network 10.0.0.0
Router1(config-router)# network 192.168.2.0

Notice the important difference

There is no command such as:

ip route 192.168.2.0 ...

or:

ip route 192.168.1.0 ...

The routes are learned dynamically.


37. Observation Table

PC Configuration

PC    IP Address    Subnet Mask    Default Gateway
PC0    192.168.1.10    255.255.255.0    192.168.1.1
PC1    192.168.1.11    255.255.255.0    192.168.1.1
PC2    192.168.2.10    255.255.255.0    192.168.2.1
PC3    192.168.2.11    255.255.255.0    192.168.2.1

Router Configuration

Router    Interface    IP Address
Router0    G0/0    192.168.1.1
Router0    G0/1    10.0.0.1
Router1    G0/0    10.0.0.2
Router1    G0/1    192.168.2.1

38. RIP Routing Table Observation

Router0

Destination    Route Type    Next Hop
192.168.1.0/24    Connected    —
10.0.0.0/30    Connected    —
192.168.2.0/24    RIP    10.0.0.2

Router1

Destination    Route Type    Next Hop
10.0.0.0/30    Connected    —
192.168.2.0/24    Connected    —
192.168.1.0/24    RIP    10.0.0.1

39. Result

Two separate LANs were successfully connected using two routers in Cisco Packet Tracer. RIPv2 was configured on both routers to dynamically exchange routing information. The routers automatically learned the remote LAN networks, and the dynamically learned routes were verified using the show ip route and show ip protocols commands. End-to-end connectivity between the two LANs was successfully established and verified using the ping command.

Comments

Popular posts from this blog

Networks Lab PCCSL507 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Study of whois Command

Study and Use of ifconfig Command