cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4823
Views
4
Helpful
17
Replies

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

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)

17 Replies 17

Edison Ortiz
Hall of Fame
Hall of Fame

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

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)

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

williamsdo
Level 3
Level 3

In order to ping without a router the devices would have to be on the same IP subnet. Switches use mac-address of NIC cards to determine where to forward traffic, since they are on two port of the same switch the switch can forward using the mac-addresses.

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)

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

HTH

Rick

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)

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

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

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)

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.

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

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).

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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: