A little confused about subnet masks


I still don't have a really clear understanding of subnet masks, and I want to understand it better, but right now I urgently need an answer to just one question:

If my computer's subnet mask is, can I connect directly to a device with a subnet mask of

For instance, if I had my PC set up with an IP address of, with a subnet mask of, and a gateway of, would I be able to directly connect to a device (e.g. Raspberry Pi) with an IP address of, with a subnet mask of, and a gateway of

Please let me know.


Best Answer

  • This setup is incorrect, but it will work in the case where both IPs are legal in both networks.

    The reason is that nodes find one another through ARP requests where a request is broadcast, for example, asking "Who has, tell".

    The request will pass through all connected routers/switches, since the ARP request does not include any data about subnet masks, only about IP and MAC address.

    Once (or its router) received the request, it will answer with the MAC address of From now on communication will pass to Layer 2, also known as the Data link layer.

    The Layer 2 frames will use MAC address as source and destination, which the router/switch will happily pass along.

  • Related Question