layer 2 switch (cisco) connecting to two PCS having IPs frm 2 Subnets

Unanswered Question
Nov 12th, 2007
User Badges:

Hi everyone

can two PC's connected to two ports of a layer 2 switch coummunicate with each other when their LAN cards are assigned IP addresses from two different Subnets , will they be able to ping each other ( no router is used)

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 1.3 (3 ratings)
Loading.
Edison Ortiz Mon, 11/12/2007 - 16:50
User Badges:
  • Super Bronze, 10000 points or more
  • Hall of Fame,

    Founding Member

No, they won't be able to ping each other.

syedsohailsarwar Tue, 11/13/2007 - 08:55
User Badges:

hi edison


can u explain why they will not be able to ping each other , and will they be able to communicate at all with each other


will Switchs CAM table will not come in picture in this scenario ( like unknown unicasts etc)

syedsohailsarwar Wed, 11/14/2007 - 09:17
User Badges:

HI Edison can u help me out PLz

i tried the same scenario as described by Azofluak but on Boson Simulator but the PC's were unable to ping eachother although i was able to ping from switch (layer 2 only )to each of the two PC's


kindly help me out , how will i be able to make to PC's ping each other (connected to a switch) but there will be no router in the picture and PC's will use IP's from two different subnets say 172.16.1.1 /16

and 92.168.1.1/ 24

syedsohailsarwar Tue, 11/13/2007 - 08:53
User Badges:

hi williams


its still not clear to me , will they be able to ping each other without using a router and even when i ll be assigning two ips which are from different subnets say eq ip's used are 172.16.0.1 /16 and 192.168.0.1/24


will they be able to ping using mac address only ( looking into CAM table of switch)

Richard Burts Tue, 11/13/2007 - 09:12
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

syed


There is an important question that has not yet been addressed. On the layer 2 switch are the 2 PCs in the same VLAN or are they in different VLANs? If the PCs are in different VLANs then they absolutely will not be able to ping without some kind of router or layer 3 device doing intervlan routing. If the PCs are in the same VLAN then they are in the same broadcast domain and it may be possible that they could ping each other. If the PCs are in the same broadcast domain then they will hear each other's ARP request. If 172.16.0.1 would ARP for 192.168.0.1 (which may or may not happen depending on the IP stack of the PC and how the default gateway may be configured) then 192.168.0.1 would receive the ARP. And if 192.168.0.1 answers the ARP then the two PCs would be able to ping each other.


This question is subtle because it deals with an assumption that we usually make and which may not be true in this situation. We tend to equate subnet and VLAN. A VLAN is a broadcast domain (the group of network devices which can hear each other's broadcast messages). Each VLAN should have a unique subnet. We tend to assume that each subnet is its own broadcast domain (providing separation) but this is not always true. It is possible to have two separate subnets in the same VLAN. And when two separate subnets are in the same VLAN then some of the assumptions that we make about separation of subnets are no longer true.


HTH


Rick

syedsohailsarwar Tue, 11/13/2007 - 09:48
User Badges:

Hi rick


thanks for writing.

i would like to add few points , first by default all ports will be in vlan 1 (default Vlan) , so i am not going to make any changes as far as vlans are defined on the catalsyt 2950 , thus all ports will be in same vlan , will they be able to ping each other and what will be the gateway for each PC ( if its presumed that no gatway is set at all on them , then what will happen in that case)

syedsohailsarwar Wed, 11/14/2007 - 09:19
User Badges:

Hi rick


no response from ur end


kindly help


how will i be able to make to PC's ping each other (connected to a switch) but there will be no router in the picture and PC's will use IP's from two different subnets say 172.16.1.1 /16

and 92.168.1.1/ 24

syedsohailsarwar Thu, 11/15/2007 - 17:36
User Badges:

hi rick


kindly help , will it work without using router or layer 3 device , i mean two pc's connected to a layer 2 switch having respcetive ip addresses from two subnets and all ports of the switch are in default Vlan

azoulflak Tue, 11/13/2007 - 09:20
User Badges:

You can try to configure a secondary ip address on PC1 in same subnet as PC2.

You may also try to enable IP forwarding on one pc and then configure proxy arp on it (this just an idea im not sure if it is going to work)

azoulflak Tue, 11/13/2007 - 17:09
User Badges:

PC1 : IP 192.168.1.1 GW 172.16.1.1

PC2 : IP 172.16.1.1 GW 192.168.1.1


this will allow arp to work between the two pcs.


Otherwise it wont work without a L3 device.



syedsohailsarwar Wed, 11/14/2007 - 09:16
User Badges:

Hi azoulflak


i tried exactly the same scenario as described by you but on Boson Simulator but the PC's were unable to ping eachother although i was able to ping from switch (layer 2 only )to each of the two PC's


kindly help me out , how will i be able to make to PC's ping each other (connected to a switch) but there will be no router in the picture and PC's will use IP's from two different subnets say 172.16.1.1 /16

and 92.168.1.1/ 24

azoulflak Wed, 11/14/2007 - 09:37
User Badges:

It is working because I tested it with real PCs. I used a crossover cable to connect them because I do not have a switch but this should be the same if the two PCs are in the same VLAN and L1 and L2 are up (speed/duplex settings, cabling).

syedsohailsarwar Thu, 11/15/2007 - 17:29
User Badges:

u mean to say that simply asign ip's as

PC1 172.16.1.1/16 with GW 192.168.1.1

and PC2 192.168.1.1 /24 with GW 172.16.1.1


am i rite , so let me try

Actions

This Discussion