How to configure VLAN (create/delete/add member ports) via SNMP ?

Steven_zhangCreated at:Dec 11, 2019 14:04:24Updated at:Dec 11, 2019 14:05:04

VLAN configuration support in standard MIB (Q-BRIDGE-MIB).

Support Model: 

ECS4620 Series, ECS4510 Series, ECS4120 Series,

ECS4100 Series, ECS4110 Series, ECS4210 Series,

ECS3510-28T/52T, ES3528MV2, ES3510MA,

ECS2100 Series, ECS2110 Series

 

a. Create/Delete VLAN in vlan database.

SNMPSET command format:

snmpset -c private -v 2c <switch ip> < dot1qVlanStaticRowStatus | dot1qVlanStaticName >.< dot1qVlanIndex > < INTEGER | STRING > <value>

===Note===

dot1qVlanStaticRowStatus = active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)

 

<Example 1>

Create VLAN10-Data, VLAN20-Multicast, and VLAN30-Other in vlan database.

(1) dot1qVlanStaticRowStatus (Integer 5 : createAndWait)

mceclip1.png

(2) dot1qVlanStaticRowStatus (Integer 1 : active)

mceclip2.png

(3) dot1qVlanStaticName (String VLAN10:Data, VLAN20:Multicast, and VLAN30:Other)

mceclip3.png

Check the result from SNMP and CLI.

mceclip4.png

mceclip5.png

mceclip6.png

mceclip7.png

mceclip8.png

 

<Example 2>

Delete VLAN30-Other in vlan database.

(1) dot1qVlanStaticRowStatus (Integer 6 : destroy)

mceclip9.png

Check the result from SNMP and CLI.

mceclip10.png

mceclip11.png

mceclip12.png

 

b. Add VLAN as member on port interface.

SNMPSET command format:

snmpset -c private -v 2c <switch ip> < dot1qVlanStaticEgressPorts | dot1qVlanStaticUntaggedPorts >.< dot1qVlanIndex > < HEX STRING > < PortList >

===Note===

PortList (Base syntax: OCTET STRING)

dot1qVlanStaticEgressPorts = 1 means port was assigned to the egress list for the VLAN; 0 means port was removed to the egress list for the VLAN.

dot1qVlanStaticUntaggedPorts = 1 means port transmits egress packets for the VLAN as untagged; 0 means port transmits egress packets for the VLAN as tagged.

 

<Example>

Configure VLAN setting on port interfaces as below.

Port1: PVID=10, VID=10(u)

Port2: PVID=1, VID=1(u), 20(t)

Port3: PVID=1, VID=1(t), 10(t), 20(t)

(1) dot1qVlanStaticEgressPorts (HEX STRING : VLAN1-7FFFFFF0, VLAN10-A0000000, VLAN20-60000000)

mceclip13.png

mceclip14.png

 

Check the result from SNMP and CLI.

mceclip15.png

mceclip16.png

 

(2) dot1qVlanStaticUntaggedPorts (HEX STRING : VLAN1-5FFFFFF0, VLAN10-80000000, VLAN20-00000000)

mceclip17.png

mceclip18.png

 

Check the result from SNMP and CLI.

mceclip19.png

mceclip20.png

 

c. Configure PVID on port interface.

SNMPSET command format:

snmpset -c private -v 2c <switch ip> < dot1qPvid >.< PortIndex > < unsigned INTEGER > < VlanIndex>

 

<Example>

Configure VLAN setting on port interfaces as below.

Port1: PVID=10, VID=10(u)

Port2: PVID=1, VID=1(u), 20(t)

Port3: PVID=1, VID=1(t), 10(t), 20(t)

(1) dot1qPvid (unsigned INTEGER : port1-VLAN10, port2-VLAN1, port3-VLAN1)

mceclip21.png

 

Check the result from SNMP and CLI.

mceclip22.png

mceclip24.png