Les principales commandes pour les Switchs Netgear
- Mise à jour le 27 juin 2024
Configuration
- Modèles de switch : Netgear M4300-28G, GS724TPv2
Commandes
- Passer en exec (priviligié) :
Switch> enable
- Passer en mode config :
Switch# configure
- Afficher des informations sur le firmware, numéro de série et matériel :
Switch# show version
- Changer le nom du switch :
Switch(config)# hostname Switch
- Sauvegarder la configuration (M4300-28G):
Switch# copy system:running-config nvram:startup-config
- Sauvegarder la configuration (GS724TPv2):
Switch# copy running-config startup-config
- Paramétrer l'adresse ip du switch :
Switch(config)# interface vlan1
ip address 192.168.1.100 /24
- Ajouter l'adresse ip de la passerelle par défaut :
Switch(config)# ip default-gateway 192.168.1.254
- Paramétrer le dns :
Switch(config)# ip name server 80.67.169.12
- Redémarrer :
Switch# reload
- Configurer plusieurs interfaces :
Switch(config)# interface 1/0/1-1/0/4
- Paramétrer la bannière :
Switch(config)# set clibanner "Access to this device is prohibited
Enter a banner message. End with the '"' symbol.
"
Utilisateurs
- Supprimer l'utilisateur guest :
Switch(config)# no username guest
- Paramétrer le mot de passe pour l'utilisateur admin :
Switch(config)# username admin password "password"
- Afficher les utilisateurs :
Switch# show users
SSH
- Générer les clés rsa et dsa :
Switch(config)# crypto key generate rsa
Switch(config)# crypto key generate dsa
- Activer le service ssh :
Switch(config)# ip ssh server enable
VLAN
M4300-28G
- Créer un VLAN :
Switch(config)# vlan database
Switch(config-vlan)# vlan 20
Switch(config-vlan)# vlan name 20 ToIP
Switch(config-vlan)# vlan pvid 20
- Paramétrer le mode access VLAN pour les interfaces 1 à 4 :
Switch(config)# interface 1/0/1-1/0/4
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 20
- Configurer une interface en mode Trunk :
Switch(config)# interface 1/0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 1,20
GS724TPv2
- Create a VLAN:
Switch(config)# vlan 10
Switch(config-vlan)# name ToIP
- Set the access VLAN to an interface:
Switch(config)# interface g2
Switch(config-if)# switchport hybrid pvid 10
Switch(config-if)# switchport hybrid allowed vlan add 10 untagged
Switch(config-if)# switchport hybrid allowed vlan remove 1
- Configure the allowed VLANs to an interface (Trunk):
Switch(config)# interface g24
Switch(config-if)# hybrid allowed vlan add 10 tagged
STP
- Activer le mode RSTP :
Switch(config)# spanning-tree mode rstp
- Définir le bridge priority :
Switch(config)# spanning-tree mst priority 0 4096