DX NetOps

  • 1.  mac address visibility on cisco interfaces

    Posted Mar 03, 2017 01:48 PM

    HI All,

    We are looking to find a way within Spectrum to identify what mac addresses are connected to which port on our 2960-cx switches. If we go down to the 'Interface Address translation table'  we see the mac addresses of connected devices but they all show a identical index of 10 , which is the vlan10 management interface. How do we distinguish which port that Mac Address is actually on?

     

    TIA



  • 2.  Re: mac address visibility on cisco interfaces
    Best Answer

    Posted Mar 07, 2017 06:09 AM

    This can be done via REST POST query:

     

    <?xml version="1.0" encoding="UTF-8"?>
    <rs:model-request throttlesize="1000"
    xmlns:rs="http://www.ca.com/spectrum/restful/schema/request"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.ca.com/spectrum/restful/schema/request ../../../xsd/Request.xsd">

    <rs:target-models>
    <rs:models-search>
    <rs:search-criteria xmlns="http://www.ca.com/spectrum/restful/schema/filter">
    <filtered-models>
    <and>
    <equals>
    <attribute id="0x110df">
    <value>01.02.03.04.05.06</value>
    </attribute>
    </equals>
    <equals>
    <attribute id="0x10000">
    <value>Gen_IF_Port</value>
    </attribute>
    </equals>
    </and>
    </filtered-models>
    </rs:search-criteria>
    </rs:models-search>
    </rs:target-models>
    <rs:requested-attribute id="0x12dbb"/>
    <rs:requested-attribute id="0x110df"/>
    <rs:requested-attribute id="0x129fa"/>
    <rs:requested-attribute id="0x11f6f"/>
    <rs:requested-attribute id="0x10000"/>
    </rs:model-request>

     

    This finds all Gen_IF_Type models (interfaces) with the MAC Address 01.02.03.04.05.06.

    Note the modelName contains the device name followed by underscore and then the interface name

     

    e.g. head office_Vl5

     

    You could add more attributes but I've asked for: model name, model type, mac address, interface IP and model handle.

     

    Note for MAC addresses you need to use full stops instead of colons in the request. The output returns the MAC address with colons!

     

    I've checked this on WS-C2960C-12PC-L, 2960-24TT and 2960-Plus-48PST-L switches and get the same response from all of them.

     

    Hope this helps!

     

    Regards,


    Frank



  • 3.  Re: mac address visibility on cisco interfaces

    Posted Mar 07, 2017 06:53 AM

    Hi Frank, Iam not  familiar with  rest post. How is it usef?

     

    Patrick

     

     

     

    Sent from my T-Mobile 4G LTE De



  • 4.  Re: mac address visibility on cisco interfaces

    Posted Mar 07, 2017 09:57 AM

    There are multiple ways depending on what you need. Typically you can use perl or python (or any other scripting to programming language) to write scripts to perform the REST operations and process the data for you.

     

    For on-demand usage, you might want to use a REST plugin for a browser (like Postman):

     

    Postman Rest API demo - YouTube 

     

    This shows postman itself. What you will need to do is supply your spectrum username and password which will be used to authenticate the REST requests. You then need to put in the URL which is typically "http://<ONECLICK IP>:<PORTNO>/spectrum/restful/models"

     

    and then the type would be 'POST' and then past the stuff I posted as the 'body' (the XML code).

     

    You then submit it and it returns XML. You would need to extract the XML into something useful.

     

    I'm not a guru with Postman and don't use it extensively but some tools might even process the output into a more-friendly output.