When a host going to sends a packet to another host; it will use host routing table where to send the packet. If the destination host is not on the same network, as a result the packet will be forwarded to the default gateway. When a packet arrives at the default gateway, which is generally a router. So the routers consult its routing table to decide where to forward this packet. The routing table of a router contains information about:
Directly connected routes
These routes come from the router active interfaces. Routers add a directly connected route when an interface is configured with an IP address and is activated. Each of the router’s interfaces is connected to a different network segment.
The figure identifies the directly connected networks and remote networks of router-1. Networks in the red rectangles are directly connected networks for router-1 and network in the blue rectangles are a remote network for router-1 and vice versa.