2 Replies Latest reply on Nov 10, 2011 1:21 PM by ascension2020

    How to find the number of MAC addresses on a Cisco switch


      Hi all,

      I'm trying to figure out a way to poll Cisco switches (3750s and 6509s) for the number of MAC addresses that they are using. It seems that Cisco has made this unusually complex. I've been researching on the Cisco support forums and I see a lot of people writing their own scripts to do it, but I'm trying to keep my network management as centralized as possible, so I'm hoping to do it in Solarwinds.

      Basically I want to retrieve the bolded lines below. The problem is that there's no OID that I can find that corresponds to those numbers:

      Cisco_6509#show mac-address-table count
      MAC Entries  for all vlans :
      Dynamic Address Count:                6760
      Static Address (User-defined) Count:  576
      Total MAC Addresses In Use:           7336 <--- I'd be happy just knowing the dynamic count too
      Total MAC Addresses Available:        65536 

      Cisco 3750#show mac-address-table count
      Mac Entries for Vlan 1:
      Dynamic Address Count  : 0
      Static  Address Count  : 0
      Total Mac Addresses    : 0

      Mac Entries for Vlan 2:
      Dynamic Address Count  : 7
      Static  Address Count  : 0
      Total Mac Address Space Available: 1854 <--- I'd like to pull this number but I don't think there's an OID to do it

      It seems that most people are writing scripts to pull the MAC address count per VLAN and then add it up. Is there a way to do that in SW? Can anyone point me in the right direction?


        • Re: How to find the number of MAC addresses on a Cisco switch

          If there is no Cisco MIB to find the total MAC address count then we cant do much either,we rely on SNMP data like every other NMS.

          On the comment that most people pull data from MAC address count per VLANs and then add them up.Are they using MIB values from each VLAN for MAC address count to add them up?

          If yes ,please share the MIBs.We should then be able to find an answer.If no,we would like to know more on the script.

            • Re: How to find the number of MAC addresses on a Cisco switch

              Yes I understand that it all has to be done through SNMP

              There's no specific MIB to get the data I want, but you can find out the number of MAC addresses on each VLAN and then add them up. Cisco describes part of it in this document: http://www.cisco.com/en/US/tech/tk648/tk362/technologies_tech_note09186a0080094a9b.shtml. The document is actually describing how to use SNMP to find out the port that a MAC address was learned on, but it's a good starting point. One of the steps in the document is:

              2. For each VLAN, get the MAC address table (using community string indexingdot1dTpFdbAddress (. In the example, VLAN 2 contains no entries in the table:

              nms-server2:/home/ccarring> snmpwalk -c public@1 dot1dTpFdbAddress
              . = Hex-STRING: 00 D0 D3 6A 47 FB
              nms-server2:/home/ccarring> snmpwalk -c public@2 dot1dTpFdbAddress
              nms-server2:/home/ccarring> snmpwalk -c public@6 dot1dTpFdbAddress
              . = Hex-STRING: 00 02 B9 90 4C 66
              . = Hex-STRING: 00 02 FD 6A AA F3
              . = Hex-STRING: 00 10 0D 38 10 00
              . = Hex-STRING: 00 60 54 90 F8 00
              . = Hex-STRING: 00 D0 02 D6 78 0A
              . = Hex-STRING: 00 D0 D3 36 A2 3C
              . = Hex-STRING: 00 E0 1E 9F 0A D2
              nms-server2:/home/ccarring> snmpwalk -c public@7 dot1dTpFdbAddress
              . = Hex-STRING: 00 10 0D A1 18 20     
              ... and so forth for each VLAN discovered in the first step.

              From that point, people talk about writing a script to add up the MACs discovered in each of the VLANs. I haven't actually seen an example script, I've just seen people say that they've done it. There's a discussion about it at this link: https://supportforums.cisco.com/thread/2097158.

              It seems pretty easy to do, but I'm trying to keep it in Solarwinds instead of writing an outside script to do it. I'm hoping that there's a way to create a poller in SW to get the MACs and then add them up, but I'm having two problems:

              1. When testing dot1dTpFdbAddress in SW it only picks up a few MACs on the switch. I think the reason is because you're supposed to specify the VLAN that you want to poll (see Cisco's example above) but I can't find a way to do that in SW.
              2. If I could find how to do it, I'm not sure how to create a poller that would hit each VLAN on the switch and then add up the MACs. Is that even possible?