Ethernet Switches & Routers

Reply
New Contributor
Posts: 2
Registered: ‎07-12-2010

How to get mac-address via SNMP

We need to locate our devices MAC address on the switch.  We currently use cli show mac-address but would like to switch to SNMP control.  I have not been able to find an SNMP replacement for show mac-address.  Does anyone know where I can find a list of all the MAC addresses attached to each port?

New Contributor
Posts: 3
Registered: ‎07-13-2010

Re: How to get mac-address via SNMP

Brett,

You may be able to use snmpwalk to get the information you need. However, you'll have to figure out what OID to poll in the MIB you're switch utilizes to present the CAM table over SNMP. Without any information, I'll take a guess and say it's going to be in, "FOUNDRY-SN-MAC-VLAN-MIB".

Here's an example of how to use snmpwalk with a standard MIB to poll the ARP table from a router or L3 Switch.

#snmpwalk -v 2c -c abc123 10.10.10.1 ipNetToMediaPhysAddress

IP-MIB::ipNetToMediaPhysAddress.8.10.10.10.1 = STRING: 0:1b:2b:cd:60:3a
IP-MIB::ipNetToMediaPhysAddress.8.10.10.10.100 = STRING: 0:1d:9:30:49:1a
IP-MIB::ipNetToMediaPhysAddress.8.10.10.10.150 = STRING: 8:0:27:4:34:cd
IP-MIB::ipNetToMediaPhysAddress.10.10.10.20.1 = STRING: 0:1b:54:48:91:10
IP-MIB::ipNetToMediaPhysAddress.10.10.10.20.100 = STRING: 0:21:e9:df:e8:73

#

Alternatively, you can also run the snmpwalk without specifying a MIB area of interest, leave off the last argument shown in the example above, and it will return a large number of rows you could manually scan through to find the information you need.

Here is a link to some additional snmpwalk examples:

http://net-snmp.sourceforge.net/wiki/index.php/TUT:snmpwalk#Basic_Example

Matt

New Contributor
Posts: 2
Registered: ‎07-12-2010

Re: How to get mac-address via SNMP

Thanks for your reply.

I found a table with ipNetToMediaPhysAddress in the RFC1213-MIB.iso.org.dod.internet.mgmt.mib-2 in the ip.iNetToMediaTable.  However it is not showing all the devices I have attached.  It will occasionally show some of them but has never shown all of them.  I have IO active on 9 ports and have only seen 2 or 3 of them show up in that table.  When I use "show mac-address" all of them show up all of the time.  That table is full of MACs that it has found over the mgmt port (from our lab network) and those seem to be quite consistent, but rarely does it show one of the 10G ports.

The switch I am using is the TurboIron24.  I am using iReasoning MIB Browser to try to locate the info and have loaded the TIS04200.mib.  I have some test JAVA code with which I am able to enable and disable ports using the RFC1213-MIB.iso.org.dod.internet.mgmt.mib-2 interfaces.iftable and now only need to be able to locate the port I want to manage.

I do not see the FOUNDRY-SN-MAC-VLAN-MIB in the MIB list provided in TIS04200.mib.  Maybe I need to locate it seperately.

Again, I am greatful for you assistance.

New Contributor
Posts: 3
Registered: ‎07-13-2010

Re: How to get mac-address via SNMP

Brett,

Right, ipNetToMediaPhysAddress should only show you entries in the ARP table. The ARP table entries should be pretty limited if your using this switch primarily in a layer 2 fashion.

Take a look at this link for additional information: http://www.snmplink.org/OnLineMIB/Brocade/

You can find the MIB I referenced under: Parent- > Brocade Communication Systems, Inc. > Foundry Networks, Inc >  FGL04000

Matt

Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.

vADC is now Pulse Secure
Download FREE NVMe eBook