Can hosts in same subnet ping each other if in different VLAN’s?

Short and sweet, no!

In the example above, Laptop0 and Laptop2 are in VLAN1, while Laptop1 and Laptop3 are in VLAN2. We apply the same network and subnet mask (192.168.1.1 and 255.255.255.0) to each VLAN.

We assign the Laptop’s address of 192.168.1.[2-5]. For example, see below…

We see that on Laptop0, we can only ping 192.168.1.4, but not 192.168.1.3 and 192.168.1.5…

C:\>ping 192.168.1.3

Pinging 192.168.1.3 with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 192.168.1.3:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

C:\>arp -a
No ARP Entries Found
C:\>ping 192.168.1.4

Pinging 192.168.1.4 with 32 bytes of data:

Reply from 192.168.1.4: bytes=32 time<1ms TTL=128
Reply from 192.168.1.4: bytes=32 time<1ms TTL=128
Reply from 192.168.1.4: bytes=32 time<1ms TTL=128
Reply from 192.168.1.4: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.1.4:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\>ping 192.168.1.5

Pinging 192.168.1.5 with 32 bytes of data:


Ping statistics for 192.168.1.5:
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),

Control-C
^C
C:\>

There is no good reason to do this, but as an exercise, it may help you to understand that the VLAN is king. The same physical hardware and network will not allow you to cross VLAN’s. The reason for this that the switch will not broadcast the ARP request to anything other than the ports in the VLAN to which the requester is connected. As such, it will never see the other MAC addresses, even though there connected hosts are in the same subnet.

You can find the entire pkt file here

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.