Directly connected routes
Directly connected networks are added to the router’s routing table if the interface connected to the network has an IP address configured and is in the up and up state. Connected routes always take precedence over static or dynamically discovered routes because they have the administrative distance value of 0 (the lowest possible value).
Consider the following example network:
In the picture above you can see that both routers are directly connected to two networks. Here is the routing table of R1:
The routing table of R2:
In the pictures above you can see that both routers know about the 172.16.0.0/24 network because they are both directy attached to that network. R1 also knows about the 10.0.0.0/24, while R2 knows about the 192.168.0.0/24. Note that, however, R1 doesn’t know about the 192.168.0.0/24 network; R2 doesn’t know about the 10.0.0.0/24. In fact, if R1 receives the packet destined for the 192.168.0.0/24 network, it will discard it because it doesn’t have any information about that network in its routing table and doesn’t know where to route the packets.