cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1185
Views
0
Helpful
2
Replies

Create VLAN on 3750 using SNMP

jeff_stone
Level 1
Level 1

I'm trying to create a VLAN on a 3750 using SNMP.  The document i've found is rather vague and from 2005.  Has anybody done this successfully and if so can you share the process?

From what I understand you have to set the "vtpVlanEditOperation" to the desired mode but each time I set the integer to 2 for copy is get either bad security type or bad object type. Any help would be appreciated.

Here are some commands i've tried.

$ /usr/bin/snmpset -c {writeString} test 10.150.150.20 1.3.6.1.4.1.9.9.46.1.4.1.1.1 INTEGER 2
10.150.150.20: Bad object type: 1
$ /usr/bin/snmpset -c {writeString} 10.150.150.20 1.3.6.1.4.1.9.9.46.1.4.1.1.1 INTEGER 2
snmpset: No securityName specified

 

Thanks!

 

1 Accepted Solution

Accepted Solutions

Vinod Arya
Cisco Employee
Cisco Employee

Also, please check and verify the following in your steps:

(a) The switch MUST be in a VTP domain with "server" mode. If the switch has client or other mode, it will not work. Check your "show vtp domain" command and see what your switch mode is in.   --> This is usually the problem in most cases
 
(b) snmpset to build a mib table can be time sensitive. That is you need to wait.
 
(c) Did you follow these steps:
 
 1. Destroy the row first:
 
snmpset -c private 14.32.6.12 vtpVlanEditRowStatus.1.111 integer 6
 
You should see something like:
 
CISCO-VTP-MIB::vtpVlanEditRowStatus.1.111 = INTEGER: destroy(6)
 
 2. Set vtpVlanEditOperation to copy mode with an owner name:
 
snmpset -c private 14.32.6.12 vtpVlanEditOperation.1 integer 2 vtpVlanEditBufferOwner.1 s "testvlan"
 
You should see something like:
 
CISCO-VTP-MIB::vtpVlanEditOperation.1 = INTEGER: copy(2)
CISCO-VTP-MIB::vtpVlanEditBufferOwner.1 = STRING: "testvlan"
 
 3. Set the row status to createAndGo, and build the table. For VLAN 111, vtpVlanEditDot10Said is 111+100000=100111 which in hex is 0001870F:
 
snmpset -c private 14.32.6.12 vtpVlanEditRowStatus.1.111 integer 4 vtpVlanEditType.1.111
integer 1 vtpVlanEditName.1.111 s "testvlan-vlan" vtpVlanEditDot10Said.1.111 x 0001870F
 
You should see something like:
CISCO-VTP-MIB::vtpVlanEditRowStatus.1.111 = INTEGER: createAndGo(4)
CISCO-VTP-MIB::vtpVlanEditType.1.111 = INTEGER: ethernet(1)
CISCO-VTP-MIB::vtpVlanEditName.1.111 = STRING: testvlan-vlan
CISCO-VTP-MIB::vtpVlanEditDot10Said.1.111 = Hex-STRING: 00 01 87 0F 
 
 4. Check the vtpVlanApplyStatus:
 
snmpwalk -c public 14.32.6.12 vtpVlanApplyStatus
 
You should see "succeeded(2)":
CISCO-VTP-MIB::vtpVlanApplyStatus.1 = INTEGER: succeeded(2)
 
 5. Now set vtpVlanEditOperation to "apply" mode:
 
snmpset -c private 14.32.6.12 vtpVlanEditOperation.1 integer 3
 
You should see something like:
CISCO-VTP-MIB::vtpVlanEditOperation.1 = INTEGER: apply(3)
 
 6. Now check the status again, and it should be still "succeeded(2)":
 
snmpwalk -c public 14.32.6.12 vtpVlanApplyStatus
 
CISCO-VTP-MIB::vtpVlanApplyStatus.1 = INTEGER: succeeded(2)
 
 7. Now check your switch with "show vlan" and you should see a new VLAN 111.
 
 8. Finally you can release the newly created VLAN 111:
 
snmpset -c private 14.32.6.12 vtpVlanEditOperation.1 integer 4
 
You should see something like:
 
CISCO-VTP-MIB::vtpVlanEditOperation.1 = INTEGER: release(4)
 
