different IP PCs in same VLAN communicate?

Unanswered Question
Apr 29th, 2010
User Badges:

Hi team,


I just want to clear my doubt.


Two PC s with different IP (192.168.2.10 & 172.16.3.10) connected access ports configured with same VLAN of a switch(layer 2).

Can they communicate?


My understanding is switch forms its MAC table based on Layer2 MAC address and port it connected & VLAN.

so why not? as long as they are in same VLAN.


Could you please clear my doubt?


Thank you

Sanjeev

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (2 ratings)
Loading.
Ganesh Hariharan Sat, 05/01/2010 - 09:13
User Badges:
  • Purple, 4500 points or more
  • Community Spotlight Award,

    Member's Choice, February 2016

Hi team,


I just want to clear my doubt.


Two PC s with different IP (192.168.2.10 & 172.16.3.10) connected access ports configured with same VLAN of a switch(layer 2).

Can they communicate?


My understanding is switch forms its MAC table based on Layer2 MAC address and port it connected & VLAN.

so why not? as long as they are in same VLAN.


Could you please clear my doubt?


Thank you

Sanjeev


Hi Sanjeev,


Ideally if pc in one subnet need to communicate with pc in another subnet in the same vlan you need a gateway in your pc's and once a packet comes to switch (gateway of the pc) for another subnet it will always send to the default gateway configured in the switch.


so with my experience i don't think it should ping.


Hope to Help !!


Ganesh.H


If helpful do rate the post

anthony.metcalf.csl Thu, 05/13/2010 - 06:02
User Badges:

If the machines are in different subnets, then the *machine* will attempt to send the packet to the default gateway, saying "please pass this to the correct subnet".


If the gateway knows about the two subnets in the same VLAN, and can talk to them both, you will be good, but if you have two subnets, it would be reccomended to use two VLANs so you don't get cross brodcast traffic.


You will always need something to do the routing though, as the machine network stack simply won't send the packet out if it doesn't have a next hop, on the same subnet to send to.

Richard Burts Sat, 05/15/2010 - 13:12
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Sanjeev


As you point out both PCs will be in the mac-address table of the switch in the same VLAN. So clearly at layer 2 the PCs can communicate directly with each other. So the question becomes what is the layer 3 behavior of the PCs. There are several possible situations in which the PCs do communicate directly:

- if the PCs are set up so that they ARP for the address of the other PC then the other PC will receive the ARP request, respond to it, and the PCs will communicate directly.

- if the PCs forward to a gateway that knows about both subnets and knows that both subnets are in the same VLAN, then the gateway can forward traffic from one PC to the other (and the gateway may send an ICMP redirect which could have the PCs communicate directly).


HTH


Rick

Actions

This Discussion