3
Switch Cisco Configuration générale d’un switch ATTENTION : le mode utilisé à une importance. Si la commande n’est pas exécutée dans le bon mode, elle ne fonctionnera pas ! Switch> : mode console Switch > enable Switch # : mode privilégié (à utiliser pour faire la commande SHOW) Switch # conf t ou configure terminal Switch (config) # exit (pour revenir au mode inférieur) Switch (config) # hostname <nom>(renseigner le nom du switch) Switch (config) # hostname Sw1 Sw1(config) # banner motd #texte de la bannière d’accueil# Configuration VLAN Sw1(config) # vlan <numero> Sw1(config-vlan) # name <NomDuVlan> Sw1 # show vlan //vérification Affectation Vlan à un port Sw1(config) # interface <interface> (ex:fa0/1) Sw1(config-if) # switchport mode access Sw1(config-if) # switchport access vlan <numeroVlan> Affectation d’un groupe de ports à un Vlan C2(config)#interface range FastEthernet 0/1 - 20 C2(config-if-range)#switchport mode access C2(config-if-range)#switchport access vlan <numeroVlan> Affectation Trunk à un port Sw1(config) # interface <interface> Sw1(config-if) # # switchport trunk encapsulation dot1q // par défaut sur les switch 2960 Sw1(config-if) # switchport mode trunk Ajouter / supprimer un vlan sur un port trunk Sw1(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 420

Web viewSwitch Cisco. Configuration générale d’un switch. ATTENTION : le mode utilisé à une importance. Si la commande n’est pas exécutée dans le bon

  • Upload
    vukien

  • View
    217

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Web viewSwitch Cisco. Configuration générale d’un switch. ATTENTION : le mode utilisé à une importance. Si la commande n’est pas exécutée dans le bon

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

Page 2: Web viewSwitch Cisco. Configuration générale d’un switch. ATTENTION : le mode utilisé à une importance. Si la commande n’est pas exécutée dans le bon

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