Routing is a huge concept in Cisco and I don’t want to dive into routing protcols concept, but I want to focus on simple routing which is called Static Routing. To know this concept look at this diagram. In static routnig, to reach from network1 to network2 , you need to define networks in router1 and router 2.
R1 knows just their interfaces, for reaching to network 192.168.3.0/24, we use interface 192.168.2.2, therefore we write:
R1(config)# ip route 192.168.3.0 255.255.255.0 192.168.2.2
R2 knows just their interfaces, for reaching to network 192.168.1.0/24, we use interface 192.168.2.1, therefore we write:
R2(config)# ip route 192.168.1.0 255.255.255.0 192.168.2.1