cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2945
Views
7
Helpful
9
Replies

Switch 3550: mac-address table

mayurautoid
Level 1
Level 1

Hi,

I am working on Cisco 3550 switch on a certain requirement. I have got an access point connected to the switch and few mobile phones connected to the access point. I get the list of mac addresses connected to the switch ( Both access point's mac address & the clients addresses) by "show mac-address table dynamic" command. However, i am unable/confused to get the output of the following scenarios:

1. I would require to export the mac address from the switch to the local machine in any format (May be by using an SNMP tool, if available) so that the same needs to be used in my C# for development.What would be the way for the same ?

2. The mac address in the mac address table doesn't get updated dynamically. (Eg Scenario: A wifi client gets connected to an access point which inturn is connected to the switch, the mac address of the client shows up in the switch table. However if the client is disconnected, the client's mac address would still be displayed in the switch table )

Thanks in Advance !!

9 Replies 9

cadet alain
VIP Alumni
VIP Alumni

Hi,

1) Cisco device outputs MAC addresses like this xxxx.xxxx.xxxx while Linux/Windows use xx:xx:xx:xx:xx:xx or xx-xx-xx-xx-xx-xx and so I think you'll need a script to change the format.

2) CAM table age out dynamic entries after 5 mins of inactivity so wait for this aging time to timeout and the entry won't appear anymore.You can change this aging time but if you make it too low then you'll have more unknown unicast flooding in your network

Regards.

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

Thanks Alain,

Speaking on point 1, I could develop a script to change the format of mac address. However, i am concerned about an interface which can provide me the mac address details from the switch. In simple terms, i would require the mac addresses to be extracted/exported from the switch.

If the way out is through SNMP, I have enabled SNMP both in the switch & the local host machine. Kindly advice !

Hello Mayur,

Yes your best option here is to use SNMP because that way you can do get the data right in to your code and do operation on them within the code.

If you want to use SNMP is your code, you will have to have some C# package that understands SNMP and lets you query using SNMP.

I have done some similer project using perl.. let me expain how it works,

Each manageable/monitored entity within the switch has a unique code ( string ) called OID ( object identifier ) these OID's are not random they have a particular structure, a structure that defined by it's MIB. For example, Switch port name will have the OID of 1.3.6.1.2.1.31.1.1.1.1 where you can refer to the same thing with the unique textual format which is more memorable .

So with your scenario, The most important thing is to correctly identifying the exact OID that gives you the list of MAC address for the port we are interested. Once you have it, you just have to do a simple SNMP query and catch the reply in a variable and do some String manipulations and get a clean list of MAC addresses. Within your code, you can set a timer and make the SNMP polling happening each 5 mins or so..

IF you want to understand more about how MIBs work go here :

http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.progcomm/doc/progcomc/mib.htm

To check Cisco Specific OID ( MIB structure ) go here :  http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en

and click on the Browse The Object Tree

To see exactly how it layed out.

If you want more informaion on this please let me know.

Please rate this post if helpful.

Thanks

Shamal

Hello Shamal,

Thanks for the detailed information.

1. Can you kindly share the script on which you have worked so that I could get a fair idea on the same.

2. I checked the OID of the given number which says the TYPE as DISPLAY STRING. Does that refer to the ethernet interface itself ?

3. I have enabled the SNMP feature in my local host & also have enabled the SNMP feature in the switch, now how do i trap the recordings in my local host ?

Thanks a lot in Advance!

Mayur

Hi,

You need a  SNMP software on the host to query the SNMP agent on the switch like SNMP walk for example.

Regards.

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

Hi,
I will check my old scripts and post some stuff for u. So u can get an idea about this.

Also if u can let me know what u are exactly trying to do with your code that will be great.. Are you going to manually transfer MAC address in to your code ?? Or do you want the code to automatically get information from the switches during its execution ?

Thanks
Shamal

Sent from Cisco Technical Support iPhone App

Hi Shamal,

Thanks in adance for the script.

Yes, i want the code to automatically fetch the information on MAC address from the switch !!

Regards

Mayur

Hi Shamal & All,

I have used SNMP walk & have attained up to the level described in the attached screenshot. Kindly let me know as to how to get the mac address displayed. I have used the OID of physical interface, yet unable to obtain the desired results.

Kindly find the attached screen shot.

Kindly help me in finding a way out.

Regards

Mayur

Hi Mayur,

I think you are in the right track regarding using the physical interface OID.

Try 1.3.6.1.2.1.17.4.3.1 against the Interfaces.

I have also found this http://www.cisco.com/en/US/tech/tk648/tk362/technologies_tech_note09186a0080094a9b.shtml

document which clearly specify how you should pick the OID.

I have sent you a Perl script I have written in the past for your reference. It is not exactly querying for MAC addresses but you can get an Idea how to perform such tasks. The script I'm sending you will query each port on a switch and it will update an XML  file with the collisions and errors found for each port, and it will send emails based on that information.

Again, running the snmpwalk on the command prompt on windows will only give you a list of MAC addresses.

But I think you need some sort of Library/Package for you C# that understands and lets you work with SNMP within the code ( here with Perl we use a package called Net::SNMP )

Let me know if you want more information on this.

And please don't forget to rate helpful posts..

Thanks

Shamal

Review Cisco Networking for a $25 gift card