4

Would Ping from PC1 to PC2 work?

No other L3 ports on these 2 devices and its forwarding table does not contain any entry apart from the one created due to configured interfaces. ARP table is empty.

+---------------+                     +----------------+
|               |                     |                |
|  PC1          |                     |    PC2         |
| 10.10.10.1/24 +---------------------+ 192.168.1.1/24 |
|               |                     |                |
|               |                     |                |
+---------------+                     +----------------+
1
  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Aug 10, 2017 at 15:08

6 Answers 6

7

No. It won't work

Let's look at PC1:

Its IP address is 10.10.10.1, its netmask is /24 or 255.255.255.0

This means that as far as it is concerned, IP addresses in the rage of 10.10.10.0 - 10.10.10.255 are in the same subnet. So for destinations with these addresses, it can use ARP to find their MAC address, and send them packets (actually, frames) directly. All other addresses are unreachable to him, since no gateway is defined.

The same is true about PC2, with the address range 192.168.1.1-192.168.1.255

To make the two PCs be able to ping each other without adding a router or changing the IPs, you'd need to change the network masks to 0. So PC1 will be 10.10.10.1/0 and PC2 will be 192.168.1.1/0, making the subnet range for both of them the same 0.0.0.0-255.255.255.255

3

If there is no configured default route/gateway, then a ping will fail with a "no route to host" error.

In a little more detail, PC1 will compare the destination address to it's local subnet, which is calculated from the IP address and subnet mask. Since the IP address for PC2 is outside the local subnet, it will go to the routing table to find the route it must use for PC2. If there is no route, it will not send the traffic and return an error.

3
  • if i configure PC2's ip address i.e.192.168.1.1 as the default gateway for PC1, will the ping work?
    – suresh a
    Aug 20, 2014 at 14:34
  • No. A next hop address would need to be accessible to to usable. What you might be able to do to get it to work is give PC1 a default gateway of say 10.10.10.2 and add a static ARP entry on PC1 mapping 10.10.10.2 to PC2's MAC address (and the reverse on PC2 for return traffic). However this is something you would never want to do in a real environment as it isn't a tenable way to move forward and I have never tested this, so it may still not work.
    – YLearn
    Aug 20, 2014 at 14:37
  • To make it work you will also have to configure 10.10.10.1 as PC2 default-gateway. When PC1 identify that the destination is not on the local subnet it will send an ARP request to know the physical address of the configured default gateway to send its packets. Since they are connected to the same L2, PC2 will respond to the request and PC1 will be able to send its packets to PC2. I had my doubts on how the ARP protocol will work on this situation so I tested this on two windows 7 PCs and worked. I even used classful masks for the tests and pinged without any issues.
    – user5469
    Aug 21, 2014 at 14:03
2

As stated, No.

However, if both hosts are configured for "proxy-arp" -- aka. the-entire-internet-is-on-this-ethernet-cable 0.0.0.0/0 pointed to the interface (not sure that's possible in windows) -- then it will work. Or, both hosts can be told what additional subnets are on the wire with static routes. As a general Best Practice, this sort of thing should be avoied.

0
0

dghfet us call PC1 port as "p1" and PC2 port as "p2".

Only Direct route would be present in the Forwarding table. Direct routes get created when an interface is configured with an IP address.

Forwarding Table of PC1:

Route (with Prefix) Nexthop/Interface 10.10.10.0/24 p1

Forwarding Table of PC2:

Route (with Prefix) Nexthop/Interface 192.168.1.0/24 p2

When you initiate ping from PC1 for IP 192.168.1.1, PC1 would first try to find the nexthop for that IP 192.168.1.1. It would do a Forwarding Table lookup against IP 192.168.1.1.

For comparison against entry 10.10.10.0/24, the following steps would take place: 1 192.168.1.1 AND 255.255.255.0 = 192.168.1.0 (say X) 2 X (192.168.1.0) does not match 10.10.10.0; So Forwarding Table lookup would fail.

0

No it won't work , because both PC1 and PC2 are in between networks . Routing should to route traffic between different networks . For routing to run layer3 device is mandatory.

To make them talk each other following option are available

  1. . Configuration PC2 identical to same networks assign 10.10.10.2 to PC2

2). Otherwise deploy layer3 device and connect both PCs to layer3 device and Configure interfaces gateways in layer3 device connecting PCs . As both PCs will consider as directly connected networks from router prospectively no additional routing is required on router .

-1

Let us call PC1 port as "p1" and PC2 port as "p2".

Only Direct route would be present in the Forwarding table. Direct routes get created when an interface is configured with an IP address.

Forwarding Table of PC1: 
================================= 
Route (with Prefix)     Nexthop/Interface 
10.10.10.0/24                 p1 

Forwarding Table of PC2: 
================================= 
Route (with Prefix)     Nexthop/Interface 
192.168.1.0/24                p2 

When you initiate ping from PC1 for IP 192.168.1.1, PC1 would first try to find the nexthop for that IP 192.168.1.1.
It would do a Forwarding Table lookup against IP 192.168.1.1.

For comparison against entry 10.10.10.0/24, the following steps would take place:
1 192.168.1.1 AND 255.255.255.0 = 192.168.1.0 (say X)
2 X (192.168.1.0) does not match 10.10.10.0; So Forwarding Table lookup would fail.

Since no L3 interface is found, PC1 would not send out any packet at all.
The PING utility should typically show an error message(like No route to host) to the user as mentioned by YLearn.

2
  • 1
    -1 because ARP is only used on the local subnet. It is not used for hosts that are not on the local subnet. The only ARP that could take place is if PC1 was ARPing for the gateway.
    – YLearn
    Aug 20, 2014 at 14:27
  • @YLearn You are right. My bad. It would not not attempt for ARP till it knows of a next hop for that IP. If a nexthop for that IP existed in the Forwarding Table, then it would have initiated an ARP Request packet. I would rectify that in my answer. Thanks
    – gsinha
    Aug 20, 2014 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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