Está en la página 1de 27

GUÍA DE COMANDOS IOS CISCO

Comandos CCNA2 – Routing Protocols And Concepts

Comandos;

#show ip route

#show print (ver tabla enrutamiento del host)

Teclas;

Crtl + Shift + 6 = Interrumpe Procesos

Crtl + R = Vuelve a mostrar linea


—————
show interfaces

show interfaces serial 0/1

show version

show arp (Muestra la tabla arp del dispositivo)

show startup-config (muestra la configuración guardada en la nvram)

show running-config (muestra la configuración Archivo de configuración)

show ip interfaces (muestra estadisticas ipv4 para todas las interfaces de


un router)

show ip interfaces brief (Muestra resumen rápido de las interfaces y su


estado operativo)

show ip interface serial 0/0/0

———————————–

Frecuencia de Reloj

router(config)#interface serial 0/0/0

router(config-if)#clock rate 64000


router(config-if)#no shutdown

————————————-

Comando verificación del router;

#show ip interface brief


————————————-

cambiar una descripcion en cada interfaz

r1(config-if)#description linktor2

#show ip route (ver tabla de enrutamiento)


——————————————-

UNA RUTA ESTATICA INCLUYE LA DIRECCION DE RED, Y LA


MASCARA DE SUBRED DE LA RED REMOTA, JUNTO CON LA
DIRECCION IP DEL ROUTER DEL SIGUIENTE SALTO O LA

INTERFAZ DE SALIDA.

CONFIGURAR RUTAS ESTATICAS

