3

On a Cisco Packet Tracer sample e2-232, there is something I don't understand, even after following the step-by-step instructions on the sample project.The logical topology is shown in the following screen-shot.

enter image description here

Result of pings are shown below:

  • on PC2 : ping 172.16.1.1 interface of R2: OK
  • on PC2 : ping 172.16.2.2 interface of R2: OK
  • on PC2 : ping 192.168.1.2 interface of R2: OK
  • on R1 : ping 172.16.1.1 interface of R2: NOT GOOD
  • on R1 : ping 172.16.2.2 interface of R2: OK
  • on R1 : ping 192.168.1.2 interface of R2: NOT GOOD

Now, my question is why pingresults on R1, which is a router, are different from those on PC2, which is a desktop computer. Considering the fact that both R1 and PC2 are directly connected to R2, why are the data-packets, sent to R2, treated differently based on their origin?


Running-Configurations of R1 are as follows:

Router#show running-config 
Building configuration...

Current configuration : 713 bytes
!
version 12.3
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
ip ssh version 1
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 172.16.3.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 172.16.2.1 255.255.255.0
!
interface Serial0/0/1
 no ip address
 clock rate 2000000
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 no login
!
!
!
end

Also, R2 running-configurations are:

Router#show running-config 
Building configuration...

Current configuration : 724 bytes
!
version 12.3
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
ip ssh version 1
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 172.16.1.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 172.16.2.2 255.255.255.0
 clock rate 64000
!
interface Serial0/0/1
 ip address 192.168.1.2 255.255.255.0
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 no login
!
!
!
end
5
  • You need to include the router configurations in you question. We cannot simply guess where you went wrong (that is off-topic here).
    – Ron Maupin
    Apr 25, 2017 at 18:05
  • @RonMaupin Right, I included.
    – Megidd
    Apr 25, 2017 at 18:11
  • No. Do a show running-configuration on each router, and paste the results into your question. We need the configurations.
    – Ron Maupin
    Apr 25, 2017 at 18:12
  • @RonMaupin I included results of Router#show running-config command, but they are a bit lengthy.
    – Megidd
    Apr 25, 2017 at 18:29
  • They are not at all lengthy compared to a lot of what we get here. I think you are allowed 30,000 characters in your question.
    – Ron Maupin
    Apr 25, 2017 at 18:33

2 Answers 2

2

Your routers have no routes to non-connected networks. Routers get routes in three ways:

  1. Directly connected networks
  2. Statically configured routes
  3. Through dynamic routing protocols

You need to use one or both of the last two methods for a router to learn about networks not directly connected to it.

The PC can ping a host, e.g. its router, on the same LAN, and it will have the router as its gateway, so it can reach any networks about which its router knows (the router's directly connected routes). A different router doesn't know about the network where the PC is attached, so the router has no way to know to send that traffic to the router for that network.

5
  • So, If I define a Gateway of last resort for R1, would the ping results on R1 be just like those on PC2?
    – Megidd
    Apr 25, 2017 at 18:52
  • No. Routers are the gateways, they do not use gateways if they are routing. You either need to define static routes, which do not scale, or you need to configure your routers with a common routing protocol.
    – Ron Maupin
    Apr 25, 2017 at 18:53
  • Right, also as a reference, on here it is mentioned that the ip default-gateway command ... should only be used when ip routing is disabled on the Cisco router. Thanks.
    – Megidd
    Apr 25, 2017 at 18:58
  • 1
    The default-gateway command is used for network devices as hosts. Routers that are routing use routes, not gateways because they are the gateways. Hosts use gateways. What you need to do is use the ip route command, and put in routes for non-attached networks pointing to the next router. That is static routing, which doesn't scale. To do it correctly, you configure a common routing protocol on all your routers.
    – Ron Maupin
    Apr 25, 2017 at 19:01
  • It's much more clear now.
    – Megidd
    Apr 25, 2017 at 19:04
3

It's because R1 doesn't know how to reach those other interfaces (it doesn't have routes for those networks). You need routes on R1 pointing to R2 for the other two subnets. R1 of course knows how to reach 172.16.2.2 because it has an interface on that network.

6
  • But how are data-packets, coming from PC2, routed without any problem?
    – Megidd
    Apr 25, 2017 at 18:14
  • But how does PC2 know how to reach those interfaces?
    – Megidd
    Apr 25, 2017 at 18:21
  • 2
    Because R2 is the default gateway for PC2, and R2 is attached to all of those networks. PC2 only knows how to get to R2 as the default gateway, but R2 can reach all of those networks.
    – John K.
    Apr 25, 2017 at 18:28
  • When data-packets or data-frames are received by R2, does it make any difference whether they are from R1 or PC2? why is R2 capable of routing packets originally from PC2, but it cannot route packets from R1? I still don't get it.
    – Megidd
    Apr 25, 2017 at 18:36
  • 2
    R2 is not the issue. R2 treats packets the same. The problem is that R1 does not know how to get to those networks (missing routes) so the packets never leave R1 in the first place. PC2 knows how to get there via its default gateway.
    – John K.
    Apr 25, 2017 at 18:42

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.