Le système d exploitation du routeur Ou IOS Patrice CLEMENT Page 1 sur 11
Les modes du commutateur ou du routeur Le mode utilisateur - Le mode privilégié - Le mode global - Les modes spécifiques - Interface, - Sous-interface, - Ligne, - Router, - Dhcp Plusieurs autres modes de configuration sont aussi possibles Les commandes CLI Cisco introduit différents groupes de commandes, ils sont fonction du niveau : - De responsabilité de l opérateur, - De technicité à mettre en œuvre, - De l interface à configurer. Chaque niveau est caractérisé par un caractère ou une chaîne de caractères indiquant un prompt différent. La hiérarchie des commandes Le mode de configuration et son prompt : Interface Router_Paris (config-if) # SubInterface Router_Paris (config-subif) # Controller Router_Paris (config-controller) # Line Router_Paris (config-line) # Router Router_Paris (config-router) # Ipx Router Router_Paris (config-ipx-router) # Patrice CLEMENT Page 2 sur 11
Commandes pour les VLANs 1 ) Effacer le contenu du fichier de démarrage s il n est pas vide. Switch >enable Switch > Switch # Show startup-config Switch # Switch# erase startup-config The responding line prompt will be: Erasing the nvram filesystem will remove all files! Continue? [confirm] Press Enter to confirm. The response should be: Erase of nvram: complete Switch# 2 ) Effacer le fichier de configuration des vlans s il n est pas vide Switch # Show flash: Switch # Show flash://vlan.dat Switch# show vlan Switch# show vlan brief Switch# Switch# delete flash:vlan.dat Delete filename [vlan.dat]?[enter] Delete flash:vlan.dat? [confirm] [Enter] Si le fichier n existe pas, ce message est affiché : %Error deleting flash:vlan.dat (No such file or directory) 3 ) Redémarrer le commutateur Switch #reload Patrice CLEMENT Page 3 sur 11
4 ) Vérifier la valeur du fichier de configuration, la taille de la mémoire DRAM, de la mémoire flash et de la mémoire nvram si elle existe Switch # show version 5 ) Analyser vos fichiers de configuration Le fichier en cours : Switch# show running-config Building configuration... Current configuration : 863 bytes! version 12.1 no service password-encryption! hostname Switch!! Le fichier de démarrage : Switch# show startup-config startup-config is not present Les messages d erreur du cli %Ambiguous command %Imcomplete command Manque de paramètres à la commande %Invalid input detected at ^ marker. Vous n avez pas assez entré de caractères pour que l ios reconnaisse la commande Vous n avez pas assez entré de mots clés ou de valeurs exigées par cette commande. Les messages d erreur du cli La commande est incorrecte, le caret vous indique la position où se trouve cette erreur Patrice CLEMENT Page 4 sur 11
6 ) Configuration de base (Le commutateur gauche) Donner un nom à cet appareil Donner le mot de passe secret (Protéger le passage du mode user (>) au mode privilégié (#) Donner le mot de passe console Donner le mot de passe du terminal virtuel Donner le mot de passe du port auxiliaire Sauver votre configuration Donner un nom à cet appareil Switch >enable Switch # configure terminal Switch (config) # hostname Sw_Lyon Sw_Lyon (config) # exit Sw_Lyon # exit Sw_Lyon > Patrice CLEMENT Page 5 sur 11
Un peu d aide Sw_Lyon >? Sw_Lyon #? Patrice CLEMENT Page 6 sur 11
Sw_Lyon # conf? Sw_Lyon (config) # line vty 0? Sw_Lyon >enable Donner le mot de passe secret (Protéger le passage du mode user (>) au mode privilégié (#) Sw_Lyon (config) # Sw_Lyon (config) # enable password cisco Sw_Lyon (config) # enable secret class Donner le mot de passe console Sw_Lyon (config) # line console 0 Sw_Lyon (config-line) # login Sw_Lyon (config-line) # password Sw_Lyon (config-line) # exit Sw_Lyon (config) # cisco Donner le mot de passe du terminal virtuel Sw_Lyon (config) # line vty 0 4 Sw_Lyon (config-line) # login Sw_Lyon (config-line) # password cisco Sw_Lyon (config-line) # exit Sw_Lyon (config) # Donner le mot de passe du port auxiliaire Sw_Lyon (config) # line aux 0 Sw_Lyon (config-line) # login Sw_Lyon (config-line) # password cisco Sw_Lyon (config-line) # exit Sw_Lyon (config) # Sauver votre configuration Sw_Lyon (config) # exit Sw_Lyon # show running-config Sw_Lyon # show startup-config Sw_Lyon # copy running-config startup-config Sw_Lyon # show startup-config Sw_Lyon # exit Sw_Lyon > Patrice CLEMENT Page 7 sur 11
7 ) Faire descendre ou monter les interfaces fastethernet Descendre une interface Sw_Lyon (config)#interface fastethernet 0/18 Sw_Lyon (config-if)# shutdown Sw_Lyon (config-if)# ^Z Sw_Lyon # Monter une interface Sw_Lyon (config)#interface fastethernet 0/18 Sw_Lyon (config-if)# no shutdown Sw_Lyon (config-if)# ^Z Sw_Lyon # Descendre des interfaces regroupées Sw_Lyon (config)#interface range fastethernet 0/1-0/24 Sw_Lyon (config-if)# shutdown Sw_Lyon (config-if)# ^Z Sw_Lyon # Descendre certaines interfaces Sw_Lyon (config)# interface range fastethernet fa0/6, fa0/11, fa0/18 Sw_Lyon (config-if)# shutdown Sw_Lyon (config-if)# ^Z Sw_Lyon # Sauver votre configuration Sw_Lyon # show running-config Sw_Lyon # show startup-config Sw_Lyon # copy running-config startup-config Sw_Lyon # show startup-config Patrice CLEMENT Page 8 sur 11
8 ) Interdire la recherche du DNS Sw_Lyon (config)# no domain-lookup 9 ) Configurer le protocole VTP Sw_Lyon (config)# vtp mode server Device mode already VTP SERVER. Sw_Lyon (config)# vtp domain Labo Changing VTP domain name from NULL to Labo Sw_Lyon (config)# vtp password cisco Setting device VLAN database password to cisco Sw_paris > enable Sw_ paris # configure terminal Sw_ paris (config)# vtp mode client Sw_ paris (config)# vtp domain Labo Sw_ paris (config)# vtp password cisco 9 ) Configurer les interfaces trunk Sw_Lyon (config)# interface fastethernet 0/24 Sw_Lyon (config-if)# switchport mode trunk Sw_paris > enable Sw_paris # configure terminal Sw_paris (config)# interface fastethernet 0/24 Sw_paris (config-if)# switchport mode trunk Patrice CLEMENT Page 9 sur 11
10 ) Configurer le nom des vlans Sw_Lyon (config)#vlan 1 Sw_Lyon (config-vlan)#name administration Sw_Lyon (config-vlan)#exit Sw_Lyon (config)#vlan 10 Sw_Lyon (config-vlan)#name ingenieur1 Sw_Lyon (config-vlan)#exit Sw_Lyon (config)#vlan 20 Sw_Lyon (config-vlan)#name ingenieur2 Sw_Lyon (config-vlan)#exit Sw_Lyon (config)#vlan 30 Sw_Lyon (config-vlan)#name ingenieur3 Sw_Lyon (config-vlan)#exit 11 ) Configuration des interfaces reliées aux postes Sw_Lyon (config)# interface fastethernet 0/1 Sw_Lyon (config-if)# switchport mode access Sw_Lyon (config-if)# switchport access vlan 10 Sw_Lyon (config-if)# spanning-tree portfast Sw_Lyon (config)# interface fastethernet 0/5 Sw_Lyon (config-if)# switchport mode access Sw_Lyon (config-if)# switchport access vlan 20 Sw_Lyon (config-if)# spanning-tree portfast Sw_Lyon (config)# interface fastethernet 0/11 Sw_Lyon (config-if)# switchport mode access Sw_Lyon (config-if)# switchport access vlan 30 Sw_Lyon (config-if)# spanning-tree portfast Patrice CLEMENT Page 10 sur 11
12 ) Vérification des ports mode access et des ports trunk Sw_Lyon # show vlan Sw_Lyon # show vlan brief Sw_Lyon # show interface trunk 13 ) changer le vlan d administration (par défaut le vlan 1) Sw_Lyon (config)# interface vlan 88 Sw_Lyon (config)# ip address 192.168.88.253 255.255.255.0 Sw_Lyon (config)# no shutdown Sw_Lyon (config)# interface fastethernet 0/24 Sw_Lyon (config-if)# switchport mode trunk Sw_Lyon (config-if)# switchport trunk native vlan 88 Sw_paris > enable Sw_paris # configure terminal Sw_paris (config)# interface fastethernet 0/24 Sw_paris (config-if)# switchport mode trunk Sw_Lyon (config-if)# switchport trunk native vlan 88 14 ) Configuration des postes, vérification des adresses des postes, ipconfig et ping Patrice CLEMENT Page 11 sur 11