r3(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1

destino destino ip salida


r1(config)#ip route 192.168.3.0 255.255.255.0 fastethernet 0/1

————————————————–

ENRUTAMIENTO DINAMICO

EJECUTAN VARIAS ACTIVIDADES;

-DESCUBRIMIENTO DE REDES

-ACTUALIZACION Y MANTENIMIENTO DE LAS TABLAS DE


ENRUTAMIENTO.

—————————————————

CONFIGURACION RUTER DINAMICAS – RIP


r2#configure terminal
r2(config)#router rip

r2(config-router)#network 192.168.2.0

r2(config-router)#network 192.168.3.0

r2(config-router)#network 192.168.7.0

r3(config-router)#network 192.168.3.0

r3(config-router)#network 192.168.4.0

r3(config-router)#network 192.168.5.0

r3(config-router)#network 192.168.5.0

r3(config-router)#network 192.168.7.0

r3(config-router)#network 192.168.6.0
——————————————————-
MENSAJES NO SOLICITADOS

EN MODO DE CONFIGURACION DE LINEA

R1(CONFIG)#LINE CON 0

R1(CONFIG-IF)#LOGGIN SYNCHROMOUS

——————————————————-
comando debug ip routing
– nos permite ver cualquier cambio que realize el router al agregar

o eliminar rutas

– primero activamos el debug, despues configuramos;

r2#debug ip routing

– para desactivarlo, usamos;

r2#undebug ip routing
——————————————————
Para eliminar una red conectada directamente de un router, utilizar;
– shutdown

o – no ip address
Ejem;
r2(config)#interface fastethernet 0/0

r2(config-if)#shutdown

después;

r2(config-if)#no ip address
——————————————————
CISCO DISCOVERY PROTOCOL CDP
– CISCO DISCOVERY PROTOCOL ES UN PROTOCOLO DE CAPA 2
DEL MODELO OSI QUE OPERA ENTRE LOS DISPOSITIVOS CISCO
TALES COMO ROUTERS Y SWITCHES. SOLO

INTERCAMBIAN INFORMACION LOS DISPOSITIVOS CONECTADOS.


COMANDOS:
– SHOW CDP (MUESTRA INFORMACION ACERCA DEL
TEMPORIZADOR Y DE VERSION)

– SHOW CDP INTERFACE (MUESTRA INFORMACION SOBRE EL


TEMORIZADOR PARA TODAS LAS INTERFACES DEL ROUTER)

– SHOW CDP NEIGHBORS (MUESTRA UNA LINEA DE INFORMACION


PARA CADA DISPOSITIVO)

– SHOW CDP ENTRY * (MUESTRA INFORMACIÓN DETALLADA


ACERCA DE TODOS LOS DISPOSITIVOS CONECTADOS
DIRECTAMENTE)

– SHOW CDP NEI DETAIL (MUESTRA LAS DIRECCIONES IP DE LOS


ROUTERS VECINOS)

—————————————————–
en modo de configuración global

comando;
#no cdp run (deshabilita el cdp del router)

– Si desea utilizar el cdp pero necesita interrumpir las publicaciones cdp


en una interfaz determinada utilize este comando.
router(config-if)#no cdp enable
—————————————————–
rutas estaticas
r1# debug ip routing

r1#configure terminal

r1(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.2


remota remota direccion salida

—————————————————–
comando;
router#show history
———————-

comandos;

#show ip rip database (muestra todas las rutas aprendidas por el router,
independientamente de si la ruta RIP se instala en la tabla de
enrutamiento.
———————-

comandos;

#show ip protocols

(muestra toda la información sobre los protocolos de enrutamiento que


funcionan en el router)
———————-

comando; show ip route 172.16.3.0 (muestra información especifica de


esa interfaz)

———————
asignar contraseña de acceso al modo exe privilegiado

router#config t

router(config)#enable password maxi

router(config)#enable secret maxi

router(config)#service password-encryption
router(config)#exit
asignar contraseña de acceso telnet
router#config t

router(config)#line vty 0 4

router(config)#password maxi

router(config-line)#login

router(config-line)#exit
asignar contraseña de acceso a la interfaz console
router#config t

router(config)#line console 0

router(config-line)#password maxi

router(config-line)#login

router(config-line)#exit

———————————
comando; sh run

#show running-config

————————-

router(config)#banner motd #mensaje#

———————–

copiar configuraciones;
startup-config

running-config

comandos;

copy run start

copy start run


………………………….
RIP V2

router enable

router#configure terminal

router(config)#router rip

router(config-router)#version 2

router(config-router)#network 192.168.0.0

router(config-router)#network 10.10.10.0

router(config-router)#network 172.16.0.0
…………………………………………..

TFTP
– Se puede guardar en sitios mas permanentes

– otras maquinas, usando tftp

– en la memoria flash del router

comando; “copy”

copy running-config startup-config

copy running-config startup-configuration

copy run tftp

copy start tftp

copy tftp start

copy flash start

copy start flash


—————————–
2 maneras de configurar interfaces

router(config-if)#ip addrress ……….


router(config-if)#ip addr …………..

———————————————

*** borrar la configuracion ***

router#erase startup-config

router#write erase

y luego

router#reload

nota; el router se reiniciara en modo “setup”, porque no encontrara el


archivo de configuracion.

————————————-
RIP V1

#router rip

ri(config-router)#

– Eliminar completamente el proceso de enrutamiento rip

router#no router rip

Este comando detiene el proceso RIP y elimina todas las configuraciones


rip existentes.

router(config-router)#network direccion ip

— RIP PUBLICA ACTUALIZACIONES CADA 30 SEGUNDOS

—————————————————-
COMANDOS UTILES:

#show ip route (muestra tabla de enrutamiento)

#show ip protocols (muestra el protocolo de enrutamiento configurado)


#debug ip rip (ver como envia y recibe mensajes rip)

#show ip rip database (muestra toda las rutas aprendidas)

——————————————————

detencion de actualizaciones – RIP


ej;

r2#

r2(config)#router rip

r2(config)#ver 2

r2(config-router)#passive-interface fastethernet 0/1

——————————————————

GATEWAY DEL ULTIMO RECURSO

ip route 0.0.0.0 0.0.0.0 se0/0/1

————————————-

CONFIGURAMOS LOOPBACK
#int loopback 0

#ip addr 172.16.0.1 255.255.255.0

comandos;

#debug ip routing

vemos cualquier cambio realizados en el router cuando agregamos o


eliminamos rutas.

undebug ip routing o undebug all

————–

#no ip address
(borra la ip del router en la interfaz)

Pero primero hay que dar de baja la interfaz no shutdown en la interfaz


correspondiente.

———————-

DESACTIVAR RESUMEN
RIP V2

r1(config)#router rip

r1(config-router)#no auto-summary

r1(config-router)#end

————————————————————————————————–
EIGRP – eigrp

r1(config)#router eigrp 1

r1(config-router)#network 172.16.0.0

r1(config-router)#network 192.168.10.0
Comando;
r2#show ip eigrp neighbors
—-

#show ip protocols

———

BANDWIDTH

r1(config)#int se0/0/0

r2(config-if)#bandwidth 64
(no bandwidth , dejamos el valor predeterminado)

——-
Comandos;
#show ip eigrp topology
————————————-
EIGRP

r1#show interface serial 0/0/0

verificamos el ancho de banda

Comandos;

show eigrp topology

enumera todos los sucesores y sucesores factibles

FD— DISTANCIA FACTIBLE


EIGRP

r1#show ip eigrp topology all-links

(podemos ver todos los enlaces posibles, ya sean que satisfagan o no la


condicion de factibilidad)
——

debug;
r1#debug ip eigrp

r1#debug eigrp fsm

———–

no autosummary EIGRP

r1#conf t

r1(config)#router eigrp 1

r1(config-router)#no auto-summary

EIGRP REQUIERE EL USO DEL COMANDO REDISTRIBUTE STATIC


para que incluya esta ruta por defecto con sus actualizaciones de

enrutamiento EIGRP

r2(config)#ip route 0.0.0.0 0.0.0.0 loopback1


r2(config)#router eigrp 1

r2(config)#redistribute static

————————————
COMANDOS EIGRP

show ip eigrp topology

show ip eigrp topology all-links

show ip eigrp nei

show protocols

debug ip eigrp

debug ip routing

debug eigrp fsm

show ip packet

show ip-eigrp interface

debug eigrp packets (ver envios de hello)


————-

ip route 0.0.0.0 0.0.0.0 loopback1

router eigrp

redistribute static

—————————————————————————————-
OSPF – ospf

– ANTES DE QUE DOS ROUTERS PUEDAN FORMAR UNA


ADYAENCIA DE VECINOS OSPF, ESTOS DEBEN ESTAR DE
ACUERDO CON RESPETO A

3 VALORES;

1- intervalo de saludo
2- intervalo muerto

3- tipo de red


LOS PACKETES DE SALUDOS SE ENVIAN COMO MULTICAST A UNA
DIRECCION RESERVADAS PARA TODOS LOS ROUTERS EN

224.0.0.5

EL INTERVALO MUERTO ES EL PERIODO EXPRESADO EN


SEGUNDOS , QUE EL ROUTER ESPARARA PARA RECIBIR UN
PAQUETE DE SALUDO ANTES DE DECLARAR

AL VECINO “DESACTIVADO”
CISCO UTILIZA EN FORMA PREDETERMINADA 4 VECES EL
INTERVALO DE HELLO

CONFIGURACION;

R1(CONFIG)#ROUTER OSPF1

R1(CONFIG-ROUTER)#NETWORK 172.16.1.16 0.0.0.15 AREA 0

R1(CONFIG-ROUTER)#NETWORK 192.168.10.0 0.0.0.3 AREA 0

R1(CONFIG-ROUTER)#NETWORK 192.168.10.4 0.0.0.3 AREA 0

—————–

ID DEL ROUTER

VEMOS EL ID DEL ROUTER CON EL COMANDO

SHOW IP PROTOCOLS

SHOW IP OSPF INTERFACE

ID DEL ROUTER

router(config)#router ospf (proccess id)

router(config-router)#router-id ip-address
modificarse; router#clear ip ospf process

———-
comandos;

#show ip opsf neighbor


#show ip protocols
#show ip ospf
#show ip ospf interface se0/0/0
#debug ip ospf events
OSPF no realiza un resumen automatico en los bordes de la red
principal.
OSPF es esencialmente sin clase. a diferencia de rip v2 y eigrp

———

Modificacion del costo.


#int se0/0/0
#bandwith 64
#end
#int se0/0/0
#ip opsf cost 1562
#end

——————————————————

redistribucion de rutas por defecto


r1(config)#interface loopback1
r1(config-if)#ip add 172.30.1.1 255.255.255.252
r1(config-if)#exit
r1(config)#ip route 0.0.0.0 0.0.0.0 loopback1
r1(config)#router ospf 1
r1(config-router)#default-information originate
———————–

resetear router cisco

router#conf t
router(config)#config-register 0x2102
router(config)#end
router#
———————-
comandos;

router1#show ip ospf
– La metrica en OSPF se llama COSTO
———————-

servidor tftp

1º copy start-config running-config


2º copy start-config tftp
3º ip 192.168.20.254
4º poner nombre

recuperar tftp


router1#erase startup-config
router1#reload
router1#sh running-config


router1#copy tftp running-config
ip server; 192.168.20.254
source name; baires (el nombre del host, hostname baires-confg)
destination; running-config (solo enter)

————————-

******************************************************
eigrp; redistribuir rutas ospf
router eigrp 1
redistribute ospf 1 metric 10000 100 255 1 1500
ospf; redistribuir rutas eigrp
router ospf 1
redistribute eigrp 1 subnets
——-
router
ver y ubicar las imagenes
router#show file syste
————-

Contraseñas:
contraseña acceso consola
#configure terminal
#line con 0
#password cisco
#login
#exit

contraseña terminal virtual


#configure terminal
#line vty 0 4
#password cisco
#login
#exit

contraseña modo exec


#configure terminal
#enable password class
#enable secret class
#exit

no ip domain-lookup

line con 0 , service password-encription


Comandos CCNA3 – LAN Switching and Wireless
Configuramos direccion ip
#show ip int b (vemos las interfaces)
#int vlan1
#ip addr 10.0.0.1 255.255.255.0
Agregar vlan
#configure terminal
#vlan numero
#name nombre
#end

Comando;

#show vlan brief (vlan.dat)


Asignamos Puertos;
#configure terminal
#interface interfaceid o int range fa0/2 – 5
#switchport mode access
#switchport access vlan number
Filtrado de MAC
switch#int fa0/2
#switchport mode access
#switchport port-security
#switchport port-security (elegimos mac-adress, maximum o violation)
#switchport port-security mac-address 0001-42d7-a544 o sticky
el modo por defecto es portsecurity es shutdown, el switch apaga el
puerto

Comando;

show port-security int fa0/1

Seguridad;

#swtich(config-if)switchoprt port-security violation ?


tememos 3, protect, restrict o shutdown

Comandos;

#show mac-address-table
#show interfaces fa0/1
#show int trunk

————————————————-

Configurar VLAN DE ADMINISTRACION

#configure terminal
#int vlan99
#ip addr 172.17.99.11 255.255.255.0
#no shutdown
#end

#configure terminal
#int fa0/18
#sw mode access
#sw access vlan 99
#end
#exit
#cp run-config startup-config
Configurar GATEWAY PREDETERMINADO
s1(config)#ip default-gateway 172.17.99.1

——————————

Configurar vlan NATIVA

s1#conf t
s1(config)#int fa0/1
s1(config-if)#sw mode trunk
s1(config-if)#sw trunk native vlan 99
s1(config-if)#end

Comando;

s1#show int fa0/1 sw

—————-

BORRAR VLAN
#no vlan 20
o
#delete flash:vlan.dat
#reload
—————-

ENLACE TRONCAL

#int fa0/1
#sw mode trunk
#sw trunk navite vlan99
#end

——

CONFIGURAR VTP

Comando;
#show vtp status

Configuracion;
#vtp mode server
#vtp mode transparent
#vtp mode client
#vtp domain cisco-maxi
#vtp passwd cisco123

————–

BANNER MOTD

s1(config)#banner motd “Solo usuarios autorizados”

——

Comando;

#show int trunk

———-
FALTA COMIENZO DE SPANNING-TREE

————————————————————————————————
——————

Comandos CCNA4 – Accessing the WAN

**** nat overload o pat

1 dirección publica, x cantidad de host

r1(config)#access-list1 permit 10.10.0.0 0.0.0.255

r1(config)#ip nat inside source list1 interface s0/0 overload

r1(config)#int fa0/0

r1(config-if)#ip nat inside

r1(config-if)#int se0/0

r1(config-if)#ip nat outside

**** nat estatico


r1(config)#ip nat inside source static 10.10.0.2 10.20.0.1

r1(config)#int fa0/0

r1(config-if)#ip nat inside

r1(config-if)#int se0/0

r1(config-if)#ip nat outside


**** nat dinamico

r1(config)#ip nat pool unetwook 10.20.0.10 10.20.0.50 netmask


255.255.255.0

r1(config)#access-list1 permit 10.10.0.0 0.0.0.255

r1(config)#ip nat inside-source list1 pool unetwork

r1(config)#int fa0/0

r1(config-if)#ip nat inside

r1(config-if)#int se0/0

r1(config-if)#ip nat outside

———————————————————-

DHCP
1º Configurar EIGRP, RIP O STATICO las rutas
2º verificar nombres de los dispositivos puestos
3º verificar que esten configuradas las interfaces fa0/0 de las LAN
#ip dhcp pool LAN1
network 192.168.100.0 255.255.255.0
default-router 192.168.100.1
dns-server 8.8.8.8
exit

#ip dhcp pool LAN2


network 192.168.200.0 255.255.255.0
default-router 192.168.200.1
dns-server 8.8.8.8
exit
– En la LAN, interfaz que no recibe ninguna actualización, osea esta
ciega, hay que configurar el IP HELPER

#int fa0/0
#ip helper-adress 10.1.1.1 (va la direccion ip de salida del router dhcp)
#ip dhcp-excluded-address 192.168.100.1 192.168.100.10
#ip dhcp-excluded-address 192.168.200.1 192.168.200.10

———————————————————-

frame relay – hub and spoke – point to point

1º configuramos los dlci


2º configuramos frame-relay

r3#int se0/3/0
r3#enc frame-relay
r3#ip add 192.168.0.2 255.255.255.252
r3#frame-relay interface-dlci 300
r3#no sh

r2#int se0/30
r2#enc frame-relay
r2#ip add 192.168.0.6 255.255.255.252
r2#frame-relay interface-dlci 200
r2#no sh

– Como tengo 1 interfaz física y tengo 2 sub-redes, tengo que


levantar subinterfaces
r1#int se0/3/0
r1#enc frame-relay
r1#int se0/3/0.103 point-to-point
r1#ip add 192.168.0.1 255.255.255.252
r1#frame-relay interface-dlci 103
r1#int se/03/0.102 point-to-point
r1#ip add 192.168.0.5 255.255.255.252
r1#frame-relay interface-dlci 103
Comandos;

show frame-relay lmi

show frame-relay map


———————————————————-
frame relay – punto a punto , misma subred

1º topologia, configura nombre los los routers


2º mascara .248
3º configurar la nube

r1#int se0/0/0

r1#enc frame relay


r1#ip add 192.168.0.1 255.255.255.248
r1#frame-relay map ip 192.168.0.3 103 broadcast cisco
r1#frame-relay map ip 192.168.0.2 102 broadcast cisco

r3#int se0/0/0
r3#enc frame-relay
r3#ip add 192.168.0.3 255.255.255.248
r3#frame-relay map ip 192.168.0.1 300 broadcast cisco
r3#frame-relay map ip 192.168.0.2 300 broadcast cisco

r2#int se0/0/0
r2#enc frame-relay
r2#ip add 192.168.0.2 255.255.255.248
r2#frame-relay map ip 192.168.0.1 broadcast cisco
r2#frame-relay map ip 192.168.0.3 broadcast cisco
Comandos;

show frame-relay map

———————————————————-

configuracion ppp

r1 ppp-pap
username r2 password cisco123

r1#int se0/3/0
r1#encap ppp
r1#ppp authentication pap
r1#ppp pap sent-username r1 password cisco123
r2 ppp-pap
username r1 password cisco123
r2#int se0/3/0
r2#encap ppp
r2#ppp authentication pap
r2#ppp pap sent-username r2 password cisco123
comandos:

show interfaces
show interfaces serial
debug ppp
undebug all

———————————————————-

acl

ACL ESTANDART; LO MAS CERCA DEL DESTINO POSIBLE

(NO ESPECIFICAN DIRECCIONES DESTINO)

ACL EXTENDIDA; LO MAS CERCA POSIBLE DEL ORIGEN DEL


TRAFICO DENEGADO

(ASI EL TRAFICO NO DESEADO SE FILTRA SIN ATRAVESAR LA


INFRAESTRUCTURA DE LA RED)
EJEMPLOS:

acl extendida
access-list 102 deny tcp 170.16.3.0 0.0.0.255 any eq 20
access-list 102 deny tcp 170.16.3.0 0.0.0.255 any eq 21
access-list 101 permit ip any any

———-

deny tcp 172.11.10.0 0.0.0.255 10.10.0.0 0.0.0.255 eq telnet


permit ip any any

———-

deny tcp host 192.168.1.13 host 192.168.3.1 eq telnet


deny tcp host 192.168.1.13 host 192.168.2.3 eq telnet
permit ip any any

———-
access-list 100 permit tcp 192.168.100.0 0.0.0.255 any eq 80
access-list 100 permit udp 192.168.100.0 0.0.0.255 host 200.69.173.1 eq
53
access-list 100 permit icmp 192.168.100.0 0.0.0.255 any echo
access-list 100 permit tcp host 192.168.100.1 host 192.168.100.254 eq
23
access-list 100 permit tcp any eq 80 192.168.100.0 0.0.0.255 gt 2013
established
access-list 100 permit udp host 200.69.173.1 eq 53 192.168.100.0
0.0.0.255
access-list 100 permit icmp any 192.168.100.0 0.0.0.255 echo-replay

———-

access-list permit tcp any any gt 2013 established

———

access-list 102 deny icmp any any echo-replay


access-list 102 permit ip any any

Comandos;

no access list 1
show access-list

———-

Contraseñas:

contraseña acceso consola


#configure terminal
#line con 0
#password cisco
#login
#exit

contraseña terminal virtual


#configure terminal
#line vty 0 4
#password cisco
#login
#exit
contraseña modo exec
#configure terminal
#enable password class
#enable secret class
#exit

no ip domain-lookup
line con 0 , service password-encription

————————————————————————————————
————

CCNA PRACTICOS

Configurar 1:

casa central
username Sucursal password cisco123
int se0/0/0
enc ppp
ppp authentication chap
sucursal
username Central password cisco123
int se0/0/0
enc ppp
ppp authentication chap

——————————
Configurar 2:

loggin host 192.168.1.2


service timetamps log datetime msec
username admin secret cisco123
——————————
Configurar 3:

ip dhcp pool lancentral


network 192.168.1.0 255.255.255.0
default-router 192.168.1.254
dns-server 192.168.1.1
ip dhcp pool lansucursal
network 192.168.3.0 255.255.255.0
default-router 192.168.3.254
dns-server 192.168.1.1
ip dhcp excluded-address 192.168.3.254
ip dhcp excluded-address 192.168.1.1
ip dhcp excluded-address 192.168.1.2
ip dhcp excluded-address 192.168.1.3
ip dhcp excluded-address 192.168.1.254

——————————-

Configurar:

router rip CASA CENTRAL


network 10.0.0.0
network 192.168.1.0
network 192.168.2.0
default-information originate

router rip SUCURSAL


network 10.0.0.0
network 192.168.3.0

passive-interface fa0/0 (en las dos LAN)


passive-interface fa0/1 (saliente al isp)
passive-interface ethernet 0/1/0

ip route 0.0.0.0 0.0.0.0 fastethernet 0/1 (Interfaz de salida)

Configurar:

int fa0/1
ip nat outside
int se0/0/0
ip nat inside
int fa0/0
ip nat inside
int ethernet 0/1/0

#ip nat inside source list NAT interface fastethernet 0/1 overload

#ip nat inside source static tcp 192.168.2.1 80 200.69.172.1 80

—————————————————————–
Configurar:

line con 0
login local
loggin syn
exit

line vty 0 4
password cisco123
login exit

enable password cisco123


service password-encrip
no ip domain-lookup
no cdp run
ip helper-address 10.1.1.1 (en router sucursal)
username Admin0 password admin0pass
Inter fa0/0
ip access-group restric in
Inter fa0/1
ip access-group salir out

——————————————————

ip access-list standart NAT


permit 192.168.0.0 0.0.255.255
permit 10.1.1.0 0.0.0.3
ip access-list extend restric
permit ip host 192.168.1.1 192.168.3.0 0.0.0.255
permit ip host 192.168.1.2 192.168.3.0 0.0.0.255
deny ip any 192.168.3.0 0.0.0.255
permit ip any any
ip access-list extend out
permit tcp host 200.69.172.1 any eq www
ip access-list extend www
permit tcp any host 200.69.172.1 eq www
permit tcp any eq www host 200.69.172.1
int fa0/1
ip access-group www in

También podría gustarte