Cisco cli

De Linuxmemo.

Sommaire

[modifier] Console

[modifier] Console physique

115200 bits per second
• 8 data bits
• no parity
• 1 stop bit
• no flow control

[modifier] Console fonctions

End and delete functions are replaced by:

Ctrl+A home
Ctrl+E end
Ctrl+D delete

[modifier] 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

[modifier] Searching and Filtering Output

{show | more} command | {begin | include | exclude} regular-expression

[modifier] Backspace not working with PuTTY

  1. Terminal > Keyboard
  2. Under “Change the sequences sent by: The Backspace key” :
  3. Then select the “Control-H” option instead of the default “Control-?”.
  4. [Optional] Make sure to save your change for a permanent effect.

[modifier] Interface

[modifier] Type d'interface

Fa = FastEthernet (100 Mbit/s)
Po = port channel (etherchannel = agrégation (LACP...))
Gi = gigabitethernet
Te = Ten gigabitethernet
Vl = Vlan

[modifier] 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).

[modifier] 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"

[modifier] Utilisation

show interfaces configuration
show interfaces status
show interfaces description

[modifier] Mac

show mac address-table

[modifier] HTTPS server

enable
configure terminal
ip http server

[modifier] SSH

[modifier] 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

[modifier] SSH server config

configure
ip ssh password-auth
ip ssh pubkey-auth
exit
show ip ssh

[modifier] NTP

show clock
configure terminal
ntp server 172.31.7.100
exit
show clock
show ntp detail

[modifier] CDP (Cisco Discovery Protocol)

show cdp neighbors

[modifier] GRE (Generic Routing Encapsulation)

[modifier] Astuces

[modifier] Compare Startup and Running Config

show archive config differences

“+” present in “startup-config”

“–“ part of “running configuration”

[modifier] 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...

[modifier] "exit" vs "end"

exit: retour vers le mode précédent.

end: retour vers le mode EXEC PRIV.

[modifier] Reboot (application de la nouvelle configuration)

enable
reload

[modifier] 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

[modifier] É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.

[modifier] Cisco IOS Software Version 15.0(2)SE4

[modifier] 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


[modifier] MAC address

show mac address-table vlan 1
show mac address-table 2/0/5
Outils personnels