Knowledge Base

How do I configure VLAN on MGS3520-28F via SNMP?

Question

Can you explain how to recognize, remove and add normal, fixed, forbidden, tagged, untagged ports on switch over SNMP?

Answer

Q-BRIDGE-MIB(.1.3.6.1.2.1.17.7.1.4.3) this public MIB can be used to query and modify VLANs on the Switch.

For example, the MGS3520-28F configuration as shown below table, you can use SNMP tool
 to check and modify the VLAN settings. Please note system uses hex to record the port settings.

The SNMP tools in this example are snmpwalk and snmpset. And the command is snmpset -v 2c -c < set community > < Switch IP address > < OID > < options > < value >

 

MGS3520# show running-config

 Building configuration...

 Current configuration:

vlan 1
 name 1
 normal ""
 fixed 1-28
 forbidden ""
 untagged 1-28
 ip address default-management 192.168.1.1 255.255.255.0
exit
vlan 2
 normal 2-28
 fixed 1
 forbidden ""
 untagged ""
exit
vlan 3
 normal 1,3-28
 fixed 2
 forbidden ""
 untagged ""
 inactive
exit
vlan 4
 normal 1-2,4-28
 fixed 3
 forbidden ""
 untagged ""
exit
vlan 5
 normal 1-3,5-28
 fixed 4
 forbidden ""
 untagged ""
exit
vlan 6
 normal 3-28
 fixed 1-2
 forbidden ""
 untagged ""

Exit
vlan 7
 normal 4-28
 fixed 1-3
 forbidden ""
 untagged ""
exit
vlan 8
 normal 5-28
 fixed 1-4
 forbidden ""
 untagged ""
exit
vlan 9
 normal 1-4,6-28
 fixed 5
 forbidden ""
 untagged ""
exit
vlan 10
 normal 13-28
 fixed 9-12
 forbidden 1-8
 untagged 1-12
exit
MGS3520#
 

E:\>snmpwalk -v 2c -c public 192.168.1.1 .1.3.6.1.2.1.17.7.1.4.3

