04-12-2012 05:46 AM - edited 03-04-2019 04:00 PM
Hi Guys ,
i have a few questions:
1)Why do 2 PC's on different subnets but on the same vlan cant ping each other ?
2)Why do 2 PC's on different VLANs but on same subnet cant ping each other ?
I know that Vlans segmenting subnets.
My question concerns more of the switching logic and routing logic behind this occurance.
Thanks,
Arjun
Solved! Go to Solution.
04-16-2012 11:37 AM
Arjun
The issue in your config is pretty simple. You are trying to get 2 PCs in the same VLAN to talk but the router configuration is for two VLANs and not just one. I would think that a configuration that looks something like this might work:
1.interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
ip address 192.168.20.1 255.255.255.0 secondary
This will put both subnets into the same VLAN and should work assuming that both PCs are in VLAN 10. This assumes that there is a switch to which the PCs are connected, and assumes that the switch has a trunk configured to connect to the router, and assumes that VLAN 10 is not the native VLAN on that trunk. If these assumptions are correct then I believe that this should work.
HTH
Rick
04-15-2012 02:22 PM
Arjun
1) Either I do not understand what you are saying or I do not agree with it. 2 PCs in the same VLAN should be able to ping each other even if they have IP addressing in different subnets. The issue is whether they will ARP for each other. If each PC has its IP address and has a gateway configured in that subnet then it would try to forward to the gateway rather than ARP for the other PC. But if the configuration of the PC is such that it will ARP for remote addresses then the other PC would receive the ARP since they are in the same broadcast domain, would respond to the ARP and they could ping each other.
2) If 2 PCs are in different VLANs then they are in different broadcast domains. So when PC A sends ARP for PC B, the ARP is a broadcast in its own VLAN but does not get to the other VLAN. Since they do not receive eiach other ARP they will not be able to ping or communicate.
HTH
Rick
04-16-2012 09:36 AM
Hi Rick,
Thank you very much for the answers.I understood the point number 2.But i didnt understand the point number 1.In my case 2PC's has its own ip address and has a default gate way configured for each of them.i used a router on stick to accomodate the default gateways.Both PC's are not being able to ping each other even though they are on the same.
And how would you force a configuration on a PC to arp for remote addresses.I always found VLANS little difficult to understand.It would be great if you could provide me some insight or explanation.
Thanks
Regards,
Arjun
PS:attached is the packet tracer file for investigation
04-16-2012 10:09 AM
Arjun
Number 2 is easy - they never would be able to communicate with each other if the PCs were in the same subnet but were in different VLANs.
Number 1 is more complicated and depending on how they are configured they might be able to communicate or they might not be able to communicate. If each PC had its own default gateway it would try to communicate with the other PC by sending the packet to its default gateway. If the gateways can communicate I would expect the ping to succeed and if the gateways can not communicate then the ping will certainly fail. I would have thought that router on a stick would have allowed the PCs to ping each other. If the PCs do not just send to their default gateway then I would expect them to ARP for each other and the ping should be successful.
There are various ways to set up so that the PCs would ARP for each other. Possibilities include leaving the default gateway blank/null, setting the default gateway as the PC own address, or using a mask for the address of 255.0.0.0 or something like that.
VLANs are an important concept. Here are some of the things about VLAN that I have found helpful. I hope that they are useful to you:
- VLAN is mostly a layer 2 concept and not layer 3.
- a VLAN is its own separate network at layer 2. It is like having all the devices in the VLAN like they are all connected on the same wire.
- a device in the VLAN can see/can communicate directly with any other device in the VLAN. Again it is like having all devices connected to the same wire where they all communicate directly.
- a device in the VLAN can not see/not communicate directly with any device that is not in the VLAN. So if the other device is not on the same wire that I am then I can not communicate directly with it.
In general there should be a one to one relationship between a VLAN and a subnet. So when we have one VLAN we generally have one subnet and when we have one subnet we shold have one VLAN. There are some exceptions to this, but this is the general situation.
HTH
Rick
04-16-2012 10:30 AM
Hi Rick,
Thanks again.I see what you are stating.Could you please look at my packet tracer file and see how could i possibbly make 2 PC's on different subnet but on same vlan communicate.I am missing something....
Regards,
Arjun
04-16-2012 10:52 AM
Arjun
I do not have software to read or process packet tracer files. Can you post the router config?
HTH
Rick
04-16-2012 11:08 AM
Router on stick
================
1.interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
2.interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0
PC 1 ip 192.168.10.2 in vlan 10 trying to ping a PC 2 ip 192.168.20.2 in vlan 10.
All intervlan routing works fine as well as trunk ports on switches has been properly configured.
04-16-2012 11:37 AM
Arjun
The issue in your config is pretty simple. You are trying to get 2 PCs in the same VLAN to talk but the router configuration is for two VLANs and not just one. I would think that a configuration that looks something like this might work:
1.interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
ip address 192.168.20.1 255.255.255.0 secondary
This will put both subnets into the same VLAN and should work assuming that both PCs are in VLAN 10. This assumes that there is a switch to which the PCs are connected, and assumes that the switch has a trunk configured to connect to the router, and assumes that VLAN 10 is not the native VLAN on that trunk. If these assumptions are correct then I believe that this should work.
HTH
Rick
04-16-2012 11:43 AM
Hi Rick,
Hmmm....i did see that command somewhere (ip address secondary)....too bad i dont think packet tracer has that secondary option and i am zero in GNS3.Anyways...i really thank you for your time for answering my questions.I will try to test it somewhere.
Thanks
Arjun
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide