Announcement

Collapse
No announcement yet.

Same VLAN different network still can ping each other? Need help understing Network

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Same VLAN different network still can ping each other? Need help understing Network

    Hello All,

    I just started learning networking and using GNS3 and Virtual PC simulator as tools. I need help to understand more in networking with my current setup.
    Here is my scenario:

    1. Create Switch A with 2 PC simulators (PC1 and PC2) attached to it on port and 3 respectively. Assign both ports on VLAN 10.

    2. Configure PC1 with IP: 192.168.2.3/24 Gateway: 192.168.2.1.
    PC2 with IP:192.168.2.6/25 Gateway: 192.168.2.1.

    3. Now "PC1 ping PC2" and "PC2 ping PC1" both got reply.

    Here in scenario 3 I've get confused, How come two computers with different subnet masks /24 and /25 can ping each other with no problem? Or is it because they have the same gateway?

    4. Configure PC2 with different subnet this time IP: 192.168.2.130/25
    Gateway: 192.168.2.129.
    Note: VLAN Ports assignment hasn't changed and PC1 still has the same
    configuration.

    5. Now "PC1 ping PC2" and "PC2 ping PC1" both not reachable.

    Here in scenario 5 probably I can understand or not, because of they tried to communicate in totally different network eventhough within the same VLAN.

    Any help in explaining this kind of simple network kindly appreciated.

    Thanks,

    Fixzit

  • #2
    Re: Same VLAN different network still can ping each other? Need help understing Netwo

    subnet 192.168.2.0/24 gives you an address range of 192.168.2.0-192.168.2.255

    subnet 192.168.2.0/25 gives you an ip range of 192.168.2.0-192.168.2.127

    So they are within the same subnet, no matter which mask you use in that case.

    If you had 192.168.2.3/24 and 192.168.2.128/25 you might find they cannot ping each other (Please note, im not sure, my subnetting sucks)

    1in your second example, 192.168.2.130 is in a different subnet.. so you would need to route between 192.168.2.129/25 and 192.168.2.0/24

    the vlaning doesn't reall come into it so much yet I don't think

    (again.. im not too strong on network stufff.. so someone lik auglan will probably come along soon and point out where I'm wrong...)
    Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

    Comment


    • #3
      Re: Same VLAN different network still can ping each other? Need help understing Netwo

      Thanks for your post TechCamel,

      Yes my networking and subnetting also suck and also confuse me, but if I am not mistaken here about netwok 192.168.2.0/25 has two subnets .0 and .128 (assume subnet zero allowed). In my first example your explanation may be I can understand, since PC2 used 1st subnet .0 and a valid host IP 192.168.2.6, and IP 192.168.2.6 is in the range of valid host IP of subnet 192.168.2.0/24 regardless subnet mask applied to both PCs.

      Now what it confuse me in my second example, PC2 uses 2nd subnet .128 with a valid host IP 192.168.2.130 which is also in the valid host IP range of network 192.168.2.0/24. Is this anything to do with the gateway of PC2?

      Thanks

      Comment


      • #4
        Re: Same VLAN different network still can ping each other? Need help understing Netwo

        Your issue in the second example is because the second PC's reply must be routed to get back to PC1. From PC1's point of view, both machines are in the same subnet, because PC1's subnet is wide enough to include both addresses. But from PC2's subnet, PC1's address is not included, so there's a barrier to be crossed which requires a gateway. But your setup doesn't include that, yet.

        With IP addressing, each address number can only be used once in any scheme you control. The mask dictates whether that address is considered local by any other mask. If any 2 device addresses are within the same range, a gateway is not needed. The gateway comes into it when the 2 addresses are NOT in the same range. To set it up right, the switch port for PC2 should now be in a different VLAN with a different gateway (router) address. And you have to have a gateway (router) to allow the 2 subnets to 'see' each other.

        As for the VLAN thing: a VLAN equals a subnet. It won't matter if you have 2 PCs on different subnets and you assign the same VLAN to both switch ports. They won't be able to talk to one another. The subnet ranges must match, and the VLAN IDs must match for them to talk locally. Anything else requires a gateway (router).
        *RicklesP*
        MSCA (2003/XP), Security+, CCNA

        ** Remember: credit where credit is due, and reputation points as appropriate **

        Comment


        • #5
          Re: Same VLAN different network still can ping each other? Need help understing Netwo

          Like RicklesP said, hosts in the same subnet can arp for each other directly. When hosts are located on different subnets they will arp for their default gateway. How does the host know know its on a different subnet? It runs a boolean AND against the source and destination address/subnet mask to determine if its local address is on the same subnet of the destination, if it isn't it knows to forward it to the default gateway.
          CCNA, CCNA-Security, CCNP
          CCIE Security (In Progress)

          Comment


          • #6
            Re: Same VLAN different network still can ping each other? Need help understing Netwo

            Thank you thank you RicklesP and auglan also TechCamel, now I understand. Your explanation made it clear and help me to understand networking better from the simple one like this.

            Regards all

            Comment

            Working...
            X