GUIDE DES COMMANDES DE CONFIGURATION
Routeurs | Switches | VLAN | Interfaces | Protocoles
CONFIGURATION DU ROUTEUR
1. MODE DE CONFIGURATION
# Passer au mode privilégié
Router> enable
# Passer en mode configuration globale
Router# configure terminal
# Passer en mode interface
Router(config)# interface [type] [num]
2. ATTRIBUTION DE NOM
# Attribuer un nom unique au routeur
Router(config)# hostname UCAO
3. CONFIGURATION DES MOTS DE PASSE
a) MOT DE PASSE CONSOLE (Telnet/SSH en local)
Router(config)# line console 0
Router(config-line)# password <password>
Router(config-line)# login
b) MOT DE PASSE VTY (Terminal Virtuel - Telnet/SSH à distance)
Router(config)# line vty 0 4
Router(config-line)# password <password>
Router(config-line)# login
c) MOT DE PASSE ENABLE (Mode privilégié)
# Non sécurisé (texte clair)
Router(config)# enable password <password>
# Sécurisé (cryptage MD5)
Router(config)# enable secret <password>
d) CRYPTAGE DES MOTS DE PASSE
# Crypter tous les mots de passe (cryptage simple)
Router(config)# service password-encryption
4. CONFIGURATION D'INTERFACE SÉRIE
# Accéder à l'interface
Router(config)# interface serial 0/0
# Attribuer une adresse IP
Router(config-if)# ip address [Link] [Link]
# Définir la fréquence d'horloge (si ETCD)
Router(config-if)# clock rate 56000
# Activer l'interface
Router(config-if)# no shutdown
5. CONFIGURATION D'INTERFACE ETHERNET
# Accéder à l'interface
Router(config)# interface fastethernet 0/0
# Attribuer une adresse IP
Router(config-if)# ip address [Link] [Link]
# Activer l'interface
Router(config-if)# no shutdown
6. DESCRIPTION D'INTERFACE
# Ajouter une description
Router(config-if)# description liaison vers togotelecom
7. BANNIÈRE DE CONNEXION
# Créer un message du jour
Router(config)# banner motd # Système sécurisé. Accès autorisé uniquement! #
8. RÉSOLUTION DE NOM D'HÔTE
# Associer un nom à une adresse IP
Router(config)# ip host Auckland [Link]
CONFIGURATION DU COMMUTATEUR (SWITCH)
1. MODE DE CONFIGURATION
# Passer au mode privilégié
Switch> enable
# Passer en mode configuration globale
Switch# configure terminal
2. ATTRIBUTION DE NOM
# Attribuer un nom unique
Switch(config)# hostname S1
3. CONFIGURATION DE L'INTERFACE DE GESTION (SVI)
# Accéder à l'interface VLAN
Switch(config)# interface vlan 99
# Attribuer une adresse IPv4
Switch(config-if)# ip address [Link] [Link]
# Attribuer une adresse IPv6
Switch(config-if)# ipv6 address 2001:db8:acad:99::1/64
# Activer l'interface
Switch(config-if)# no shutdown
4. CONFIGURATION DE LA PASSERELLE PAR DÉFAUT
# Configurer la passerelle par défaut
Switch(config)# ip default-gateway [Link]
5. CONFIGURATION DES PORTS
a) CONFIGURER DUPLEX ET VITESSE
# Accéder à l'interface
Switch(config)# interface fastethernet 0/1
# Configurer le mode duplex
Switch(config-if)# duplex full
# Configurer la vitesse
Switch(config-if)# speed 100
b) AUTO-MDIX
# Activer la détection automatique du type de câble
Switch(config-if)# mdix auto
CONFIGURATION DES VLAN
1. CRÉATION DE VLAN
# Passer en mode configuration
Switch# conf t
# Créer un VLAN
Switch(config)# vlan 10
# Nommer le VLAN
Switch(config-vlan)# name Etudiant
2. CONFIGURATION DES PORTS D'ACCÈS
# Accéder à l'interface
Switch(config)# interface fastethernet 0/1
# Configurer le port en mode accès
Switch(config-if)# switchport mode access
# Assigner le port à un VLAN
Switch(config-if)# switchport access vlan 10
3. CONFIGURATION DES PORTS TRUNK
# Accéder à l'interface
Switch(config)# interface fastethernet 0/24
# Configurer le port en mode trunk
Switch(config-if)# switchport mode trunk
# Définir le VLAN natif (recommandé: VLAN inutilisé, pas VLAN 1)
Switch(config-if)# switchport trunk native vlan 99
4. VÉRIFICATION DES VLAN
# Afficher tous les VLAN
Switch# show vlan
# Afficher les VLAN sur une interface
Switch# show vlan id 10
5. SUPPRESSION DE VLAN
# Supprimer un VLAN
Switch(config)# no vlan 10
COMMUNICATION INTER-VLAN
1. CONFIGURATION SUR COMMUTATEUR MULTICOUCHE (SVI)
# Créer SVI pour VLAN 10
Switch(config)# interface vlan 10
# Attribuer l'adresse IP passerelle
Switch(config-if)# ip address [Link] [Link]
# Activer l'interface
Switch(config-if)# no shutdown
# Créer SVI pour VLAN 20
Switch(config)# interface vlan 20
# Attribuer l'adresse IP passerelle
Switch(config-if)# ip address [Link] [Link]
# Activer l'interface
Switch(config-if)# no shutdown
2. CONFIGURATION ROUTER-ON-A-STICK
# Sur le commutateur, configurer le port trunk
Switch(config)# interface fa0/24
Switch(config-if)# switchport mode trunk
# Sur le routeur, configurer les sous-interfaces
# Accéder à l'interface physique
Router(config)# interface fastethernet 0/0
# Activer l'interface
Router(config-if)# no shutdown
# Créer une sous-interface pour VLAN 10
Router(config)# interface fastethernet 0/0.10
# Configurer l'encapsulation VLAN
Router(config-subif)# encapsulation dot1Q 10
# Attribuer l'adresse IP passerelle
Router(config-subif)# ip address [Link] [Link]
# Créer une sous-interface pour VLAN 20
Router(config)# interface fastethernet 0/0.20
# Configurer l'encapsulation VLAN
Router(config-subif)# encapsulation dot1Q 20
# Attribuer l'adresse IP passerelle
Router(config-subif)# ip address [Link] [Link]
CONFIGURATION DES PROTOCOLES DE ROUTAGE
1. RIP (Routing Information Protocol)
# Activer RIP
Router(config)# router rip
# Annoncer un réseau
Router(config-router)# network [Link]
# Annoncer un autre réseau
Router(config-router)# network [Link]
# Désactiver RIP
Router(config)# no router rip
2. OSPF (Open Shortest Path First)
# Activer OSPF avec ID de processus
Router(config)# router ospf 1
# Annoncer un réseau
# Format: network <adresse> <masque inverse> area <area-id>
Router(config-router)# network [Link] [Link] area 0
3. BGP (Border Gateway Protocol)
# Activer BGP avec numéro de système autonome
Router(config)# router bgp 65000
# Annoncer un réseau
Router(config-router)# network [Link] mask [Link]
CONFIGURATION SSH (ACCÈS SÉCURISÉ)
1. PRÉALABLES
# Vérifier que SSH est supporté
Switch# show version
# (Chercher 'k9' dans le nom de l'IOS - présence de crypto)
2. CONFIGURATION DE SSH
# Étape 1 : Vérifier SSH
Switch# show ip ssh
# Étape 2 : Configurer le domaine IP
Switch(config)# ip domain-name [Link]
# Étape 3 : Générer les clés RSA
Switch(config)# crypto key generate rsa
# Étape 4 : Configurer l'authentification d'utilisateur
Switch(config)# username admin secret ccna
# Étape 5 : Configurer les lignes VTY
Switch(config)# line vty 0 4
# Permettre SSH uniquement
Switch(config-line)# transport input ssh
# Utiliser la base de données locale pour l'authentification
Switch(config-line)# login local
# Étape 6 : Activer SSH version 2
Switch(config)# ip ssh version 2
3. VÉRIFICATION DE SSH
# Vérifier que SSH est actif
Switch# show ip ssh
ENREGISTREMENT ET SAUVEGARDE DES CONFIGURATIONS
1. FICHIERS DE CONFIGURATION
# Configuration courante (en RAM)
running-config
# Configuration au démarrage (en NVRAM)
startup-config
2. AFFICHER LES CONFIGURATIONS
# Afficher la configuration courante
Router# show running-config
# Afficher la configuration de démarrage
Router# show startup-config
3. SAUVEGARDER LA CONFIGURATION
a) COPIER LA CONFIGURATION COURANTE DANS STARTUP
# Méthode 1
Router# copy running-config startup-config
# Méthode 2
Router# write memory
# Méthode 3
Router# write
b) SAUVEGARDER SUR UN SERVEUR TFTP
# Sauvegarder running-config sur serveur TFTP
Router# copy running-config tftp
# Répondre aux invites : adresse IP du serveur et nom du fichier
c) CHARGER DEPUIS UN SERVEUR TFTP
# Charger la configuration depuis serveur TFTP
Router# copy tftp running-config
# Répondre aux invites
4. QUITTER SANS SAUVEGARDER
# Quitter la configuration sans sauvegarder
Router(config)# exit
# Abroger les changements
Router# reload
5. SUPPRIMER LA CONFIGURATION
# Effacer la NVRAM
Router# erase startup-config
# Effacer le fichier de configuration en mémoire flash
Router# erase flash:
# Redémarrer
Router# reload
COMMANDES DE VÉRIFICATION
1. ROUTEUR
# Afficher toutes les interfaces
Router# show interfaces
# Afficher une interface spécifique
Router# show interfaces serial 0/1
# Afficher le temps
Router# show clock
# Afficher les utilisateurs connectés
Router# show users
# Afficher la table ARP
Router# show arp
# Afficher la table de routage
Router# show ip route
# Afficher les protocoles configurés
Router# show ip protocols
2. COMMUTATEUR
# Afficher les interfaces brièvement
Switch# show ip interface brief
# Afficher la table d'adresses MAC
Switch# show mac-address-table
# Afficher les informations de version
Switch# show version
# Afficher les informations flash
Switch# show flash
# Afficher l'historique des commandes
Switch# show history