com
Switch de Capa 2
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Crear una vlan
Forma 1:
swi t ch#conf i gur e t er mi nal
swi t ch( conf i g) #vl an 2
swi t ch( conf i g- vl an) #name ssur
swi t ch( conf i g- vl an) #exi t
swi t ch( conf i g) #exi t
swi t ch#
Forma 2:
swi r ch#vl an dat abase
War ni ng: I t i s r ecommended t o conf i gur e VLAN f r om conf i g mode, as VLAN dat abase mode i s
bei ng depr ecat ed. Pl ease consul t user document at i on f or conf i gur i ng VTP/ VLAN i n conf i g
mode.
swi t ch( vl an) #vl an 2 name ssur
VLAN 2 added:
Name: ssur
swi r ch( vl an) #exi t
Swi r ch#
ssur es un ejemplo
Eliminar Archivo vlan.dat
Swi t ch#dal et e f l ash: vl an. dat
Switch#show vlan
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Contraseas (enable consola vty y encriptado)
swi t ch#conf i gur e t er mi nal
Swi t ch( conf i g) #enabl e secr et ssur _1
Swi t ch( conf i g) #
Swi t ch( conf i g) #l i ne consol e 0
Swi t ch( conf i g- l i ne) #passwor d ssur _2
Swi t ch( conf i g- l i ne) #l ogi n
Swi t ch( conf i g- l i ne) #exi t
Swi t ch( conf i g) #
Swi t ch( conf i g) #l i ne vt y 0 15
Swi t ch( conf i g- l i ne) #passwor d ssur _3
Swi t ch( conf i g- l i ne) #l ogi n
Swi t ch( conf i g- l i ne) #exi t
Swi t ch( conf i g) #ser vi ce passwor d- encr ypt i on
ssur_1 , ssur_2 y ssur_3 son ejemplo
Switch#show running-config
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Interface (trunk o access) y asociarlos a vlan
Agregar a vlan 2 y dejarla como acceso
Swi t ch#conf i gur e t er mi nal
Swi t ch( conf i g) #i nt er f ace f ast Et her net 0/ 1
piriwenho@hotmail.com 1
Resumen CCNA 3 | Comandos http.telecossur.blogspot.com
Swi t ch( conf i g- i f ) #swi t chpor t mode access
Swi t ch( conf i g- i f ) #swi t chpor t access vl an 2
Swi t ch( conf i g- i f ) #exi t
Swi t ch( conf i g) #exi t
Dejarla Trunk
Swi t ch#conf i gur e t er mi nal
Swi t ch( conf i g) #i nt er f ace f ast Et her net 0/ 1
Swi t ch( conf i g- i f ) #swi t chpor t mode t r unk
Swi t ch( conf i g- i f ) #exi t
Swi t ch( conf i g) #exi t
Asignar interfaces por rango
Swi t ch( conf i g) #i nt er f ace r ange f ast Et her net 0/ 1 - 5
Swi t ch( conf i g- i f - r ange) #
Switch#show running-config
Switch#show interface trunk
Switch#show vlan
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Puerta de enlace por defecto
swi t ch#conf i gur e t er mi nal
Swi t ch( conf i g) #i p def aul t - gat eway A. B. C. D
Swi t ch( conf i g) #exi t
Swi t ch#
Switch#show running-config
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Vlan de administracin
swi t ch#conf i gur e t er mi nal
Swi t ch( conf i g) #i nt er f ace vl an 2
Swi t ch( conf i g- i f ) #i p addr ess 10. 0. 0. 1 255. 0. 0. 0
Swi t ch( conf i g- i f ) #no shut down
Vlan 2, 10.0.0.1 y 255.0.0.0 son ejemplo
Switch#show running-config
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Vlan nativa
swi t ch#conf i gur e t er mi nal
Swi t ch( conf i g) #i nt er f ace f ast Et her net 0/ 5
Swi t ch( conf i g- i f ) #swi t chpor t mode t r unk
Swi t ch( conf i g- i f ) #swi t chpor t t r unk nat i ve vl an 2
Vlan 2 y F0/5 son ejemplo
Switch#show interfaces fastEthernet 0/5 switchport
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
VTY (virtual trunking protocol)
Dominio (ej. inacap)
Swi t ch#conf i gur e t er mi nal
piriwenho@hotmail.com 2
Resumen CCNA 3 | Comandos http.telecossur.blogspot.com
Swi t ch( conf i g) #vt p domai n i nacap
Modo client / server / transparent
Swi t ch( conf i g) #vt p mode cl i ent
Swi t ch( conf i g) #vt p mode ser ver
Swi t ch( conf i g) #vt p mode t r anspar ent
Switch#show vtp status
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Spanning-tree
Bridge ID
Swi t ch#conf i gur e t er mi nal
Swi t ch( conf i g) #spanni ng- t r ee vl an 2 pr i or i t y 4096
Ejemplo: vlan 2
<0-61440> bridge priority in increments of 4096
Port ID
Swi t ch#conf i gur e t er mi nal
Swi t ch( conf i g) #spanni ng- t r ee vl an 2 r oot pr i mar y
Switch#show spanning-tree
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Direcciones MAC
Configuracion MAC Statica
Swi t ch#conf i gur e t er mi nal
Swi t ch( conf i g) #mac- addr ess- t abl e st at i c 0000. 0a00. 1232 vl an 2
i nt er f ace f ast Et her net 0/ 1
0000. 0a00. 1232, vl an 2, F0/ 1 son ej empl o
Seguridad a los puertos
Swi t ch( conf i g) #i nt er f ace f ast Et her net 0/ 1
Swi t ch( conf i g- i f ) #swi t chpor t por t - secur i t y
Swi t ch( conf i g- i f ) #swi t chpor t por t - secur i t y maxi mum1
Swi t ch( conf i g- i f ) #swi t chpor t por t - secur i t y mac- addr ess st i cky
Swi t ch( conf i g- i f ) #swi t chpor t por t - secur i t y vi ol at i on shut down
Swi t ch( conf i g- i f ) #
Eliminar configuracion MAC Statica
Swi t ch#conf i gur e t er mi nal
Swi t ch( conf i g) #no mac- addr ess- t abl e st at i c 0000. 0a00. 1232 vl an 2
i nt er f ace f ast Et her net 0/ 1
Switch#show port-security interface fastEthernet 0/1
Switch#sh mac-address-table
Switch#sh mac-address-table static
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IP Snooping
Swi t ch#conf i gur e t er mi nal
Swi t ch( conf i g) #i p dhcp snoopi ng
Swi t ch( conf i g) #i nt er f ace f ast Et her net 0/ 2
Swi t ch( conf i g- i f ) #i p dhcp snoopi ng t r ust
piriwenho@hotmail.com 3
Resumen CCNA 3 | Comandos http.telecossur.blogspot.com
S
ol o en l a puer t a f 0/ 2 ( ej empl o) se puede l ebant ar un Ser ver DHCP.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SSH
Swi t ch#conf i gur e t er mi nal
Swi t ch( conf i g) #host name SSUR- 1
SSUR- 1( conf i g) #i p domani n- name ssur
SSUR- 1( conf i g) #cr ypt o key gener at e r sa
SSUR- 1( conf i g) #i p ssh ver si on 2
SSUR- 1( conf i g) #l i ne vt y 0 15
SSUR- 1( conf i g- l i ne) #t anspor t i nput ssh
Switch#show ip ssh
Switch#show ssh
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Recuperar contrasea en un switch (2950)
Desconecte el switch de la corriente
Conecte y presione el boton mode
Espere suerte el boton cuando los led parpadee
Debera aparecer lo siguiente:
###########
f l ash_i ni t
l oad_hel per
boot
luego ejecutar lo siguiente
swi t ch: f l ash_i ni t
swi t ch: l oad_hel per
swi t ch: di r f l ash: /
El archivo de configuracion se llama "conf i g. t ext " podemos eliminarlo y luego reiniciar.
swi t ch: del et e f l ash: conf i g. t ext
swi t ch: boot
####################
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Switch de Capa 3 / router
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Switch capa 3
Por defecto estos switch vienen en funcin capa 2, se les debe activar el enrutamiento
Swi t ch#conf i gur e t er mi nal
Swi t ch( conf i g) #i p r out i ng
Tambin se les debe activar el puerto para capa 3
Swi t ch#conf i gur e t er mi nal
Swi t ch( conf i g) #i nt er f ace f ast Et her net 0/ 1
piriwenho@hotmail.com 4
Resumen CCNA 3 | Comandos http.telecossur.blogspot.com
Swi t ch( conf i g- i f ) #no swi t chpor t
Swi t ch( conf i g- i f ) #i p addr ess 10. 0. 0. 1 255. 0. 0. 0
Swi t ch( conf i g- i f ) #no shut down
Swi t ch( conf i g- i f ) #end
F0/ 1, 10. 0. 0. 1 y 255. 0. 0. 0 son ej empl o
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Rip y Rip version 2
RI P
Rout er #conf i gur e t er mi nal
Rout er ( conf i g) #r out er r i p
Rout er ( conf i g- r out er ) #net wor k A. B. C. D
RIP version 2
Rout er #conf i gur e t er mi nal
Rout er ( conf i g) #r out er r i p
Rout er ( conf i g- r out er ) #ver si on 2
Rout er ( conf i g- r out er ) #net wor k A. B. C. D
router#show ip route
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Eigrp
Rout er #conf i gur e t er mi nal
Rout er ( conf i g) #r out er ei gr p <1- 65535>
Rout er ( conf i g- r out er ) #net wor k A. B. C. D
router#show ip route
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OSPF
Rout er #conf i gur e t er mi nal
Rout er ( conf i g) #r out er ospf <1- 65535>
Rout er ( conf i g- r out er ) #net wor k A. B. C. D wi l dcar d ar ea <0- 4294967295>
Ej empl o:
Rout er ( conf i g) #r out er ospf 1
Rout er ( conf i g- r out er ) #net wor k 10. 0. 0. 0 0. 255. 255. 255 ar ea 0
router#show ip route
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ruta Estatica
Forma 1:
Rout er #conf i gur e t er mi nal
Rout er ( conf i g) #i p r out e r ed dest i no mascar a r ed si gui ent e sal t o
Ej empl o:
Rout er ( conf i g) #i p r out e 10. 0. 0. 0 255. 255. 255. 0 11. 0. 0. 1
Forma 2:
Rout er #conf i gur e t er mi nal
Rout er ( conf i g) #i p r out e r ed dest i no mascar a r ed i nt er f az sal i da
Ej empl o:
Rout er ( conf i g) #i p r out e 10. 0. 0. 0 255. 255. 255. 0 ser i al 0/ 1
piriwenho@hotmail.com 5
Resumen CCNA 3 | Comandos http.telecossur.blogspot.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ruta Por Defecto
Forma 1:
Rout er #conf i gur e t er mi nal
Rout er ( conf i g) #i p r out e 0. 0. 0. 0 0. 0. 0. 0 si gui ent e sal t o
Forma 2:
Rout er #conf i gur e t er mi nal
Rout er ( conf i g) #i p r out e 0. 0. 0. 0 0. 0. 0. 0 i nt er f az sal i da
Ej empl o
Rout er ( conf i g) #i p r out e 0. 0. 0. 0 0. 0. 0. 0 ser i al 0/ 1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ACL
Configuracin de ACL estndar
Rout er ( conf i g) #access- l i st [ 1- 99] [ per mi t | deny] [ di r ecci n de or i gen]
[ Wi l dcar d]
Configuracin de ACL extendida
Rout er ( conf i g) #access- l i st [ 100- 199] [ per mi t | deny] [ pr ot ocol ] [ di r ecci n
de or i gen] [ mascar a comod n] [ di r ecci n de dest i no] [ mascar a de
dest i no] [ puer t o]
Asociaciar a una interfaz
r out er ( conf i g) #i nt er f ace ser i al 0/ 1
Rout er ( conf i g- i f ) #i p access- gr oup[ n de l i st a de acceso] [ i n| out ]
Asociaciar a una vty
r out er ( conf i g) #l i ne vt y 0 4
r out er ( conf i g- l i ne) #access- cl ass[ N de l i st a de acceso] [ i n| out ]
Eliminar ACL
ACL:
r out er ( conf i g) #no access- l i st [ N de l i st a de acceso]
Interface:
Rout e
Vty:
r ( conf i g- i f ) #no i p access- gr oup[ N de l i st a de acceso]
r out er ( conf i g- l i ne) #no access- cl ass[ N de l i st a de acceso]
Ejemplo:
Router(config)#access-list 11 deny tcp host 192.168.1.1 any eq 80
Router(config)#access-list 11 permit ip any any
Router(config)#interface fastEthernet 0/1
Router(config-if)#ip access-group 11 in
Router(config-if)#end
Rout er #conf i gur e t er mi nal
Rout er ( conf i g) #access- l i st 10 deny 192. 168. 1. 0 0. 0. 0. 0
Rout er ( conf i g) #access- l i st 10 per mi t any
Rout er ( conf i g) #l i ne vt y 0 4
Rout er ( conf i g- l i ne) #access- cl ass 10 i n
Rout er ( conf i g- l i ne) #end
Router#sh access-lists
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
piriwenho@hotmail.com 6