cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1258
Views
5
Helpful
6
Replies

Different Behaviour of a Router

a.jmalkorai090
Level 1
Level 1

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

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

yYqCR.png

 

  1. 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,

nhlRC.png

 

  1. Here PC4 is not able to ping PC6 or Router4 (192.168.3.3).

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

6 Replies 6

pman
Spotlight
Spotlight

Hi,

 

case 1

there is one router which has all the information for target to network 192.168.0.0/24 and also 192.168.1.0/24
In this case the router knows the 2 networks since they are directly connected to it


case 2

 - one router holds all the information for destination to network 192.168.0.0/24 only,

 - other router holds all the information for destination to network 192.168.1.0/24 only.

Since Every router must have a route to know where to send traffic
When on of the routers receives a packet from LAN (Gi0/0 - in your case) it must know the “next hop” where it needs to deliver that packet.

That next hop is the IP address of the destination router / other router.

The router can learns the next hop for packets by one of two methods static routing / dynamic routing

EdgarMurray8920
Level 1
Level 1

In the first example, the two subnets are known by the router.

 

In the second example, router 2 only knows how to get to 192.168.3.3 because it is directly connected to router 4. He does not know the existence of the 192.168.1.1 unless a static route is put on router 2 or dynamic routing is enabled on both routers. 

Martin L
VIP
VIP

 

Two important principles are: router knows about its directly connected interfaces and 2, routers must share common link (subnet) to exchange routes with each others via dynamic protocol.  In other words, 2 routers will exchange their info if they are on the same subnet (share subnet), exception is BGP.

As mentioned above, with 2 and more routers, you must either add static routes telling this network is via that way Or dynamic protocol (dynamic routing).

 

Regards, ML
**Please Rate All Helpful Responses **

Joseph W. Doherty
Hall of Fame
Hall of Fame

CASE 1

"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."

BTW, that's incorrect.  If your check your single router (#1), its route table will show its two directly connected networks.

CASE 2

Whenever a router's route table doesn't have the packet's destination address "covered" (by a network prefix, or by "all" prefixes), it doesn't know where to forward the packet and will drop/discard it.  By default, only directly connected networks are known by a router.  If a network isn't directly connected, the router needs to, somehow, be "informed" of other network prefixes and how to reach them.  The latter might be accomplished by using static route statements and/or a dynamic routing protocol.

The forgoing pretty much overlaps with what the other posters has already noted, but wanted to make clear, first, there is a route table being used in CASE 1 and, second, you might also not quite understand how a router uses a route table, not just that is needs to be populated (always), but what it need to be populated with.  The latter I haven't detailed, and only have used the words "covered" and "prefix", but they too need to be understood to understand how a router routes.

To look at the question from a slightly different perspective: a layer 3 device (could be router or could be L3 switch) will always know about directly connected subnets and will route traffic between those subnets. For subnets that are remotely connected the L3 device will need some routing information, which could be from a static route or could be from a dynamic routing protocol.

HTH

Rick

@Richard Burts adds a good piece of information, although OP used routers same applies to L3 switches (doing routing).

Rick also notes "For subnets that are remotely connected the L3 device will need some routing information . . .", the "some routing information" is also another way of saying the same as my ". . . be "informsed" of other network prefixes and how to reach them."  The destination network, itself, may not be in the route table, but, again, (if not) it would need to be "covered" (i.e. by some aggregate prefix).

 

BTW, if it helps any, a static route statement can provides the "information" needed by the route table (provided it has the correct information).

Review Cisco Networking for a $25 gift card