Cisco IOS : commandes essentielles à connaître
Maîtriser les commandes essentielles Cisco IOS/IOS-XE est indispensable pour tout ingénieur réseau travaillant sur Catalyst, Nexus (NX-OS similaire), ISR ou ASR. Ce guide couvre les commandes par catégorie : configuration de base, VLAN, routing, QoS, sécurité, troubleshooting. Référence pratique 2026.
Modes CLI et navigation
- enable : passer en mode privilégié (prompt change de > à #)
- configure terminal : entrer en mode config global
- interface GigabitEthernet1/0/1 : config d'une interface
- end ou Ctrl+Z : retour au mode privilégié
- exit : monter d'un niveau
- ? : aide contextuelle à tout moment
Configuration initiale
- hostname SW-PARIS-01 : nom du switch
- enable secret Cisco123! : mot de passe privilège
- service password-encryption : chiffrer les mots de passe en clair
- ip domain-name optinoc.local : domaine pour SSH
- crypto key generate rsa modulus 2048 : clé SSH 2048 bits
- ip ssh version 2 : activer SSH v2 uniquement
- line vty 0 15 ; transport input ssh ; login local : accès SSH uniquement
VLAN et interfaces
- vlan 10 ; name DATA : créer VLAN 10
- interface vlan 10 ; ip address 192.168.10.1 255.255.255.0 ; no shut : SVI
- interface range gi1/0/1-24 : config multiple
- switchport mode access ; switchport access vlan 10 : port en access VLAN 10
- switchport mode trunk ; switchport trunk allowed vlan 10,20,30 : trunk
- switchport trunk native vlan 99 : VLAN natif sur trunk (≠ défaut 1)
Routing
- ip routing : activer routing L3 (souvent désactivé par défaut)
- ip route 0.0.0.0 0.0.0.0 192.168.1.254 : route par défaut
- router ospf 1 ; network 10.0.0.0 0.255.255.255 area 0 : OSPF area 0
- router bgp 65001 ; neighbor 10.0.0.2 remote-as 65002 : BGP peer
- show ip route : voir la table de routing
- show ip route bgp : routes BGP uniquement
QoS
- class-map match-any VOICE ; match dscp ef : classe trafic voix
- policy-map MARK-VOICE ; class VOICE ; set dscp ef : policy
- interface gi1/0/1 ; service-policy input MARK-VOICE : appliquer
- mls qos : activer QoS (nécessaire sur anciennes séries)
- show policy-map interface gi1/0/1 : vérifier compteurs QoS
Sécurité
- ip access-list extended ALLOW-WEB ; permit tcp any any eq 80 : ACL L4
- interface gi1/0/1 ; ip access-group ALLOW-WEB in : appliquer ACL
- switchport port-security maximum 2 : 2 MAC max par port
- switchport port-security violation shutdown : err-disable si violation
- dot1x system-auth-control ; aaa new-model : 802.1X global
- interface gi1/0/1 ; authentication port-control auto : port 802.1X
Troubleshooting essentiel
- show running-config : config courante
- show startup-config : config au boot
- write memory ou copy running startup : sauver la config
- show interface gi1/0/1 : état interface, compteurs CRC
- show mac address-table : MAC learning
- show vlan brief : VLAN configurés
- show cdp neighbors detail : voisins Cisco
- show lldp neighbors detail : voisins LLDP (multi-vendor)
- debug ip icmp : debug trafic ICMP (attention en prod)
- undebug all ou u all : stopper tous les debugs
Gestion fichier et IOS upgrade
- dir flash: : lister fichiers
- copy tftp flash : télécharger IOS depuis TFTP
- boot system flash:c9300-uni-08.12.01.bin : définir IOS boot
- reload : redémarrage
- show boot : voir l'IOS qui sera booté
IOS-XE spécifique
- show version : version IOS + uptime
- install add file ... : mode install pour IOS-XE
- install activate : activer nouvelle version
- install commit : commit définitif
- show install summary : état installation
NX-OS (Nexus) vs IOS : différences
- NX-OS utilise feature <name> pour activer protocoles (ex : feature bgp)
- Interface Ethernet1/1 au lieu de GigabitEthernet
- show running-config interface Eth1/1 (pas de short-hand)
- VRF par défaut : 'default', pas 'global'
- Checkpoint et rollback natifs (commit-style)
Commander chez OPTINOC
Tous les switchs Cisco Catalyst et Nexus neuf ou reconditionnés chez OPTINOC. Formation gratuite IOS commandes disponible pour clients. Support technique expert francophone.
