RIP is a protocol that routers use to communicate and share information about the networks they are connected to. Every 30 seconds, all routers inform their neighbors of the full list of networks they have, even if nothing has changed since the last update.
This protocol counts the number of hops required to reach a destination. After 15 hops, networks are considered unreachable. Version 1 (the default) is obsolete, so always use version 2.
Given the scenario below, PC1 needs to reach PC2:

In the example above, v1 would not work because it is classful (does not support sub-networks), and its automatic network summarization would also cause it to fail when trying to merge network IPs.
Router1
enable
configure terminal
hostname Router1
no ip domain lookup
line con 0
logging synchronous
interface g0/0
ip address 192.168.3.1 255.255.255.252
no shutdown
interface g0/1
ip address 192.168.1.1 255.255.255.252
no shutdown
router rip
version 2
no auto-summary
network 192.168.3.0
network 192.168.1.0
passive-interface g0/1
Router2
enable
configure terminal
hostname Router2
no ip domain lookup
line con 0
logging synchronous
interface g0/0
ip address 192.168.3.2 255.255.255.252
no shutdown
interface g0/1
ip address 192.168.2.1 255.255.255.252
no shutdown
router rip
version 2
no auto-summary
network 192.168.3.0
network 192.168.2.0
passive-interface g0/1
The router that serves as the gateway to outside the network must have the following parameter set in the router rip config:
default-information originate
This tells all other routers which one is the gateway of last resort when a destination network is unknown.
Also, use the command below to make all interfaces passive by default and only activate the ones you need:
passive-interface default
no passive-interface Serial0/0/0
no passive-interface Serial0/0/1
To check the configuration on each router, issue the following commands:
show ip protocols
debug ip rip
show ip rip database
show ip rip neighbors