How to check and modify VLANs on a TP-Link JetStream switch via SNMP

TL-SG2008P , SG2428LP , Festa FS308GP , SX3008F , SG3428MP , SG3428X , SG3452P , SX3016F , TL-SG2210P , SG2428P , SG2008P , SG2210MP , TL-SX3008F , TL-SG3428 , TL-SG2218 , SG2210P , TL-SX3016F , S4500-8G , SG2218 , SG3428 , TL-SG3452P , TL-SG3428X , S5500-8MHP2XF , TL-SG3428MP , S4500-8GHP2F , TL-SG2008 , S4500-16G2F , TL-SG2210MP , TL-SG3210 , TL-SG3452 , SG3210 , SG3452 , Festa FS310GP , TL-SG3210XHP-M2 , S5500-24GP4XF , SG3428XMP , TL-SG2428P , TL-SG3428XMP
Recent updates may have expanded access to feature(s) discussed in this FAQ. Visit your product's support page, select the correct hardware version for your device, and check either the Datasheet or the firmware section for the latest improvements added to your product. Please note that product availability varies by region, and certain models may not be available in your region.
This article demonstrates how to check VLAN settings, create and delete VLANs, as well as add and remove ports to VLANs, on the TP-Link JetStream switch via the Simple Network Management Protocol (SNMP).
1. Requirements.
You should understand the following before reading this document:
- How do VLANs work and how to set up VLANs on TP-Link JetStream switch? Official Guide.
- How to set up SNMP v2c/v3 on TP-Link JetStream switch? Official Guide.
- Reading, understanding, and using MIBs.
- Configure and use NET-SNMP commands, including snmpget, snmpset, snmptable, snmpwalk, or other SNMP software.
2. Preparations.
Here we briefly describe the configuration of SNMP v2c. For a detailed Configuration Guide of SNMP, please refer to the Official Guide.
- Go to Maintenance --> SNMP --> Global Config, enable SNMP.
- Go to SNMP v1/v2c, add a new community, the Community name is tplink, and the Access Mode is Read & Write.
- Net-SNMP available at http://www.net-snmp.org/ Search your TP-Link switch models from the official website and download the MIBs file from the Support page, then copy the MIBs files to Net-SNMP MIBs folder.
3. Operations.
All commands will be listed in blue italics and bold. MIBs file used here for VLAN settings is “tplink-vlan-dot1qVlan.mib”, and the switch IP address here is 192.168.0.1.
3.1 Show VLAN table.
snmptable -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 vlanConfigTable
dot1qVlanId |
dot1qVlanDescription |
vlanTagPortMemberAdd |
vlanUntagPortMemberAdd |
vlanPortMemberRemove |
dot1qVlanStatus
|
1 |
“System-VLAN” |
“” |
“1/0/1-28” |
“” |
active |
3.2 Create VLAN 100, name it “VLAN100”, and add untag ports 1/0/2-4.
Use the snmpset command to set the VLAN ID, VLAN Name, ports to be added, and the action “createAndGo” to be performed.
snmpset -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 dot1qVlanId.100 i 100 dot1qVlanDescription.100 s VLAN100 vlanUntagPortMemberAdd.100 s 1/0/2-4 dot1qVlanStatus.100 i 4
TPLINK-DOT1Q-VLAN-MIB::dot1qVlanId.100 = INTEGER: 100
TPLINK-DOT1Q-VLAN-MIB::dot1qVlanDescription.100 = STRING: "VLAN100"
TPLINK-DOT1Q-VLAN-MIB::vlanUntagPortMemberAdd.100 = STRING: "1/0/2-4"
TPLINK-DOT1Q-VLAN-MIB::dot1qVlanStatus.100 = INTEGER: createAndGo(4)
Note:
- The last number in the OID is the VLAN number to be created or deleted.
- dot1qVlanStatus has two actions, createAndGo (4) for creating VLANs and destroy (6) for deleting VLANs.
- “i” for integer, “s” for “String”.
Show VLAN table, and the VLAN settings have been updated to take effect.
snmptable -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 vlanConfigTable
dot1qVlanId |
dot1qVlanDescription |
vlanTagPortMemberAdd |
vlanUntagPortMemberAdd |
vlanPortMemberRemove |
dot1qVlanStatus
|
1 |
“System-VLAN” |
“” |
“1/0/1-28” |
“” |
active |
100 |
“VLAN100” |
“” |
“1/0/2-4” |
“” |
active |
3.3 Remove untag port 1/0/2 from VLAN 100.
snmpset -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 vlanPortMemberRemove.100 s 1/0/2
TPLINK-DOT1Q-VLAN-MIB::vlanPortMemberRemove.100 = STRING: "1/0/2"
snmptable -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 vlanConfigTable
dot1qVlanId |
dot1qVlanDescription |
vlanTagPortMemberAdd |
vlanUntagPortMemberAdd |
vlanPortMemberRemove |
dot1qVlanStatus
|
1 |
“System-VLAN” |
“” |
“1/0/1-28” |
“” |
active |
100 |
“VLAN100” |
“” |
“1/0/3-4” |
“” |
active |
Port 1/0/2 has been removed from VLAN 100.
3.4 Add untag port 1/0/5 to VLAN 100.
snmpset -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 vlanUntagPortMemberAdd.100 s 1/0/5
TPLINK-DOT1Q-VLAN-MIB::vlanUntagPortMemberAdd.100 = STRING: "1/0/5"
snmptable -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 vlanConfigTable
dot1qVlanId |
dot1qVlanDescription |
vlanTagPortMemberAdd |
vlanUntagPortMemberAdd |
vlanPortMemberRemove |
dot1qVlanStatus
|
1 |
“System-VLAN” |
“” |
“1/0/1-28” |
“” |
active |
100 |
“VLAN100” |
“” |
“1/0/3-5” |
“” |
active |
Port 1/0/5 has been added to VLAN 100.
3.5 Check Port ID by snmpwalk.
Each port has its own SNMP ifIndex, or you can say the Port ID. To check and manage the port VLAN settings, we need to know the correspondence between the ports and IDs through snmpwalk.
According to the following result, the port ID of GigaEthernet 1/0/1 is 49153, of GigaEthernet 1/0/2 is 49154 ……
snmpwalk -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1
RFC1213-MIB::sysDescr.0 = STRING: "JetStream 24-Port Gigabit L2 Managed Switch with 4 SFP Slots"
……
RFC1213-MIB::ifIndex.1 = INTEGER: 1
RFC1213-MIB::ifIndex.49152 = INTEGER: 49152
RFC1213-MIB::ifIndex.49153 = INTEGER: 49153
RFC1213-MIB::ifIndex.49154 = INTEGER: 49154
RFC1213-MIB::ifIndex.49155 = INTEGER: 49155
RFC1213-MIB::ifIndex.49156 = INTEGER: 49156
RFC1213-MIB::ifIndex.49157 = INTEGER: 49157
……
RFC1213-MIB::ifDescr.1 = STRING: "Vlan-interface1"
RFC1213-MIB::ifDescr.49152 = STRING: "AUX0"
RFC1213-MIB::ifDescr.49153 = STRING: "gigabitEthernet 1/0/1 : copper"
RFC1213-MIB::ifDescr.49154 = STRING: "gigabitEthernet 1/0/2 : copper"
RFC1213-MIB::ifDescr.49155 = STRING: "gigabitEthernet 1/0/3 : copper"
RFC1213-MIB::ifDescr.49156 = STRING: "gigabitEthernet 1/0/4 : copper"
RFC1213-MIB::ifDescr.49157 = STRING: "gigabitEthernet 1/0/5 : copper"
……
3.6 Show port VLAN Table.
snmptable -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 vlanPortConfigTable
SNMP table: TPLINK-DOT1Q-VLAN-MIB::vlanPortConfigTable
vlanPortNumber |
vlanPortPvid |
vlanPortIngressCheck |
vlanPortAcceptFrameType |
vlanPortLag |
"1/0/1" |
1 |
enable |
all |
N/A |
“1/0/2” |
1 |
enable |
all |
N/A |
“1/0/3” |
1 |
enable |
all |
N/A |
…… |
…… |
…… |
…… |
…… |
snmpwalk -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 vlanPortPvid
TPLINK-DOT1Q-VLAN-MIB::vlanPortPvid.49153 = INTEGER: 1
TPLINK-DOT1Q-VLAN-MIB::vlanPortPvid.49154 = INTEGER: 1
TPLINK-DOT1Q-VLAN-MIB::vlanPortPvid.49155 = INTEGER: 1
……
3.7 Change port 1/0/1 PVID to VLAN 100.
snmpset -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 vlanPortPvid.49153 i 100
TPLINK-DOT1Q-VLAN-MIB::vlanPortPvid.49153 = INTEGER: 100
snmptable -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 vlanPortConfigTable
SNMP table: TPLINK-DOT1Q-VLAN-MIB::vlanPortConfigTable
vlanPortNumber |
vlanPortPvid |
vlanPortIngressCheck |
vlanPortAcceptFrameType |
vlanPortLag |
"1/0/1" |
100 |
enable |
all |
N/A |
“1/0/2” |
1 |
enable |
all |
N/A |
“1/0/3” |
1 |
enable |
all |
N/A |
…… |
…… |
…… |
…… |
…… |
Related FAQs
¿Es útil esta pregunta frecuente?
Sus comentarios nos ayudan a mejorar este sitio.
What’s your concern with this article?
- Dissatisfied with product
- Too Complicated
- Confusing Title
- Does not apply to me
- Too Vague
- Other
Gracias
Agradecemos sus comentarios.
Haga clic aquí para comunicarse con el soporte técnico de TP-Link.
Este sitio web utiliza cookies para mejorar la navegación en el sitio web, analizar las actividades en línea y tener la mejor experiencia de usuario posible en nuestro sitio web. Puedes oponerte al uso de cookies en cualquier momento. Puede encontrar más información en nuestra política de privacidad . No volver a mostrar
Este sitio web utiliza cookies para mejorar la navegación en el sitio web, analizar las actividades en línea y tener la mejor experiencia de usuario posible en nuestro sitio web. Puedes oponerte al uso de cookies en cualquier momento. Puede encontrar más información en nuestra política de privacidad . No volver a mostrar
Basic Cookies
These cookies are necessary for the website to function and cannot be deactivated in your systems.
TP-Link
accepted_local_switcher, tp_privacy_base, tp_privacy_marketing, tp_smb-select-product_scence, tp_smb-select-product_scenceSimple, tp_smb-select-product_userChoice, tp_smb-select-product_userChoiceSimple, tp_smb-select-product_userInfo, tp_smb-select-product_userInfoSimple, tp_top-banner, tp_popup-bottom, tp_popup-center, tp_popup-right-middle, tp_popup-right-bottom, tp_productCategoryType
Livechat
__livechat, __lc2_cid, __lc2_cst, __lc_cid, __lc_cst, CASID
Youtube
id, VISITOR_INFO1_LIVE, LOGIN_INFO, SIDCC, SAPISID, APISID, SSID, SID, YSC, __Secure-1PSID, __Secure-1PAPISID, __Secure-1PSIDCC, __Secure-3PSID, __Secure-3PAPISID, __Secure-3PSIDCC, 1P_JAR, AEC, NID, OTZ
Analysis and Marketing Cookies
Analysis cookies enable us to analyze your activities on our website in order to improve and adapt the functionality of our website.
The marketing cookies can be set through our website by our advertising partners in order to create a profile of your interests and to show you relevant advertisements on other websites.
Google Analytics & Google Tag Manager
_gid, _ga_<container-id>, _ga, _gat_gtag_<container-id>
Google Ads & DoubleClick
test_cookie, _gcl_au
Meta Pixel
_fbp
Crazy Egg
cebsp_, _ce.s, _ce.clock_data, _ce.clock_event, cebs
lidc, AnalyticsSyncHistory, UserMatchHistory, bcookie, li_sugr, ln_or