Cisco cli
De Linuxmemo.
Sommaire |
Console
Console physique
115200 bits per second • 8 data bits • no parity • 1 stop bit • no flow control
Console fonctions
End and delete functions are replaced by:
Ctrl+A home Ctrl+E end Ctrl+D delete
Les modes de la console
Router> User EXEC mode
Router# Privileged EXEC mode
Router(config)# Configuration de mode (notice the # sign indicates this is accessible only at privileged EXEC mode)
Router(config-if)# Interface level within configuration mode
Router(config-router)# Routing engine level within configuration mode
Router(config-line)# Line level (vty, tty, async) within configuration mode
Searching and Filtering Output
{show | more} command | {begin | include | exclude} regular-expression
Backspace not working with PuTTY
- Terminal > Keyboard
- Under “Change the sequences sent by: The Backspace key” :
- Then select the “Control-H” option instead of the default “Control-?”.
- [Optional] Make sure to save your change for a permanent effect.
Interface
Type d'interface
Fa = FastEthernet (100 Mbit/s) Po = port channel (etherchannel = agrégation (LACP...)) Gi = gigabitethernet Te = Ten gigabitethernet Vl = Vlan
Modifications
Interface suivi du nom de l’interface.
interface 1/0/1 ip address XXX.XXX.XXX.XXX (adresse) XXX.XXX.XXX.XXX (masque). no shutdown (pour activer l’interface).
Adresse du port (Interface)
Les numéros des ports ont la syntaxe suivante: 0/1 ou 1/0/1.
"numéro du module" / "numéro du port" ou bien "numéro du switch dans la stack" / "numéro du module" / "numéro du port"
Utilisation
show interfaces configuration show interfaces status show interfaces description
Mac
show mac address-table
HTTPS server
enable configure terminal ip http server
SSH
SSH Client - Add ssh public key
configure crypto key pubkey-chain ssh user-key manager rsa key-string xxxxxxxxxxxxxxx== exit show crypto key pubkey-chain ssh
SSH server config
configure ip ssh password-auth ip ssh pubkey-auth exit show ip ssh
NTP
show clock configure terminal ntp server 172.31.7.100 exit show clock show ntp detail
CDP (Cisco Discovery Protocol)
show cdp neighbors
GRE (Generic Routing Encapsulation)
Astuces
Compare Startup and Running Config
show archive config differences
“+” present in “startup-config”
“–“ part of “running configuration”
Exécuter une commande du mode privilège dans un autre mode
La commande do (do-exec) permet d’exécuter une commande du mode privilège dans un autre mode.
Switch(config)#do show run Building configuration...
"exit" vs "end"
exit: retour vers le mode précédent.
end: retour vers le mode EXEC PRIV.
Reboot (application de la nouvelle configuration)
enable reload
Désactiver la recherche DNS
Pour désactiver la recherche DNS ("domain-lookup") en mode console, il suffit de s'y mettre en mode configuration
enable conf terminal (config)#no ip domain-lookup
On peut également désactiver l'option pour les lignes distantes "vty" :
(config)# line vty 0 5 (config-line)# no ip domain-lookup
History commands
show history
Écrire la configuration
write memory Cette commande effectue un remplacement de la configuration de démarrage par la configuration de travail
copy startup-config running-config effectue une fusion des deux configurations.
Cisco IOS Software Version 15.0(2)SE4
User EXEC
enable show version show interfaces Ethernet, FastEthernet, GigabitEthernet, Vlan, etherchannel, switchport, trunk 0/1 show ip interface brief show ip interface vlan 1 show vlan
MAC address
show mac address-table vlan 1 show mac address-table 2/0/5