08-10-2012 12:40 AM
Hi there.
I'm trying to get the VLAN's a trunc port is a member of using snmp using the CISCO-VTP-MIB
The following key holds this information: .1.3.6.1.4.1.9.9.46.1.6.1.1.4
(.iso.org.dod.internet.private.enterprises.cisco.ciscoMgmt.ciscoVtpMIB.vtpMIBObjects.vlanTrunkPorts.vlanTrunkPortTable.vlanTrunkPortEntry.vlanTrunkPortVlansEnabled)
As far as i know the result is a hex value thet has to be transfered into a binary value, and then count the positions of the enabled bits to find out what vlans exists in a trunc.
If i query the snmp for a port i get the following result:
60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
Converting this to binary gives me:
0110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000111100000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000
if i count the enabled bit's position i get the following result;
1,2,200,201,202,203
The VLANS enabled in that trunk is only:
1,2,200
Why do i get readings about vlans not present?
If i remove VLAN 200 from the trunk the reading is correct
if i replace vlan 200 with vlan 201 the reading is correct.
The same applies to vlan 1024, if i add that vlan i get enabled bits on vlan 1024,1025,1026
Is there anyone who can point me in the right direction getting only the correct vlans listed when quiery SNMP v2
The switch i'm querying is a WS-C2960G-8TC-L
Regards
Alexander Eid
08-10-2012 01:01 PM
Problem solved
The hexto bin converter i was using (vb.net) was not converting correctly, solved by manually do the conversion
Thanks to all of you that looked into it
Regards
Alexander EId
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide