Routing – Ping between different subnet across a link

routingswitching

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 |
|               |                     |                |
|               |                     |                |
+---------------+                     +----------------+

Best Answer

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