Where's Waldo? Locating the OID you need.

A few days ago I decided to write a little Cisco-centric SNMP query/modify tool. I didn't need or want anything beyond simply finding the switch and switchport a MAC or IP address was plugged into, and to be able to set that port to another VLAN, and then enable/disable the port to force the system to renew it's DHCP lease. Most of the OIDs I needed were simple to find, others not so for some reason. Here's my s

A few days ago I decided to write a little Cisco-centric SNMP query/modify tool. I didn't need or want anything beyond simply finding the switch and switchport a MAC or IP address was plugged into, and to be able to set that port to another VLAN, and then enable/disable the port to force the system to renew it's DHCP lease. Most of the OIDs I needed were simple to find, others not so for some reason. Here's my short list:

Pull the MAC address table: .1.3.6.1.2.1.17.4.3.1.1

o- Used in conjuction with community@vlan syntax.

Pull the bridge port number table: .1.3.6.1.2.1.17.4.3.1.2

Find the ifIndex number: .1.3.6.1.2.1.17.1.4.1.2.<bridge port number>

Find the assigned VLAN: .1.3.6.1.4.1.9.9.68.1.2.2.1.2.<ifIndex>

Find the real port name: .1.3.6.1.2.1.31.1.1.1.1.<ifIndex>

Set a port to another VLAN: .1.3.6.1.4.1.9.9.68.1.2.2.1.2.<ifIndex> integer <VLAN ID>

Enable/disable a switchport: .1.3.6.1.2.1.2.2.1.7.379.<ifIndex> integer [ 1 = enabled | 2 = disabled ]

I'm still writing this tool, so there's sure to be more in the near future.

Mobile Security Insider: iOS vs. Android vs. BlackBerry vs. Windows Phone
Join the discussion
Be the first to comment on this article. Our Commenting Policies