• May 21, 2012, 08:40:29 AM
Welcome, Guest. Please login or register. Registration is free.
Did you miss your activation email?

Author Topic: Knowing the IP of a device connected to a port by snmp  (Read 554 times)

0 Members and 1 Guest are viewing this topic.

Offline FredChut

  • Rookie
  • **
  • Posts: 4
Knowing the IP of a device connected to a port by snmp
« on: November 14, 2011, 01:01:01 PM »
Hi all.

I am looking for the OIDs that will permit to associate an IP to the port it is connected.
I have tried with thoose ones:

1.3.6.1.2.1.4.22.1.2
For having pairs of Hex Mac addresses (value of snmp key) and IP addresses (extract from the of the snmp key name)

1.3.6.1.2.1.17.4.3.1.1
For having pairs of decimals values of the Mac addresses (extract from the of the snmp key name) and Mac addresses (value of snmp key)

1.3.6.1.2.1.17.4.3.1.2
For having pairs of decimals values of the Mac addresses (extract from the of the snmp key name) and ports (value of snmp key)

So with thoose 3 OID i can have thoose relations:
Port -> Decimal Mac address -> Hex Mac address -> IP address

But it doesn't work well.
Sometimes i can have the ip only after pinging it, or never.

I don't understand exactly why, but it seems that this are not the good OIDs to look at.

Has someone an idea of the OID(s) needed to be able to know the ip connected to a port as soon as the device is connected ?

Thanks in advance.
« Last Edit: November 14, 2011, 01:05:13 PM by FredChut »


Online Flintstone

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 583
Re: Knowing the IP of a device connected to a port by snmp
« Reply #1 on: November 14, 2011, 03:30:34 PM »
Hi FredChut and welcome to the forum,

I cheat and use a Solarwinds application called 'port mapper', where you configure the layer 2 and 3 Network devices and then you will see the following:

 Port -> Description -> MACs -> Vlans -> IP addresses -> DNS resolution -> etc

CheerZ and good luck

Offline FredChut

  • Rookie
  • **
  • Posts: 4
Re: Knowing the IP of a device connected to a port by snmp
« Reply #2 on: November 14, 2011, 04:33:03 PM »
Hi Flintstone.

Thank you for your response.
Yes it is possible to have this information with 3rd party softwares.

But my goal is to know it myself by Snmp to embed the result into a home made program.
This program is a Vlan Manager for Avaya.
It represent the switches and shows the Vlan affected to the ports with colors.
Modification of a Vlan affectation for a port is also possible.



As you can see at top/left of the program layout (SHOW IP LIST), i want to implement a list table with the IP connected to ports.
That is why i need to resolve it, by knowing the different OID involved for this.


Offline Michael McNamara

  • Administrator
  • Hero Member
  • *****
  • Posts: 2503
    • Michael McNamara
Re: Knowing the IP of a device connected to a port by snmp
« Reply #3 on: November 14, 2011, 09:37:21 PM »
Hi FredChut and welcome!

You'll need to spend some time looking over the appropriate SNMP MIBS to understand how to decode them.

Have a look at this post;
http://blog.michaelfmcnamara.com/2008/05/perl-script-to-poll-arp-table/

And there are multiple posts in this forum covering the topic;
http://forums.networkinfrastructure.info/nortel-ethernet-switching/8600-access-mac-addresses-table-via-snmp/

Good Luck!

The VLAN assignment is a bit more complicated since it is returned as a bit
We've been helping network engineers, system administrators and technology professionals since June 2009.
If you've found this site useful or helpful, please help me spread the word. Link to us in your blog or homepage - Thanks!

Offline FredChut

  • Rookie
  • **
  • Posts: 4
Re: Knowing the IP of a device connected to a port by snmp
« Reply #4 on: November 14, 2011, 10:33:01 PM »
Hi Mickael and thank you !

The software is already working.
It permit connect to stacks of two 5650TD switches by snmp.
When connecting to a stack it retieve the vlans created in the switch and then read the vlans memberships.
I have understood how the hexa/bit coded membership works.
A little bit tricky, i agree with you...without talking of the offset to 128 for the number of the first port of the second switch...
After connection, I show a representation of the vlans port members of the stack with colors.
Ports are clickable and another vlan can be affected to the selected port.

I have browsed the Avaya MIBs and used it for the software.
But i didn't success to find in witch OID(s) the link between port number and ip connected to this port can be found.

I will follow your links to see.
Thank you.

I will try

Offline FredChut

  • Rookie
  • **
  • Posts: 4
Re: Knowing the IP of a device connected to a port by snmp
« Reply #5 on: November 14, 2011, 10:43:10 PM »
Ooops...
Sorry Michael not Mickael.
I apologize.

Offline Michael McNamara

  • Administrator
  • Hero Member
  • *****
  • Posts: 2503
    • Michael McNamara
Re: Knowing the IP of a device connected to a port by snmp
« Reply #6 on: November 14, 2011, 11:48:58 PM »
You need to walk the MAC/FDB table to get the MAC/FDB and port association. Then you need to walk the ARP table to get the association between the MAC/FDB and IP address.

With those two pieces of information you'll be able to determine what IP is connected to what port.

Good Luck!
We've been helping network engineers, system administrators and technology professionals since June 2009.
If you've found this site useful or helpful, please help me spread the word. Link to us in your blog or homepage - Thanks!