cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5092
Views
8
Helpful
3
Replies

different IP PCs in same VLAN communicate?

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

3 Replies 3

Ganesh Hariharan
VIP Alumni
VIP Alumni

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

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.

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

HTH

Rick
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: