1

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?

2
  • In the first approximation You can think each VLAN is formed using separate kommutator. – user36844 Jun 9 '17 at 10:46
  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could post and accept your own answer. – Ron Maupin Dec 31 '20 at 5:21
4

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.

3
  • then how ping will work here? How does it know where to send the reply.So, PC2 shouldn't be able to ping PC4. They have same IP address. – Bali Vinayak Jun 9 '17 at 10:16
  • PC1 would look at its routing table and and find that PC2 is on the same subnet ie. it can be contacted directly on the layer 2 segment. It ARPs the IP address and uses the MAC address to send an Ethernet frame with the ICMP echo request IP packet inside. As pointed out below, PC2 can never communicate with PC3 or PC4 and vice versa. (That is, easily - setting up a translating router in between and mapping networks would still be possible but non-trivial.) – Zac67 Jun 9 '17 at 10:52
  • 1
    @BaliVinayak The two VLANs are logically separate. VLAN 10 cannot communicate with VLAN 20. Remember IP addresses are layer 3, but VLANs are layer 2. – Ron Trunk Jun 9 '17 at 10:53
1

While this is quite possible as JFL has pointed out, your network design lacks the ability to (easily) enable communication between VLANs/subnets through a router. The router would be connected to both VLANs but with the same network address on both sides, it isn't able to distinguish between them and route properly. Additionally, the PCs/clients wouldn't have a way to distinguish their local partner from their remote one.

0

Yes your scenario is feasible . By default different Vlan won't communicate to each other unless inter-Vlan routing is configured .

By default same Vlan will communicate to each other ..

PC1 ping PC2? Can PC3 ping PC4?

PC1 and PC2 able to ping each other because both connected PCs are in same Vlan id .

PC3 and PC4 able to ping each other because both connected PCs are in same Vlan id.

But when inter-Vlan routing is configured between different Vlans ,with same subnet mask is not feasible

2
  • You can't route with identical/overlapping addresses. The subnet mask isn't the issue, the network address is. – Zac67 Dec 12 '20 at 17:23
  • We can use same subnet mask for different Vlan ids . When both are not routeble .Vlan 10 ,and Vlan 20 address won't get overlapped because both Vlans are independent . When inter-Vlan routing is enable between both Vlan then overlapping occurs. – Sagar Uragonda Dec 13 '20 at 6:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.