Switch CISCO
Pour aller sur le switch et le paramétrer, utiliser le logiciel "Putty".
Cliquer sur Serial, puis OK.
Quand nous utilisons HyperTerminal, mettre port 1 et parametres par défaut.
Commandes de base:
‘Mode Privilege:
en
Renommer Switch:
switch # configure terminal
switch (config) # hostname MYSWITCH
MYSWITCH (config) # end
Accéder au switch via port console:
switch # configure terminal
switch (config) # line console 0
switch (config-line) # Password (Taper le MDP)
switch (config-line) # login
Passer la configuration actuelle en configuration de démarrage:
copy running-config startup-config
Taper sur "entrer”
Effacer la configuration initial du switch:
switch # erase star
Encrypter le mot de passe console:
service password-encryption
Pour entrer un MDP qui sera secret et qui ne s'affichera pas:
enable secret
Afficher et éditer fichier de configuration courante:
sh runCréation d’une banniére motd:
banner motd ¢ (entrer message, pour quitter faire « ctrl » + « ¢»
Créer mot de passe non crypté:
conf t
enable password "Password"
end
Securisez l'accés au mode Enable:
switch # configure terminal
switch # enable Secret MDP
Supprimer le fichier Startup-config:
switch # erase startup-config
Taper sur "entrer" 2 reprises.
Configurer accés telnet:
line vty 05 (Car nous
password "Taper MDP"
login
ulons 6 connexions ( Le 0 compte comme 1) )
Redémarrer equipement:
Reload
Passer en mode configuration assisté:
Setup
Pour ping une adresse:
Ping @LP (@IP du destinataire)
Affiche la configuration en NVRAM:
sh star
Donne toutes les commandes show disponibles:
show?Pour communiquer entre le switch et le PC via telnet :
Brancher cable Réseau entre les 2, activer le bon VLAN.
Ouvrir emd windows, taper: pkgmgr /iu: TelnetClient
ensuite taper (cle! Taper open "@ LP du Switch’ et se loger avec les identifiants du
switch.
Commandes Spécifiques pour VLAN:
vlan par default ou tout est affecté par défaut
vlan natif permet encapsulation dotlq
vlan de gestion pour attaquer différente interface virtuelle des switch
Configuration VLAN:
Méthode 0.
Création du VLA:
switch # vlan database
switch # (vlan) # vlan "Numéro du VLAN" name "Nom du VLAN"
Affectation des ports au VLAN:
switch # conf t
switch (config) # interface fastethernet 0/1 (Commande raccourcie: int fa 0/1) (0/1 le 1 =
Ie n° du port auquel nous voulons l'attribbuer)
switch (config-if) # switchport mode access (Commande raccourcie: sw mode access)
switch (config-if) # switchport access vlan Numéro du VLAN" (Commande raccourcie:
sw access VLAN "Numéro du Vian")
switch (config-if) # exit
Méthode 02:
Création du VLAD
switch # conf t
switch (config) # vlan Numéro du VLAN"
switch (config) # name Nom du VLAN"
switch (config) # exitAffectation des ports au VLAN:
switch # conf t
switeh (config) # interface fastethernet 0/1 (Commande raccourcie: int fa 0/1) (0/1 le 1 =
Jen? du port auquel nous voulons I'attribbuer)
switch (config-i) # switehport mode access (Commande raccourei
sw mode access)
switch (config-if) # switchport access vlan "Numéro du VLAN" (Commande raccourcie:
sw access VLAN "Numéro du Vian")
switch (config-if) # «
Créer un VLAN:
Conf t
Vian "numéro du VLAN"
name "Nom du VLAN"
exit
Configurer un VLAN:
Vian "son numéro"
Afficher les VLAN existant:
Show vlan
Afficher le fichier VIan.dat:
sh flash
Afficher @ IP VLAN:
sh ip int vlan "Numéro VLAN"
Attribuer @IP et MSR sur un Vian:
conf t
int vlan "Numéro du VLAN"
ip address "@IP" "MSR"
Activer VLAN:
conf t
int vlan "Numéro du VLAN"
no shut
endDésactiver un VLAN:
conft
int vlan "son numéro"
shut
Modifier VLAN:
vlan "Numéro du VLAN"
Supprimer le fichier Vlan.dat:
switch # delete vlan.dat
Taper sur "entrer" a2 reprises.
Supprimer un VLAN:
no vlan "Numéro du VLAN"
Voir @ IP d'une vlan :
Show jp in vlan "son numéro"
Affecter plusieur ports a un VLAN:
switch# conf t
switch(config)# int range fa 0/" Ler port a affecter" - "dernier port a affecter" (ex pour
port de 1 a 5: fa 0/1 -5)
switch(config-if-range)# switchport access vian "numéro vlan a affecter)
switch (config-if-range}# exit
Faire devenir un VLAN en VLAN natif (Cet exemple montre comment definir VLAN 3
comme port de réseau natif):
switch # conf t
switch (config) # int fa0/1
switch (config-if) # switchport trunk native vlan 3
switch (config-if) #
(pour voir si vlan est bien natif faire "Sh run")Attribuer passerelle par défault:
switch(config)#vlan 2
switch(config-vlan)#exit
switch(config)#interface vlan2
switch(config-iN#ip address 192.168.100.25 255.255.255.0
switch(config)ip default-gateway 192.168.100.1
‘Mette un port en Trunk:
conf t
int fa 0/"numéro du port"
switch mode trunk
Mettre plusieurs liens en Trunk :
switch# conf t
switch(config)# int range fa 0/" ler port a affecter" - "dernier port a affecter" (ex pour
port de 1a 5: fa 0/1 - 5)
switch(config-if-range)# switchport mode trunk
Filtrer VLAN sur port uplink:
switch(config)#interface gigabitEthernet 1/0/1
switch (config-if)#switchport trunk allowed vlan add 2,3,10
Interdire un vlan de passer par le lien trunk (dans l'exemple, le vlan3):
Switch (config-if}#switchport trunk allowed vlan remove 3
Pour supprimer la commande de filtrage:
switch (config-if#no switchport trunk allowed vlan
switch (config-i#Configuration d'un vian dédié a la téléphonie :
switeh (config)#vlan 10
switch (config-vlan)#name voip
switch (config-vlan)#ex
switch (config)#int fastEthernet 0/1
switch config)#switchport voice vlan 10
Suppression de la configuration d'un port :
switch (config)#int fastEthernet 0/1
switch (config-if#no switchport access van
switch (config-if}#no switchport mode ace
switch(config-i}#end
Commandes pour serveur VTP:
Configurer serveur VIP:
Conf t
vtp mode server
vtp domain "Nom du domaine" (Attention domaine sensible a la casse)
vip password "Password"
Activer VIP 2:
switch# conf t
switch(config)#vtp version 2
Activer VTP pruning:
switch#conf t
switch(config)#vtp pruning Pruning switched on
Pour définir mot de passes sur tous les switch du domaine :
SW1(config)#vtp password CISCO
Pour retirer mot de passe:
SW1(configy#no vtp password Clearing device VLAN database password.
Voir statut vtp:
sh vtp statusVoir password du vt
sh vtp password
Configurer les interconnexions entant que liens Trunk :
Switch>enable
Switch#configure terminal
Switch(config)#interface {type d'interface} [numéro d’interface]
Switch (config-if}# switchport mode trunk
Cette manipulation est a répéter sur chaque interface servant d'interconnexion. Pour
vérifier Ia bonne configuration vous pouvez la commande suivante :
Switch#show interfaces trunk
Configurer les serveurs VIP:
Switch>enable
Switch#configure terminal
Switch(config)#vtp domain google.fr
Switch(config)#vtp password. “MDP*
Switch(config)#vtp version 2
Switch(config)#vtp mode server
Cette manipulation est a répéter sur chaque switch servant de serveur VTP. Pour
verifier la bonne configuration vous pouvez la commande suivante :
Switch#show vtp status
Configurer les clients VTP:
Switch>enable
Switch#configure terminal
Switch(config)#vtp domain google.fr
Switch(config)#vtp password “MDP“
Switch(config)#vtp version 2
Switch(config)#vtp mode client
Cette manipulation est a repéter sur chaque switch servant de client VIP. Pour verifier
Ja bonne configuration vous pouvez la commande suivante:
Switch#show vtp statusConfigurer le transparent VIP:
Switch>enable
Switch#configure terminal
Switch(config)#vtp domain webtutos.fr
Switch(config)#vtp password webtutos
Switch(config)#vtp version 2
Switch(config)#vtp mode transparent
Pour verifier Ia bonne configuration vous pouvez la commande suivante :
Switch#show vtp status
Ajouter les VLANs au serveur VTP princip:
Switch>enable
Switch#configure terminal
Jan}#vian 10
Namur Jordan