SNMPv2-SMI::mib-2.17.7.1.4.3.1.1.1 = STRING: "1"   #VLAN 1 name is 1
SNMPv2-SMI::mib-2.17.7.1.4.3.1.1.2 =     #VLAN 2 has no name
SNMPv2-SMI::mib-2.17.7.1.4.3.1.1.3 =     #VLAN 3 has no name
SNMPv2-SMI::mib-2.17.7.1.4.3.1.1.4
SNMPv2-SMI::mib-2.17.7.1.4.3.1.1.5 =  
SNMPv2-SMI::mib-2.17.7.1.4.3.1.1.6
SNMPv2-SMI::mib-2.17.7.1.4.3.1.1.7
SNMPv2-SMI::mib-2.17.7.1.4.3.1.1.8 =
SNMPv2-SMI::mib-2.17.7.1.4.3.1.1.9
SNMPv2-SMI::mib-2.17.7.1.4.3.1.1.10
SNMPv2-SMI::mib-2.17.7.1.4.3.1.2.1 = Hex-STRING: FF FF FF F0 00 00 00 00     #VLAN 1 fixed port 1-28
SNMPv2-SMI::mib-2.17.7.1.4.3.1.2.2 = Hex-STRING: 80 00 00 00 00 00 00 00    #VLAN 2 fixed port 1
SNMPv2-SMI::mib-2.17.7.1.4.3.1.2.3 = Hex-STRING: 40 00 00 00 00 00 00 00   #VLAN 3 fixed port 2
SNMPv2-SMI::mib-2.17.7.1.4.3.1.2.4 = Hex-STRING: 20 00 00 00 00 00 00 00    #VLAN 4 fixed port 3
SNMPv2-SMI::mib-2.17.7.1.4.3.1.2.5 = Hex-STRING: 10 00 00 00 00 00 00 00    #VLAN 5 fixed port 4
SNMPv2-SMI::mib-2.17.7.1.4.3.1.2.6 = Hex-STRING: C0 00 00 00 00 00 00 00    #VLAN 6 fixed port 1-2
SNMPv2-SMI::mib-2.17.7.1.4.3.1.2.7 = Hex-STRING: E0 00 00 00 00 00 00 00    #VLAN 7 fixed port 1-3
SNMPv2-SMI::mib-2.17.7.1.4.3.1.2.8 = Hex-STRING: F0 00 00 00 00 00 00 00    #VLAN 8 fixed port 1-4
SNMPv2-SMI::mib-2.17.7.1.4.3.1.2.9 = Hex-STRING: 08 00 00 00 00 00 00 00    #VLAN 9 fixed port 5
SNMPv2-SMI::mib-2.17.7.1.4.3.1.2.10 = Hex-STRING: 00 F0 00 00 00 00 00 00    #VLAN 10 fixed port 9-12
SNMPv2-SMI::mib-2.17.7.1.4.3.1.3.1 = Hex-STRING: 00 00 00 00 00 00 00 00   #VLAN 1 forbidden port  “NA”
SNMPv2-SMI::mib-2.17.7.1.4.3.1.3.2 = Hex-STRING: 00 00 00 00 00 00 00 00   #VLAN 2 forbidden port  “NA”
SNMPv2-SMI::mib-2.17.7.1.4.3.1.3.3 = Hex-STRING: 00 00 00 00 00 00 00 00 
SNMPv2-SMI::mib-2.17.7.1.4.3.1.3.4 = Hex-STRING: 00 00 00 00 00 00 00 00   
SNMPv2-SMI::mib-2.17.7.1.4.3.1.3.5 = Hex-STRING: 00 00 00 00 00 00 00 00 
SNMPv2-SMI::mib-2.17.7.1.4.3.1.3.6 = Hex-STRING: 00 00 00 00 00 00 00 00 
SNMPv2-SMI::mib-2.17.7.1.4.3.1.3.7 = Hex-STRING: 00 00 00 00 00 00 00 00   
SNMPv2-SMI::mib-2.17.7.1.4.3.1.3.8 = Hex-STRING: 00 00 00 00 00 00 00 00   
SNMPv2-SMI::mib-2.17.7.1.4.3.1.3.9 = Hex-STRING: 00 00 00 00 00 00 00 00 
SNMPv2-SMI::mib-2.17.7.1.4.3.1.3.10 = Hex-STRING: FF 00 00 00 00 00 00 00   #VLAN 10 forbidden port  1-8
SNMPv2-SMI::mib-2.17.7.1.4.3.1.4.1 = Hex-STRING: FF FF FF F0 00 00 00 00    #VLAN 1 untagged port 1-28
SNMPv2-SMI::mib-2.17.7.1.4.3.1.4.2 = Hex-STRING: 00 00 00 00 00 00 00 00    #VLAN 2 untagged port “NA”
SNMPv2-SMI::mib-2.17.7.1.4.3.1.4.3 = Hex-STRING: 00 00 00 00 00 00 00 00 
SNMPv2-SMI::mib-2.17.7.1.4.3.1.4.4 = Hex-STRING: 00 00 00 00 00 00 00 00    
SNMPv2-SMI::mib-2.17.7.1.4.3.1.4.5 = Hex-STRING: 00 00 00 00 00 00 00 00    
SNMPv2-SMI::mib-2.17.7.1.4.3.1.4.6 = Hex-STRING: 00 00 00 00 00 00 00 00    
SNMPv2-SMI::mib-2.17.7.1.4.3.1.4.7 = Hex-STRING: 00 00 00 00 00 00 00 00  
SNMPv2-SMI::mib-2.17.7.1.4.3.1.4.8 = Hex-STRING: 00 00 00 00 00 00 00 00  
SNMPv2-SMI::mib-2.17.7.1.4.3.1.4.9 = Hex-STRING: 00 00 00 00 00 00 00 00    
SNMPv2-SMI::mib-2.17.7.1.4.3.1.4.10 = Hex-STRING: FF F0 00 00 00 00 00 00    #VLAN 10 untagged port 1-12
SNMPv2-SMI::mib-2.17.7.1.4.3.1.5.1 = INTEGER: 1   #1 = active
SNMPv2-SMI::mib-2.17.7.1.4.3.1.5.2 = INTEGER: 1
SNMPv2-SMI::mib-2.17.7.1.4.3.1.5.3 = INTEGER: 2   #2 = inactive
SNMPv2-SMI::mib-2.17.7.1.4.3.1.5.4 = INTEGER: 1
SNMPv2-SMI::mib-2.17.7.1.4.3.1.5.5 = INTEGER: 1
SNMPv2-SMI::mib-2.17.7.1.4.3.1.5.6 = INTEGER: 1
SNMPv2-SMI::mib-2.17.7.1.4.3.1.5.7 = INTEGER: 1
SNMPv2-SMI::mib-2.17.7.1.4.3.1.5.8 = INTEGER: 1
SNMPv2-SMI::mib-2.17.7.1.4.3.1.5.9 = INTEGER: 1
SNMPv2-SMI::mib-2.17.7.1.4.3.1.5.10 = INTEGER: 1
 



The ways to create and modify the VLAN settings via SNMP are the same, as shown below.
For example, create VLAN 100 on the MGS3520-28 and then fixed port 10-12, untagged port 11, forbidden port 12 by snmp-net commands.
 

E:\>snmpset -v 2c -c 1234 192.168.1.1 .1.3.6.1.2.1.17.7.1.4.3.1.5.100 i 4  <~4 = create and go, system will also auto add a name “VLAN100” for this VLAN
E:\>snmpset -v 2c -c 1234 192.168.1.1 .1.3.6.1.2.1.17.7.1.4.3.1.2.100 x "00 70 00 00 00 00 00 00 00"  x=hex
E:\>snmpset -v 2c -c 1234 192.168.1.1 .1.3.6.1.2.1.17.7.1.4.3.1.4.100 x "00 20 00 00 00 00 00 00 00"
E:\>snmpset -v 2c -c 1234 192.168.1.1 .1.3.6.1.2.1.17.7.1.4.3.1.3.100 x "00 10 00 00 00 00 00 00 00"
 


By the way, speaking from our experience, we do not recommend modifying the VLAN settings via SNMP as sure that users will make mistakes.

 



YES NO

Please leave your comment:

SUBMIT

Question Profile

LANGUAGE:
ARTICLE ID:017858
TYPE:General Info
FIRMWARE:All
VIEWS:711
VOTES:1
TECHNOLOGY:
MODEL:MGS3520-28F

Still have trouble with your device? Contact Zyxel technology support team directly!

Contact Zyxel Support