10 Replies Latest reply: May 16, 2012 8:54 AM by arteq RSS

    Question on Switch.


      Dear All,


      Yesterday i went for the interview at one of reputed company in networks. & sr. Manger asked me to simple question but i didn't know the answer if anyone know then tell me.



      Question Is that we have 2 Layer 2 switch for example Switch A & Switch B. number of system connected to both switch's. you are in Switch A & how to know the IP address of the system's which are connected to Switch A & Switch B also without going to switch B.



      Please tell me....

        • 1. Re: Question on Switch.

          the wonders of cdp is what you needed

          • 2. Re: Question on Switch.

            What is the command ?

            • 3. Re: Question on Switch.

              show cdp neighbours

              show mac-address-table could also help if there are dynamic learned mac addresses via trunk port.

              sh ip arp will show you ip addresses.

              • 4. Re: Question on Switch.



                Please try "show ip arp" or "show arp".  It really depends on the switch.


                The global command across all the networking product will give you the output.


                The "show mac-address-table" will give only the MAC address learned through the trunk ports.

                • 5. Re: Question on Switch.

                  i dont think so , coz show cdp neighbours command will show the other devices which is directly connected to switch A, it will not show the systems which is connected to switch B .

                  • 6. Re: Question on Switch.

                    Hi Raul...


                    For you i done R&D . I connected 2 Cisco 3560(Also tried on Cisco 2950) Switches and each switch wasconnected with 2 workstations. I found show ip arp or sh arp command will show you ip address of all connected device with mac address. Show mac-address-table command would only show mac address of systems connected with that particular switch.

                    • 7. Re: Question on Switch.

                      Trick question - The good engineer/operator will consult the documentation that s/he maintains. 

                      • 8. Re: Question on Switch.

                        show ip interface brief, show interfaces <interface>, show cdp neighbors, show cdp neighbors detail


                        just check the subnetmask of each interface and you will know what is the ip address of the links connected to each interface. basic simple, CENT or CCNA is the spot to ask this question.

                        • 9. Re: Question on Switch.

                          Hi guys


                          I think we are missing the point here! Rahul explicitly mentioned that they are 2 layer 2 switches, which will only show arp entries for the management interfaces that it talks to with other switches. few things


                          if lets say your PC is connected to switch A which connects to switch B and the stations are connected behind the switch. If they are in the same boradcast domain


                          then from your PC just ping the broadcast address...For e.g. your PC has got the following address





                          Then just ping


                          and any live station that gets this broadcast will send a reply.


                          On your PC, then do arp -a

                          and you will get the entries of all other stations.


                          2nd method is that you need a layer 3 device like a router or a L3 switch to ping the broadcast address and populate its arp table with the IP/mac addresses of the stations. From L2 switches you can indeed find mac addresses, but not the corresponding IP.


                          Alos if the router or L3 switch is there and leasing DHCP addresses, then you can key in


                          show ip dhcp bindings command to check the IP addresses.


                          Other than that you need a third party software such as netscan or WSpingpropack to scan the network by sending ICMP echoes.


                          Hope this helps

                          • 10. Re: Question on Switch.

                            like nuno said, sh cdp neigh detail will give the ip address of any directly connected cisco  device... that should be the first choice if both switches are cisco... lldp for vendor neutral devices...