Using SNMP, how can I find the VLANs associated with an interface


Using SNMP, how can I find the VLANs associated with an interface?

I know I can snmpwalk
code:
1.3.6.1.4.1.1916.1.4.17.1.1
but that only starts "at the top" (ie the first port), and takes AGES to get to the actual interface I'm interested in...

Thanks for any pointers!

6 replies

Userlevel 4
Hello Florian,
EXOS has in the latest version implemented the dot1Q MIB which is an MIB2 value.
Can you confirm you looking for Software EXOS 21.xx and later.
regards
BAstian
.
Bastian Sprotte wrote:

Hello Florian,
EXOS has in the latest version implemented the dot1Q MIB which is an MIB2 value.
Can you confirm you looking for Software EXOS 21.xx and later.
regards
BAstian
.

Hi Bastia, thanks for the quick reply. Unfortunately we are running v.15 and 16 in our company...
Userlevel 5
Florian,

I wrote a small PHP script with a web interface that lists my switches, which port is in what VLANS (tagged/untagged) and also lists all ports on all switches that are in the same VLAN. It uses SNMP to query the switches and a little bit of MySQL to store the information

It's a hack that does what I needed. It doesn't follow best practice developer standards, but it works. "Butterknife-as-screwdriver". If I had to redo it, it would probably be in python, but knowing myself, it would probably still be a hack 😉

I'll be more than happy to share that with you. Can this forum do private messages to exchange email addresses?

Frank
Userlevel 5
Frank wrote:

Florian,

I wrote a small PHP script with a web interface that lists my switches, which port is in what VLANS (tagged/untagged) and also lists all ports on all switches that are in the same VLAN. It uses SNMP to query the switches and a little bit of MySQL to store the information

It's a hack that does what I needed. It doesn't follow best practice developer standards, but it works. "Butterknife-as-screwdriver". If I had to redo it, it would probably be in python, but knowing myself, it would probably still be a hack 😉

I'll be more than happy to share that with you. Can this forum do private messages to exchange email addresses?

Frank

Basically I'm using these OIDs to crawl my way through the switches: (Yay for the formatting squish...)
"Extreme" => array ("vname" => ".1.3.6.1.4.1.1916.1.2.1.2.1.2", //extremeVlanIfDescr.vlan_no = string NOT the tag, though
"vport" => ".1.3.6.1.4.1.1916.1.4.17.1.1", //extremePortVlanInfoDescr.port.vlan_no = string
"vtag" => ".1.3.6.1.4.1.1916.1.2.1.2.1.10", //extremeVlanIfVlanId.vlan_no = integer
"tagged" => ".1.3.6.1.4.1.1916.1.2.6.1.1.1", //extremeVlanOpaqueTaggedPorts .VLANid.SLOT = Hex-String
"untagged" => ".1.3.6.1.4.1.1916.1.2.6.1.1.2" //extremeVlanOpaqueUntaggedPorts .VLANid.SLOT = Hex-String
)[/code][/code]
Dear Frank,

Thank you, I am aware of those MIBs and have played around with them. However, I am looking at core switches of a large ISP with a great many VLANs and interfaces, so this technique is not directly an option. I was rather wanting to double check if I missed something, but it looks like I haven't; at least not with the version of EXOS at hand.

Thank you, gentlemen!
Userlevel 5
Florian Knorn wrote:

Dear Frank,

Thank you, I am aware of those MIBs and have played around with them. However, I am looking at core switches of a large ISP with a great many VLANs and interfaces, so this technique is not directly an option. I was rather wanting to double check if I missed something, but it looks like I haven't; at least not with the version of EXOS at hand.

Thank you, gentlemen!

Florian,
Sadly, I agree with you. What's even worse is that it appears as if the other players don't seem to do it either, so if that OID really works on 22.x, Extreme might just be the first one to give us what we need 😉

I think the only remaining option (if you know which port is interesting to you), do an automated ssh session and a "show vlan port X" and "screenscrape"/parse the output. Either with "Expect" scripts or some python magic. That way you'd not only get the vlans with their tags, but also VR and other information.

Good luck!

Reply