Cisco – Can we have same IP addresses of PCs connected to a switch port with different VLAN Ids

ciscovlan

Let's say I have four PCs connected to one CISCO switch.

  • PC 1 has IP address 192.168.10.1 and is connected to the access port – vlan ID 10.
  • PC 2 has IP address 192.168.10.2 and is connected to the access port – vlan ID 10.
  • PC3 has IP address 192.168.10.1 (same IP address as PC1) and is connected to the access port – vlan ID 20
  • PC4 has IP address 192.168.10.2 ( same IP address as PC2) and is connected to the access port – vlan ID 20

Can PC1 ping PC2?
Can PC3 ping PC4?

Is it possible to have same IP address in the network if they are connected to different VLAN ports in one switch?

Best Answer

Yes, VLAN form layer 2 networks that are independent from each other (this is the purpose of VLAN)

Hosts within a VLAN cannot be seen from hosts in another VLAN (as long as you don't bridge them, or route between them).

So you scenario is perfectly possible.

Since PC1 and PC2 are in the same VLAN, they can communicate together. Same for PC3 and PC4

Being in different VLAN, PC1 & 2 cannot communicate with PC3 & PC4.

For all purpose it is exactly as is they were on two different, isolated switches.