cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

CISCO SWITCHES FOR SMALL and MEDIUM BUSINESS

Introducing the next generation of Cisco Small and Medium Business Switches. Cisco is refreshing its SMB Switch portfolio. Click here  to learn more.


332
Views
0
Helpful
2
Replies
Beginner

Cisco SG500X how to change port assigned VLAN via SNMP

Hello,


I want to change the VLAN assigned to a port on a SG500X using SNMP. The running firmware version is 1.4.9.4 .

What I have done so far:

- definded some VLANs with the web interface
- enabled SNMP and configured communitiy and password for SNMPv2c and configured engine-ID and security name for SNMPv3
- tried SNMPv2c and SNMPv3 requests (get, set, walk) fom the Windows 10 command line tool with the shell tools from snmpsoft.com
- followed the instructions on this thread for vlan snmp management on a catalyst

- worked through the documentation

 

When I send a snmpwalk request for the "ifDescr" OID (.1.3.6.1.2.1.2.2.1.2) to get the ifIndex referring to the Ports, the first shown ifIndex is 49 for gigabitethernet1/1/1. This works with SNMPv2c and SNMPv3 as well.

All gigabitethernet ports were assigned to a vlan by the web interface and is shown there correctly. When I send a snmpget request with the "vmVlan" OID with the ifIndex of any port (for example port 15 --> ifIndex63: .1.3.6.1.4.1.9.9.68.1.2.2.1.2.63 ) I just get:
- with SNMPv2c:
  %Failed to get value of SNMP variable. Variable does not exist (noSuchName(2))
- with SNMPv3:
  OID=.1.3.6.1.4.1.9.9.68.1.2.2.1.2.63
  Type=<Unknown>
  Value=

Same with snmpset and SNMPv2c, but with SNMPv3 I get:
%Failed to set value to SNMP variable. Not Writable (notWritable(17))

 

I dont know where else to find a solution for this problem and moreover what exactly the problem is.
May it because not Catalyst systems use another OID?
And shouldnt I get an ifIndex starting from Zero or one from the snmpwalk request?

Hope anyone can help.
Big thanks in advance.

 

Everyone's tags (5)
2 REPLIES 2
Cisco Employee

Re: Cisco SG500X how to change port assigned VLAN via SNMP

Hello Matima,

Happy New 2019 Year!

You are correct - Catalysts use different OIDs.

The MIB files for Sx500 switches are here:

https://software.cisco.com/download/home/284099570/type/283415684/release/1.4.1?i=!pp

 

Hope it helps

Cheers, 

Mike

 

Beginner

Re: Cisco SG500X how to change port assigned VLAN via SNMP

Hello Mike,

Thank you for your prompt reply!

 

In the MIB files you linked, I unfortunately found no way to connect a port/interface of the switch with an existing VLAN or rather change a VLAN of a port.


I just found an OID where the individual Indexes (mapped to the ports) return the Indexes of the assigned VLANs.
It is
<.iso.org.dod.internet.mgmt.mib-2.dot1dBridge.qBridgeMIB.qBridgeMIBObjects.dot1qVlan.dot1qPortVlanTable.dot1qPortVlanEntry.dot1qPvid>
or as a number  .1.3.6.1.2.1.17.7.1.4.5.1.1

 

This one is "readable and writable" so I simply tried to SNMPwrite another (existing) VLAN-Index to

.1.3.6.1.2.1.17.7.1.4.5.1.1.50 for example, which is gigabitethernet1/1/2.
As type of the value I used uint (original value given from SNMPread is GAUGE32 )
The apperaring error message is:
%Failed to set value to SNMP variable. General Error (genErr(5))


If I try to set the VLAN in the SNMPwrite command to the one the port actually has, the CLI shows:
OK

At least something must be right I guess?!?

So further on my question persitsts.
Any more ideas?

 

Thanks,
Matima