Cisco CheatSheet

Posté le mar. 04 avril 2017 dans blog

Misc

Get privileges

router>enable
router#

Enter configuration mode

router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
router(config)#

Reset

router#copy flash:clean-config startup-config
router#reload

Configuration

router(config)#router <protocol> <nbr>
router(config)#show ip protocols
router(config)#show running-config

auto completion

Utiliser ? pour expand une commande
ex :
lab2-ro2621(config-if)#ip a?
access-group  accounting  address  authentication

Voir le status des interfaces

router#show interfaces

Disable DNS resolution

router(config)#no ip domain-lookup

Cancel a traceroute

C-^

Supprimer toutes les routes

router(config)#no ip routing

Quitter proprement

M-A
(Alt shift A pour les non emacsiens)

Configuration des interfaces

Ethernet

router(config)#interface fastEthernet 0/0
router(config)#ip address 192.168.2.1 255.255.255.252 /* /30 */
router(config)#no shutdown

Loopback

router(config)#interface loopback ?
router(config)#ip address 192.168.2.1 255.255.255.252 /* /30 */
router(config)#no shutdown

Serie

/!\ DTE a GAUCHE -  DCE a DROITE/!\
/!\ Clock rate sur le s0/0 /!\
router(config)#interface serial 0/0
router(config)#ip address 192.168.2.1 255.255.255.252 /* /30 */
router(config)#clock rate 1000000 /* Cote 0/0 seulement */
router(config)#encapsulation hdlc /* Cote 0/0 seulement */
router(config)#no shutdown

Routage

Route par defaut

router(config)#ip route 0.0.0.0 0.0.0.0 <ip address | interface>

Ajouter une route statique

router(config)#ip routing router(config)#ip route <network>
<netmask> <ip address | interface> [distance]

RIP

V1 (classfull/ pas de ss reseau)

router(config)# router rip
router(config-router)# network <x.x.x.x>

V2 (classless)

router(config)# router rip
/* Activation globale */
router(config-router)# version 2
/* Activation sur un network */
router(config-if)# ip rip send version 2
router(config-if)# ip rip reciev version 2
/* Ajouter ses networks */
router(config-if)# network <x.x.x.x>

authentification

router(config)# key chain <name>
router(config-keychain)# key <nbr>
router(config-keychain-key)# key-string <pass>
router(config-if)#ip rip authentication key-chain <name>
router(config- if)#ip rip authentication mode {text | md5}
router(config-router)# neighbor <x.x.x.x>
router(config-router)# passive-interface serial 0/0

IGRP (classfull/pas de ss reseau)

router(config)# router igrp 1
router(config-router)# network <x.x.x.x>

timer basic <update> <invalid> <hold-down> <flush>

Metric

M = (K1*bp + K2*bp/(256-charge) + K3 * delay) * (K5/(fiabilite + K4))
default K1 = K3 = 1      K2 = K4 = K5 = 0
router(config-if)# bandwidth <1-10000000>
router(config-if)# delay <1-16777215>
router(config-router)# metric weight 0 K1 K2 K3 K4 K5

repartition de charge

// rapartion entre les metric < metrique min * variance
router(config-router)# maximum paths <1-6>
router(config-router)# variance <1-128>
router(config-router)# trafic-share balanced

VLAN

Static

creation

# vlan database
(vlan)# vlan <nbr> name <name> // vlan 1 = tout les prot par defaut ne pas utiliser

ajout port

router(config-if)# switchport acces vlan <nbr>

management lan

router(config)# interface vlan <nbr>
router(config-subif)# ip add x.x.x.x z.z.z.z
router(config-subif)# manegement //config le vtypour le telnet

affichage conf

show vlan brief

SECURITY PORT

router(config-if)# port security max-mac-count <nbr>
router(config-if)# port security action shutnown
router(config-if)# end #show port security

ETHERCHANNEL

router(config-if)# port group <nbr> distribution destination
router(config-if)# no shutdown // repeat on each interface of the group
# show etherchannel summary

ACL

numerotation(ip)

standard: 0-99 1300-1999 etendu 100-199 2000-2699

wildcard

mask de bit 0=checked 1=not checked

standard

a placer pres de la destination
router(config)# accesc-list <nbr> {permit|deny} <source> <wildcard>

etendues

a placer pres de la source
router(config)# access-list <nbr> {permit|deny} <protocol> <source> <wildcard> <destination> <wildcard> <operateut port> [established] [log]
protocol = ip | tcp | udp | icmp | ospf | igrp...
protocol = lt | gt | eq | neq

nomee

router(config)#ip access-list {standard|extended} <nom>
router(config-ext-nacl)# premit tcp <x.x.x.x> <y.y.y.y> <x.x.x.x> <y.y.y.y> <port> www

application

router(config-if)#ip access-group <nbr> {in|out}

OSPF

Conf

router(config)#router ospf 4
router(config-router)#network 192.168.4.0 255.255.255.252 area 4
router(config-router)#area 4 authenticatio
router(config-if)#ip ospf hello-interval 5
router(config-if)#ip ospf dead-interval 20

Authentification

router(config-if)#ip ospf authentication-key toto