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

Creating VLAN through SNMP

stasvolkhin
Level 1
Level 1

Hi!

I have Linksys SPS224

Trying to create VLAN through SNMP.

Issueing the string to create VLAN ID=100 with name "VLAN100"

snmpset -c private -v2c 10.254.2.144 .1.3.6.1.2.1.17.7.1.4.3.1.1.100 s VLAN100 .1.3.6.1.2.1.17.7.1.4.3.1.5.100 i 4

It reports

Error in packet.

Reason: (genError) A general failure occured

Failed object: iso.3.6.1.2.1.17.7.1.4.3.1.1.100

In same time changing the name of existing vlan

snmpset -c private -v2c 10.254.2.144 .1.3.6.1.2.1.17.7.1.4.3.1.1.23 s VLAN23

and even deleting the existing vlan

snmpset -c private -v2c 10.254.2.144 .1.3.6.1.2.1.17.7.1.4.3.1.1.510 i 6

are successfull.

How can I create new vlan through SNMP?

2 Replies 2

stasvolkhin
Level 1
Level 1

It's resolved.

To create VLAN it takes to point all four parameters in the thread strictly.

For VLAN 100 they are:

.1.3.6.1.2.1.17.7.1.4.3.1.1.100 s VLAN100

.1.3.6.1.2.1.17.7.1.4.3.1.2.100 x "00 40 00 C0"

.1.3.6.1.2.1.17.7.1.4.3.1.3.100 x "00 00 00 00"

.1.3.6.1.2.1.17.7.1.4.3.1.4.100 x "00 40 00 00"

And then give the command to create (4).

Finally it looks like this

snmpset -c private -v2c 10.254.2.144 .1.3.6.1.2.1.17.7.1.4.3.1.1.100 s VLAN100 .1.3.6.1.2.1.17.7.1.4.3.1.2.100 x "00 40 00 C0" .1.3.6.1.2.1.17.7.1.4.3.1.3.100 x "00 00 00 00" .1.3.6.1.2.1.17.7.1.4.3.1.4.100 x "00 40 00 00" .1.3.6.1.2.1.17.7.1.4.3.1.5.100 i 4

If takes something to change, you have to delete VLAN by issueing the command destroy (6).

snmpset -c private -v2c 10.254.2.144 .1.3.6.1.2.1.17.7.1.4.3.1.5.100 i 6

And then create again with new ones.

Stanislav,

Glad to see you got it working. I want to add a few more details to help people out who may be viewing this post.

Example 1

-----------------------------------

Create vlan 3 and add tagged 5 and untagged 7:

>snmpset -v 2c -c public 10.5.233.98 1.3.6.1.2.1.17.7.1.4.3.1.5.3 i 4 1.3.6.1.2.1.17.7.1.4.3.1.1.3 s vlan3 1.3.6.1.2.1.17.7.1.4.3.1.2.3 x 0x0a 1.3.6.1.2.1.17.7.1.4.3.1.3.3 x 0x00 1.3.6.1.2.1.17.7.1.4.3.1.4.3 x 0x0a

Port you like to add        binary number representation         hex number in SNMP should be

e1                                1000 0000 0000 0000                     0x80

e5 and e7                      0000 1010 0000 0000                    0x0A                        

SNMPv2-SMI::mib-2.17.7.1.4.3.1.5.3 = INTEGER: 4 (create and go)

SNMPv2-SMI::mib-2.17.7.1.4.3.1.1.3 = STRING: "vlan3"  (vlan name)

SNMPv2-SMI::mib-2.17.7.1.4.3.1.2.3 = Hex-STRING: 0A

SNMPv2-SMI::mib-2.17.7.1.4.3.1.3.3 = Hex-STRING: 00

SNMPv2-SMI::mib-2.17.7.1.4.3.1.4.3 = Hex-STRING: 0A

Note: If ports are in default(access) mode  - you will need to have identical values in StaticEgressPorts and in StaticUntaggedPorts - since if bit is marked only StaticEgressPorts - it means membership is tagged - and access port can't have tagged membership (or multiple membership).

Example 2

------------------

Create vlan 8 and add ports 17-24 to that vlan:

>snmpset -v 2c -c public 10.5.233.98 1.3.6.1.2.1.17.7.1.4.3.1.5.8 i 4 1.3.6.1.2.1.17.7.1.4.3.1.1.8 s vlan8 1.3.6.1.2.1.17.7.1.4.3.1.2.8 x 0x0000ff 1.3.6.1.2.1.17.7.1.4.3.1.3.8 x 0x00 1.3.6.1.2.1.17.7.1.4.3.1.4.8 x 0x0000ff

Port you like to add        binary number representation         hex number in SNMP should be

e17-24                           0000 0000 0000 0000 1111 1111    0x0000FF                  

SNMPv2-SMI::mib-2.17.7.1.4.3.1.5.8 = INTEGER: 4

SNMPv2-SMI::mib-2.17.7.1.4.3.1.1.8 = STRING: "vlan8"

SNMPv2-SMI::mib-2.17.7.1.4.3.1.2.8 = Hex-STRING: 00 00 FF

SNMPv2-SMI::mib-2.17.7.1.4.3.1.3.8 = Hex-STRING: 00

SNMPv2-SMI::mib-2.17.7.1.4.3.1.4.8 = Hex-STRING: 00 00 FF

Thanks,

Ivor