Upload
vukien
View
217
Download
1
Embed Size (px)
Citation preview
Switch CiscoConfiguration générale d’un switchATTENTION : le mode utilisé à une importance. Si la commande n’est pas exécutée dans le bon mode, elle ne fonctionnera pas !
Switch> : mode consoleSwitch > enableSwitch # : mode privilégié (à utiliser pour faire la commande SHOW)Switch # conf t ou configure terminalSwitch (config) # exit (pour revenir au mode inférieur)Switch (config) # hostname <nom>(renseigner le nom du switch)Switch (config) # hostname Sw1Sw1(config) # banner motd #texte de la bannière d’accueil#
Configuration VLANSw1(config) # vlan <numero>Sw1(config-vlan) # name <NomDuVlan>Sw1 # show vlan //vérification
Affectation Vlan à un portSw1(config) # interface <interface> (ex:fa0/1)Sw1(config-if) # switchport mode accessSw1(config-if) # switchport access vlan <numeroVlan>
Affectation d’un groupe de ports à un VlanC2(config)#interface range FastEthernet 0/1 - 20C2(config-if-range)#switchport mode accessC2(config-if-range)#switchport access vlan <numeroVlan>
Affectation Trunk à un portSw1(config) # interface <interface>Sw1(config-if) # # switchport trunk encapsulation dot1q // par défaut sur les switch 2960Sw1(config-if) # switchport mode trunk
Ajouter / supprimer un vlan sur un port trunkSw1(config-if) # switchport trunk allowed vlan add|remove <NumVlan>
Vérification du Trunk#show interfaces <interface> switchport#show interfaces trunk
Affectation d’une adresse IP à un VLAN (ex : VLAN 420) Sw1(config)# interface VLAN 420Sw1(config-if)# ip address 172.15.20.254 255.255.0.0
Diffuser les VLAN avec VTP//sur le switch serveurSw1(config)# vtp mode server Sw1(config)# vtp domain nomDuDomaineVtp
//sur les switchs clientSw1(config)# vtp mode clientSw1(config)# vtp domain nomDuDomaineVtp
//vérificationSw1# sh vtp status// Pour remettre le compteur de révision à 0, donner un nouveau nom au domaine
Agrégation de liens//sur le premier switchInterface range gig1/1 – 2Channel-group 1 mode autoEnd//sur le second switchInterface range gig1/1 – 2Channel-group 1 mode desirableEnd// vérificationSw1# show etherchannel summaryshow etherchannel port-channelshow interfaces port-channel 1
//équilibrage de chargeSwitch(config)#port-channel load-balance src-mac
//Transformer le lien en TRUNKSwitch(config)#interface port-channel 1Switch(config-if)#switchport mode trunk Switch(config-if)#switchport trunk allowed vlan 1,100,200,300Switch(config-if)#no shutdownSwitch(config-if)#exit
Supervision SNMP
Activer SNMP sur le switch en créant la communauté "public" accessible en "lecture seule"(config)# snmp-server community public ro
Activer SNMP sur le switch en créant la communauté "private" accessible en "lecture-écritue"
(config)# snmp-server community private rw
Personne à contacter et emplacement du switch
(config)# snmp-server contact
(config)# snmp-server location
Autoriser l'envoi d'alerte pour les changements de config sur le switch
(config)# snmp-server enable traps
(config)# snmp-server host Ip_console version 2c public config