There are 2 cases that I would like to point out:

  1. When the router is directly connected with 2 PCs like this,

    "Router 1" has two connections, one to "PC2" and one to "PC3"

    In this case, PC2 is able to ping PC3. I just configured the IP address of PC2 and PC3 and a default gateway for them, in this case there is no need to add a routing table.

  2. When two routers are connected like this,

    "Router 2" has a connection to "Switch 0", which itself is connected to "PC4" and "PC5". "Router 4" has a connection to "Switch 1", which itself is connected to "PC6" and "PC7". "Router 2" and "Router 4" are connected to each other.

    Here PC4 is not able to ping PC6 or Router4 (

Why do we have to explicitly add entries for routing table in the second case when it was not needed in the first case?

  • 2
    How do you expect R4 to know anything about networks on other routers?
    – Ricky
    Commented Nov 12, 2021 at 16:39
  • @Ricky Yes, your point is right. But Router4 is connected with also, then why PC4 is not able to ping
    – anonymous
    Commented Nov 13, 2021 at 17:42
  • 1
    Because R4 does not know about Run a few debug's; you'll see R4 receive the packet, but has no route to send the reply.
    – Ricky
    Commented Nov 13, 2021 at 18:38
  • @Ricky Sorry but I made a mistake in the previoous comment, I was asking that Router2 is connected with, then why PC4 is not able to ping
    – anonymous
    Commented Nov 14, 2021 at 7:42
  • 1
    How many times do I have to say it? 3.3 cannot answer 0.11 because it has no route to 0 The packet from 0.11 will get to 3.3, but it can't respond.
    – Ricky
    Commented Nov 14, 2021 at 13:31

5 Answers 5


You don't have to add anything in the 1st case because it's automatic. As there's only one router, it obviously knows everything directly connected to it. When that becomes more than one router, some process needs to be in place to tell the others what isn't local. (either static routes, or any number of dynamic routing protocols.)

Thanks to Comments on this question by @Ricky; I'm editing this answer to clear the point. In the 1st case, there is only one router; it knows about both networks ( and

But In the 2nd case, there are three networks (,, and If PC4 tries to ping, packets from will get to, but R4 cannot route back to So That's why PC4 will be able to ping but not


Why in the first case, There was no need of adding Routing table

Because it's not really true that there was no need of adding a routing table.

When you configured the IP addresses and subnets of the two interfaces, you implicitly added two entries to the routing table, one for each interface/subnet.


In the second setup there are 3 ip-subnets involved:, and

Router2 knows about and because it has a interface in each. Router4 knows about and because it has a interface in each.

But there is nothing to tie them together so that Router2 knows were to send packets intended for (and similarly Router4 has the same problem with

So on Router2 you have to define a static route for that points to That will forward any packets for to Router4 and Router4 knows what to do with those.
(And on Router4 you need to setup a static route for via

The alternative is to setup a dynamic routing protocol (e.g RIP, IGRP, BGP, OSPF) on both routers that lets them learn the whole ip-subnet topology.
These can be quite complicated to configure except for RIP. RIP is by far the easiest to setup (just enable it, no config neccessary), but it is quite outdated and doesn't perform well in large (many subnets/routers) deployments. For a small network like this it would do just fine.

  • Router2 knows about and Then why PC4 is not able to ping
    – anonymous
    Commented Nov 13, 2021 at 17:37
  • @developer Did you actually ENABLE routing on Router2? Because some routers (and Layer3 capable switches) don't do that automatically. Especially Cisco devices tend to default to "routing = off". That has given me a couple of WTF moments in the past, because it is the last thing you expect on a router, that you have to explicitly tell it to do its job.
    – Tonny
    Commented Nov 13, 2021 at 18:28
  • Yes, I have enabled routing on R2. If I just add routing table for R2, it will start working, PC4 will be able to ping, but that's not the point here for me, because If PC4 can ping (without adding Routing table), It should be able to ping also, because they are both in the same network. but that's not the case here.
    – anonymous
    Commented Nov 14, 2021 at 8:05
  • @anonymous Wait a sec. Has Router4 a route (for or default gateway set to Router2 when the PC is unable to ping If not that would explain it. The ping would have reached (because Router2 can figure that much out on its own) but Router4 can't respond because it doesn't know the path back to the originating ip-address.
    – Tonny
    Commented Nov 14, 2021 at 10:44

To add to AndreKR's answer. There are actually 4 routes that are implicitly added.

  1. - to CPU route. (Also called punt route) Packets that are destined to this IP address will travel to the router's CPU. For example ping to will be handled by the ICMP application on the router.

  2. - This is called glean route. Every packet that arrives to this address range (that doesn't match the more specific will be trapped to router's CPU to trigger an ARP request (unless an ARP entry already exists) and eventually (after MAC address is known) will be sent to this destination IP directly out of this interface using the MAC address located in ARP database.

  3. - similar to 1

  4. - similar to 2

Note that usually a router doesn't issue an ARP request to resolve the destination IP address from data packets - it only happenes (as far as I know) when the destination is directly connected to the router.

Also note, that after the MAC addresses of the connected PCs are resolved (using the mechanism described in 2.), a 5th and a 6th routes are added:

  1. via gig0/1

  2. via gig0/0

If ARP cache is cleared, or ARP cache entries are expired - these routes are removed.


The point is that each node needs to have a route to all the subnets, either a default route (hosts) or a specific route to each subnet (routers).

When a node is directly attached to a subnet, a specific route is set up automatically. Otherwise it needs to be set manually by the admin, or learned via a routing protocol from peer gateways. (Hosts often have a default gateway set by DHCP.)

Case 1 is trivial - likely the hosts have their default gateway set to their router's southward interface. That single router is directly attached to all subnets, so all necessary routing table entries are added automatically.

In case 2, hosts are likely using their router interface as default gateway as well. But unless you've explicitly set up the routers, they don't know the subnet behind the other router. Each router has got an automatic entry for the directly attached subnets - the client subnet below and the link to the other router. However, there's no route to the subnet behind the neighbor router, so that is unreachable.

You could set up each router on the other one as default gateway, but that would prevent any more routers to be added.

Much better, you either set up a static route to the remote network or you set up a routing protocol like OSPF between the routers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.