Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

How to get IP address for the devices connected to a switch

                  

Hi All,

     Right now dot1dTpFdbPort(.1.3.6.1.2.1.17.4.3.1.2) OID is being used to find the mac address of the devices connected to a particular switch. It is being found out by passing the VLAN ID and dot1dTpFdbPort OID in the community string(A C# library sharpsnmp is used for this..). We get the list of Bridge port number connected to the switch from which we can get the associated ID which is MAC ID.

But in general, Is it possible to find the IP address of the devices connected to the switch in a similar manner?... Can specific OID be used for this purpose..

When we have the mac address we can use ARP method to get the device IP but then is it possible to get the IP address using OID?

Thanks in Advance.

Everyone's tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

How to get IP address for the devices connected to a switch

The switch does not know the IP of the connected device, since it is a layer 2 device. It only knows the mac address.

The default gateway of the connected device will be able to make the relation between the mac address and the IP address.

So on this device you can collect the ARP table via SNMP.

Cheers,

Michel

7 REPLIES

How to get IP address for the devices connected to a switch

The switch does not know the IP of the connected device, since it is a layer 2 device. It only knows the mac address.

The default gateway of the connected device will be able to make the relation between the mac address and the IP address.

So on this device you can collect the ARP table via SNMP.

Cheers,

Michel

New Member

How to get IP address for the devices connected to a switch

Thank you Micheal Hegeraat. We'll try having the IP address retrived from the default gateway.

New Member

Re: How to get IP address for the devices connected to a switch

Hello Joshua,


What model switch and which IOS is it running?  It is possible to see a listing of ip to mac to port associations if your switch is running ip device tracking.


You could attempt to use the "sh ip device tracking all" command however it may not be enabled or supported.

How to get IP address for the devices connected to a switch

Indeed Damien,

C3750    IOS >= 12.2.52SE

And there is even a mib that could provide the interesting mac/IP details.

http://tools.cisco.com/Support/SNMP/do/BrowseMIB.do?local=en&step=2&mibName=CISCO-PAE-MIB

This might be kind of cutting edge, so careful for sharp edges and loose ends.  :-)

Cheers,

Michel

New Member

How to get IP address for the devices connected to a switch

Thank you Damien Miller and Michel Hegeraat for your inputs.. seems like there is one more thread as well on this .. working on those inputs as well..

https://supportforums.cisco.com/thread/28369

Hall of Fame Super Gold

How to get IP address for the devices connected to a switch

Josh,

Getting the IP Address of devices connected to a Layer 2 switch has a new "twist".

Try this:

conf t

ip device tracking

interface range g1/0/1 - 24

ip device tracking max 10

end

---- Wait for approximately 10 seconds ----

sh ip device tracking max 10

-- or --

sh ip device tracking interface

New Member

Always learning something new

Always learning something new :).

Works perfectly also in L2 switches - at least on 2960S switches with 15.0.2.SE.

Best regards

Isaac Alves

26515
Views
13
Helpful
7
Replies