-Thanks
Vinod
**Encourage Contributors for free. RATE Them :) **
-Thanks Vinod **Rating Encourages contributors, and its really free. **

View solution in original post

2 Replies 2

Vinod Arya
Cisco Employee
Cisco Employee

It seems you have not specified the snmp version as per error "No SecurityName Specified".

Ideally you should specify something like - 

snmpset -v <version 1, 2c or 3> -c <community> <IP> <OID> i <value>

You dont have to mentione INTEGER as whole, just 'i' works.

Check this thread here to create Vlan :

https://supportforums.cisco.com/discussion/11205856/creating-vlan-through-snmp?recent=true

Also, check document here :

http://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/45080-vlans.html

-Thanks

Vinod

** Ecnourage Contributors. RATE them. **

 

-Thanks Vinod **Rating Encourages contributors, and its really free. **

Vinod Arya
Cisco Employee
Cisco Employee

Also, please check and verify the following in your steps:

(a) The switch MUST be in a VTP domain with "server" mode. If the switch has client or other mode, it will not work. Check your "show vtp domain" command and see what your switch mode is in.   --> This is usually the problem in most cases
 
(b) snmpset to build a mib table can be time sensitive. That is you need to wait.
 
(c) Did you follow these steps:
 
 1. Destroy the row first:
 
snmpset -c private 14.32.6.12 vtpVlanEditRowStatus.1.111 integer 6
 
You should see something like:
 
CISCO-VTP-MIB::vtpVlanEditRowStatus.1.111 = INTEGER: destroy(6)
 
 2. Set vtpVlanEditOperation to copy mode with an owner name:
 
snmpset -c private 14.32.6.12 vtpVlanEditOperation.1 integer 2 vtpVlanEditBufferOwner.1 s "testvlan"
 
You should see something like:
 
CISCO-VTP-MIB::vtpVlanEditOperation.1 = INTEGER: copy(2)
CISCO-VTP-MIB::vtpVlanEditBufferOwner.1 = STRING: "testvlan"
 
 3. Set the row status to createAndGo, and build the table. For VLAN 111, vtpVlanEditDot10Said is 111+100000=100111 which in hex is 0001870F:
 
snmpset -c private 14.32.6.12 vtpVlanEditRowStatus.1.111 integer 4 vtpVlanEditType.1.111
integer 1 vtpVlanEditName.1.111 s "testvlan-vlan" vtpVlanEditDot10Said.1.111 x 0001870F
 
You should see something like:
CISCO-VTP-MIB::vtpVlanEditRowStatus.1.111 = INTEGER: createAndGo(4)
CISCO-VTP-MIB::vtpVlanEditType.1.111 = INTEGER: ethernet(1)
CISCO-VTP-MIB::vtpVlanEditName.1.111 = STRING: testvlan-vlan
CISCO-VTP-MIB::vtpVlanEditDot10Said.1.111 = Hex-STRING: 00 01 87 0F 
 
 4. Check the vtpVlanApplyStatus:
 
snmpwalk -c public 14.32.6.12 vtpVlanApplyStatus
 
You should see "succeeded(2)":
CISCO-VTP-MIB::vtpVlanApplyStatus.1 = INTEGER: succeeded(2)
 
 5. Now set vtpVlanEditOperation to "apply" mode:
 
snmpset -c private 14.32.6.12 vtpVlanEditOperation.1 integer 3
 
You should see something like:
CISCO-VTP-MIB::vtpVlanEditOperation.1 = INTEGER: apply(3)
 
 6. Now check the status again, and it should be still "succeeded(2)":
 
snmpwalk -c public 14.32.6.12 vtpVlanApplyStatus
 
CISCO-VTP-MIB::vtpVlanApplyStatus.1 = INTEGER: succeeded(2)
 
 7. Now check your switch with "show vlan" and you should see a new VLAN 111.
 
 8. Finally you can release the newly created VLAN 111:
 
snmpset -c private 14.32.6.12 vtpVlanEditOperation.1 integer 4
 
You should see something like:
 
CISCO-VTP-MIB::vtpVlanEditOperation.1 = INTEGER: release(4)
 
-Thanks
Vinod
**Encourage Contributors for free. RATE Them :) **
-Thanks Vinod **Rating Encourages contributors, and its really free. **