Comment vérifier et modifier les VLAN sur un switch TP-Link JetStream 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.
Cet article montre comment vérifier les paramètres VLAN, créer et supprimer des VLAN, ainsi qu'ajouter et supprimer des ports aux VLAN, sur le commutateur TP-Link JetStream via le protocole SNMP (Simple Network Management Protocol).
1. Exigences.
Vous devez comprendre ce qui suit avant de lire ce document :
- Comment fonctionnent les VLAN et comment configurer des VLAN sur le commutateur TP-Link JetStream ? Guide officiel .
- Comment configurer SNMP v2c/v3 sur le commutateur TP-Link JetStream ? Guide officiel .
- Lire, comprendre et utiliser les MIB.
- Configurez et utilisez les commandes NET-SNMP , y compris snmpget, snmpset, snmptable, snmpwalk ou tout autre logiciel SNMP.
2. Préparatifs.
Nous décrivons ici brièvement la configuration de SNMP v2c. Pour un guide de configuration détaillé de SNMP, veuillez vous référer au guide officiel .
- Allez dans Maintenance --> SNMP --> Global Config, activez SNMP.
- Accédez à SNMP v1/v2c, ajoutez une nouvelle communauté, le nom de la communauté est tplink et le mode d'accès est Lecture et écriture.
- Net-SNMP disponible sur http://www.net-snmp.org/ Recherchez vos modèles de commutateurs TP-Link sur le site Web officiel et téléchargez le fichier MIB à partir de la page Support, puis copiez les fichiers MIB dans le dossier Net-SNMP MIB.
3. Opérations.
Toutes les commandes seront répertoriées en bleu italique et en gras. Le fichier MIB utilisé ici pour les paramètres VLAN est « tplink-vlan-dot1qVlan.mib », et l'adresse IP du commutateur ici est 192.168.0.1.
3.1 Afficher le tableau VLAN.
snmptable -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 vlanConfigTable
dot1qVlanId |
dot1qVlanDescription |
vlanTagPortMemberAjouter |
vlanUntagPortMemberAjouter |
vlanPortMembreSupprimer |
dot1qVlanStatus
|
1 |
"Système-VLAN" |
“” |
“1/0/1-28” |
“” |
active |
3.2 Créez le VLAN 100, nommez-le « VLAN100 » et ajoutez les ports de suppression 1/0/2-4.
Utilisez la commande snmpset pour définir l'ID VLAN, le nom VLAN, les ports à ajouter et l'action « createAndGo » à effectuer.
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 = ENTIER : 100
TPLINK-DOT1Q-VLAN-MIB::dot1qVlanDescription.100 = CHAINE : "VLAN100"
TPLINK-DOT1Q-VLAN-MIB::vlanUntagPortMemberAdd.100 = CHAINE : "1/0/2-4"
TPLINK-DOT1Q-VLAN-MIB::dot1qVlanStatus.100 = ENTIER : createAndGo(4)
Note:
- Le dernier numéro de l'OID est le numéro de VLAN à créer ou à supprimer.
- dot1qVlanStatus a deux actions, createAndGo (4) pour créer des VLAN et destroy (6) pour supprimer des VLAN.
- « i » pour entier, « s » pour « chaîne ».
Afficher la table VLAN et les paramètres VLAN ont été mis à jour pour prendre effet.
snmptable -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 vlanConfigTable
dot1qVlanId |
dot1qVlanDescription |
vlanTagPortMemberAjouter |
vlanUntagPortMemberAjouter |
vlanPortMembreSupprimer |
dot1qVlanStatus
|
1 |
"Système-VLAN" |
“” |
“1/0/1-28” |
“” |
active |
100 |
« VLAN100 » |
“” |
“1/0/2-4” |
“” |
active |
3.3 Supprimez le port de détag 1/0/2 du 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 = CHAINE : "1/0/2"
snmptable -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 vlanConfigTable
dot1qVlanId |
dot1qVlanDescription |
vlanTagPortMemberAjouter |
vlanUntagPortMemberAjouter |
vlanPortMembreSupprimer |
dot1qVlanStatus
|
1 |
"Système-VLAN" |
“” |
“1/0/1-28” |
“” |
active |
100 |
« VLAN100 » |
“” |
“1/0/3-4” |
“” |
active |
Le port 1/0/2 a été supprimé du VLAN 100.
3.4 Ajoutez le port de détag 1/0/5 au 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 = CHAINE : "1/0/5"
snmptable -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 vlanConfigTable
dot1qVlanId |
dot1qVlanDescription |
vlanTagPortMemberAjouter |
vlanUntagPortMemberAjouter |
vlanPortMembreSupprimer |
dot1qVlanStatus
|
1 |
"Système-VLAN" |
“” |
“1/0/1-28” |
“” |
active |
100 |
« VLAN100 » |
“” |
“1/0/3-5” |
“” |
active |
Le port 1/0/5 a été ajouté au VLAN 100.
3.5 Vérifiez l'ID du port par snmpwalk.
Chaque port a son propre ifIndex SNMP, ou vous pouvez dire l'ID du port. Pour vérifier et gérer les paramètres du port VLAN, nous devons connaître la correspondance entre les ports et les identifiants via snmpwalk.
Selon le résultat suivant, l'ID de port de GigaEthernet 1/0/1 est 49153, de GigaEthernet 1/0/2 est 49154 ……
snmpwalk -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1
RFC1213-MIB::sysDescr.0 = STRING : "Switch géré JetStream 24 ports Gigabit L2 avec 4 emplacements SFP"
……
RFC1213-MIB::ifIndex.1 = ENTIER : 1
RFC1213-MIB::ifIndex.49152 = ENTIER : 49152
RFC1213-MIB::ifIndex.49153 = ENTIER : 49153
RFC1213-MIB::ifIndex.49154 = ENTIER : 49154
RFC1213-MIB::ifIndex.49155 = ENTIER : 49155
RFC1213-MIB::ifIndex.49156 = ENTIER : 49156
RFC1213-MIB::ifIndex.49157 = ENTIER : 49157
……
RFC1213-MIB::ifDescr.1 = CHAINE : "Vlan-interface1"
RFC1213-MIB::ifDescr.49152 = CHAINE : "AUX0"
RFC1213-MIB::ifDescr.49153 = CHAINE : " gigabitEthernet 1/0/1 : cuivre "
RFC1213-MIB::ifDescr.49154 = CHAINE : " gigabitEthernet 1/0/2 : cuivre "
RFC1213-MIB::ifDescr.49155 = CHAINE : " gigabitEthernet 1/0/3 : cuivre "
RFC1213-MIB::ifDescr.49156 = CHAINE : " gigabitEthernet 1/0/4 : cuivre "
RFC1213-MIB::ifDescr.49157 = CHAINE : " gigabitEthernet 1/0/5 : cuivre "
……
3.6 Afficher le tableau des VLAN des ports.
snmptable -c tplink -v 2c -m TPLINK-DOT1Q-VLAN-MIB 192.168.0.1 vlanPortConfigTable
Table SNMP : TPLINK-DOT1Q-VLAN-MIB::vlanPortConfigTable
Numéro de port vlan |
vlanPortPvid |
vlanPortIngressCheck |
vlanPortAcceptFrameType |
vlanPortLag |
"1/0/1" |
1 |
activer |
tout |
N/A |
“1/0/2” |
1 |
activer |
tout |
N/A |
“1/0/3” |
1 |
activer |
tout |
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 Changez le port 1/0/1 PVID en 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
Table SNMP : TPLINK-DOT1Q-VLAN-MIB::vlanPortConfigTable
Numéro de port vlan |
vlanPortPvid |
vlanPortIngressCheck |
vlanPortAcceptFrameType |
vlanPortLag |
"1/0/1" |
100 |
activer |
tout |
N/A |
“1/0/2” |
1 |
activer |
tout |
N/A |
“1/0/3” |
1 |
activer |
tout |
N/A |
…… |
…… |
…… |
…… |
…… |
Est-ce que ce FAQ a été utile ?
Vos commentaires nous aideront à améliorer ce site.
Quelle est votre préoccupation avec cet article ?
- Mécontent du produit
- Trop compliqué
- Titre déroutant
- Ne s'applique pas à moi
- Trop vague
- Autre
Merci
Pour nous écrire.
Cliquer ici pour contacter le service support TP-Link.
This website uses cookies to improve website navigation, analyze online activities and have the best possible user experience on our website. You can object to the use of cookies at any time. You can find more information in our privacy policy . Don’t show again
This website uses cookies to improve website navigation, analyze online activities and have the best possible user experience on our website. You can object to the use of cookies at any time. You can find more information in our privacy policy . Don’t show again
Cookies basiques
Ces cookies sont nécessaires au fonctionnement du site Web et ne peuvent pas être désactivés dans vos systèmes.
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
Chat en direct
__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
Cookies d'analyse et marketing
Les cookies d'analyse nous permettent d'analyser vos activités sur notre site Web pour améliorer et ajuster les fonctionnalités de notre site Web.
Les cookies marketing peuvent être définis via notre site Web par nos partenaires publicitaires afin de créer un profil de vos intérêts et pour vous montrer des publicités pertinentes sur d'autres sites Web.
Google Analytics & Google Tag Manager
_gid, _ga_<container-id>, _ga, _gat_gtag_<container-id>
Google Ads et 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