Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to get the mac address on a specific switch port?

How to get the mac address on a specific switch port?

Scheduled Pinned Locked Moved C#
tutorialsysadminhelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    grmihel2
    wrote on last edited by
    #1

    Hey guys... I have the last couple of days explored the beauty of SNMP protocol for smart network device programming using MIBs og OIDs.... But I was thinking, how does I get the mac address of a device, eg. connect to switch port number #12? I have looked at the cisco example, but it seems to but the opposite case (you KNOw the mac address, and want to find the specific port on the siwtch). In my case its like: "You KNOW the PORT located on the switch, and want to extract the MAC address on the equipment connected to that specific port". Any1 got an idea that could help me in the right direction?

    OriginalGriffO 1 Reply Last reply
    0
    • G grmihel2

      Hey guys... I have the last couple of days explored the beauty of SNMP protocol for smart network device programming using MIBs og OIDs.... But I was thinking, how does I get the mac address of a device, eg. connect to switch port number #12? I have looked at the cisco example, but it seems to but the opposite case (you KNOw the mac address, and want to find the specific port on the siwtch). In my case its like: "You KNOW the PORT located on the switch, and want to extract the MAC address on the equipment connected to that specific port". Any1 got an idea that could help me in the right direction?

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Have a look at this[^]

      Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      G 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        Have a look at this[^]

        Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

        G Offline
        G Offline
        grmihel2
        wrote on last edited by
        #3

        Thanks for your suggestions, but it didn't quiet make my solution. I'm looking for an API with a DLL I can use for this purpose, I want to use the existing SNMP protocol with correct MIBs and OIDs to collect and find the mac address on a switch port which is already known. I have almost figured out at this time, how I locate a switch port based on a known mac address, but I want the opposite options if even possible? My last thoughs was read the FDB table mib request (which should return all mac address' and portnumber for each?), and sort them after the port number? But I stumbled on it, cuz it seems that it returns some wrong bits (which ain't representing the MAC address in HEX string). Any other suggestions, that could help me using the SNMP and mibs, collecting a mac address, on a KNOWN switch port?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups