Seguridad y Redes

Tips, Video Tutoriales, Wifislax, VMware, Linux, GNS3, Eve-NG, CCNA, Cisco Routers, Switches

PortFast = Inmediatamente a Forwarding

Spanning Tree esta habilitado por default en los Switches Cisco. A los host no les importa saber sobre como esta la topologia de red. Asi que cuando un host esta conectado a la red no es realmente necesario que tenga que esperar a que transiten los estados del spanning tree. Los estados de los puertos en el protocolo Spanning tree son lo siguientes.
  • Blocking
  • Listening
  • Learning
  • Forwarding
  • Disable
Por default al conectar un host en un Switch pasa por estos estados.

Estado Listening.
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 LIS     0 32768 c200.0598.0000 128.42
FastEthernet1/2      128.43   128    19 FWD     0 32768 c200.0598.0000 128.43
Estado Learning:
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 LRN     0 32768 c200.0598.0000 128.42
FastEthernet1/2      128.43   128    19 FWD     0 32768 c200.0598.0000 128.43
Finalmente el Estado de Forwarding.
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 FWD     0 32768 c200.0598.0000 128.42
FastEthernet1/2      128.43   128    19 FWD     0 32768 c200.0598.0000 128.43
Para llegar al estado de Forwarding se requiere mas o menos como 50 segundos mientras el STP converge la red.

Listening - Leargnin - Forwarding del STP

El comando spanning-tree portfast indica que el puerto no tiene que esperar a que pasen todos estos estadados para empezar a trasmitir los datos en la LAN. PortFast no debe ser configurado en los Switches y bridges ya que puede generar loops de capa 2, incluso cuando se activa portFast en la interface nos envia la siguiente advertencia.

Switch(config-if)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single host.
 Connecting hubs, concentrators, switches,  bridges, etc.to this interface
 when portfast is enabled, can cause temporary spanning tree loops.
 Use with CAUTION

%Portfast has been configured on FastEthernet1/1 but will only
 have effect when the interface is in a non-trunking mode.

Advertencia de Portfast

Portfast sólo debe ser configurado en los puertos donde se conectan las PCs, Servidores con una sola targeta de red, teléfonos IP o routers. No se debe de configurar un puerto que este conectado un Switch, un bridge o un Hub.

Portfast está desactivado por defecto en los puertos del switch. Para habilitarlo debemos estar en la configuracion de puerto y realizarlo de la siguiente manera.

Switch(config-if)# spanning-tree portfast

Al habilitar portfast, automaticamente el puerto se pone en un estado de forwarding.
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 FWD     0 32768 c200.0598.0000 128.42
FastEthernet1/2      128.43   128    19 FWD     0 32768 c200.0598.0000 128.43

Tambien podemos habilitarlo desde la configuracion global para todos los puertos.

Switch(config)# spanning-tree portfast default

Para desabilitar Portfast en el puerto se realiza de la siguiente manera.

Switch(config-if)# no spanning-tree portfast

Spanning Tree Protocol (STP) en GNS3

Spanning Tree Protocol es un protocolo de capa 2 (enlace de datos) del modelo OSI. Este protocolo esta basado en un algoritmo diseñado por Radia Perlman. La función principal de STP es gestionar la presencia de loops en las topologias de red debido a la existencia de enlaces redundantes, estos enlaces redundantes son necesarios en varios casos para garantizar la disponibilidad de las conexiones. STP permite activar o desactivar automáticamente los enlaces de conexión de forma que se garantice que la topologia este libre de loops. Si existen varios enlaces y en el caso de que un enlace falle, otro enlaces puede seguir soportando el trafico de la red.
Tologia Spanning Tree Protocol
Spanning Tree Protocol (STP) en GNS3

El objetivo de esta practica es analizar la configuración y el funcionamiento básico del Spanning Tree Protocol (STP). En GNS3 vamos utilizar el modulo NM-16ESW, asi que lo primero que haremos es agregar el modulo NM-16ESW al router. Si necesitas ayudar del como agregar el  modulo revisa este enlace.
Spanning Tree Protocol en GNS3
Una vez configurado los cuatro Switches con el modulo NM-16ESW, iniciamos los routers y realizamos las configuraciones básicas.

Configuración básica del Switch1
SW1>enable
SW1#configure terminal
SW1(config)#hostname Switch1
Switch1(config)#enable secret cisco
Switch1(config)#no ip domain lookup
Switch1(config)#interface Vlan1
Switch1(config-if)#ip address 192.168.1.1 255.255.255.0
Switch1(config-if)#no shut
Switch1(config-if)#line con 0
Switch1(config-line)#exec-timeout 0 0
Switch1(config-line)#logging synchronous
Switch1(config-line)#password cisco2
Switch1(config-line)#login
Switch1(config-line)#exit
Switch1(config)#line vty 0 15
Switch1(config-line)#logging synchronous
Switch1(config-line)#password cisco3
Switch1(config-line)#login
Switch1(config-line)#end
Switch1#copy running-config startup-config
Destination filename [startup-config]? 
Building configuration...
[OK]
Switch1#
Configuracion Switch2
SW2>enable
SW2#configure terminal
SW2(config)#hostname Switch2
Switch2(config)#enable secret cisco
Switch2(config)#no ip domain lookup
Switch2(config)#interface Vlan1
Switch2(config-if)#ip address 192.168.1.2 255.255.255.0
Switch2(config-if)#no shut
Switch2(config-if)#line con 0
Switch2(config-line)#exec-timeout 0 0
Switch2(config-line)#logging synchronous
Switch2(config-line)#password cisco2
Switch2(config-line)#login
Switch2(config-line)#exit
Switch2(config)#line vty 0 15
Switch2(config-line)#logging synchronous
Switch2(config-line)#password cisco3
Switch2(config-line)#login
Switch2(config-line)#end
Switch2#copy running-config startup-config
Destination filename [startup-config]? 
Building configuration...
[OK]
Switch2#
Configuración Switch3
SW3>enable
SW3#configure terminal
SW3(config)#hostname Switch3
Switch3(config)#enable secret cisco
Switch3(config)#no ip domain lookup
Switch3(config)#interface Vlan1
Switch3(config-if)#ip address 192.168.1.3 255.255.255.0
Switch3(config-if)#no shut
Switch3(config-if)#line con 0
Switch3(config-line)#exec-timeout 0 0
Switch3(config-line)#logging synchronous
Switch3(config-line)#password cisco2
Switch3(config-line)#login
Switch3(config-line)#exit
Switch3(config)#line vty 0 15
Switch3(config-line)#logging synchronous
Switch3(config-line)#password cisco3
Switch3(config-line)#login
Switch3(config-line)#end
Switch3#copy running-config startup-config
Destination filename [startup-config]? 
Building configuration...
[OK]
Switch3#
Configuración Switch4
SW4>enable
SW4#configure terminal
SW4(config)#hostname Switch4
Switch4(config)#enable secret cisco
Switch4(config)#no ip domain lookup
Switch4(config)#interface Vlan1
Switch4(config-if)#ip address 192.168.1.4 255.255.255.0
Switch4(config-if)#no shut
Switch4(config-if)#line con 0
Switch4(config-line)#exec-timeout 0 0
Switch4(config-line)#logging synchronous
Switch4(config-line)#password cisco2
Switch4(config-line)#login
Switch4(config-line)#exit
Switch4(config)#line vty 0 15
Switch4(config-line)#logging synchronous
Switch4(config-line)#password cisco3
Switch4(config-line)#login
Switch4(config-line)#end
Switch4#copy running-config startup-config
Destination filename [startup-config]? 
Building configuration...
[OK]
Switch4#
Configuramos las interfaces en modo trunk
Switch1(config)#interface range fastEthernet 1/1 - 3
Switch1(config-if-range)#switchport mode trunk
Switch1(config-if-range)#no shutdown 
Switch1(config-if-range)#end
Switch1#
Switch2(config)#interface range fastEthernet 1/1 - 3
Switch2(config-if-range)#switchport mode trunk
Switch2(config-if-range)#no shutdown 
Switch2(config-if-range)#end
Switch2#
Switch3(config)#interface range fastEthernet 1/1 - 3
Switch3(config-if-range)#switchport mode trunk
Switch3(config-if-range)#no shutdown 
Switch3(config-if-range)#end
Switch3#
Switch4(config)#interface range fastEthernet 1/1 - 3
Switch4(config-if-range)#switchport mode trunk
Switch4(config-if-range)#no shutdown 
Switch4(config-if-range)#end
Switch4#
Verficamos STP
Switch1#show spanning-tree brief

VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     c204.1490.0000
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     c204.1490.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 FWD     0 32768 c204.1490.0000 128.42 
FastEthernet1/2      128.43   128    19 FWD     0 32768 c204.1490.0000 128.43 
FastEthernet1/3      128.44   128    19 FWD     0 32768 c204.1490.0000 128.44
Switch2#show spanning-tree brief

VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     c204.1490.0000
             Cost        19
             Port        43 (FastEthernet1/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     c205.1490.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 FWD    19 32768 c205.1490.0000 128.42 
FastEthernet1/2      128.43   128    19 FWD     0 32768 c204.1490.0000 128.42 
FastEthernet1/3      128.44   128    19 FWD    19 32768 c205.1490.0000 128.44 
Switch3#show spanning-tree brief

VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     c204.1490.0000
             Cost        19
             Port        42 (FastEthernet1/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     c206.1490.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 FWD     0 32768 c204.1490.0000 128.44 
FastEthernet1/2      128.43   128    19 BLK    19 32768 c205.1490.0000 128.44 
FastEthernet1/3      128.44   128    19 FWD    19 32768 c206.1490.0000 128.44 
Switch4#show spanning-tree brief

VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    32768
             Address     c204.1490.0000
             Cost        19
             Port        44 (FastEthernet1/3)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32768
             Address     c207.1490.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 BLK    19 32768 c206.1490.0000 128.44 
FastEthernet1/2      128.43   128    19 BLK    19 32768 c205.1490.0000 128.42 
FastEthernet1/3      128.44   128    19 FWD     0 32768 c204.1490.0000 128.43 
Otro comando para verificar el Switch Root.
Switch1#show spanning-tree root
VLAN1            
  Root ID    Priority    32768
             Address     c204.1490.0000
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
Para mostrar los puertos bloqueados
Switch4#show spanning-tree blockedports 

Name                 Blocked Interfaces List
-------------------- ------------------------------------
VLAN1                Fa1/1, Fa1/2

Number of blocked ports (segments) in the system : 2
Debuggin de STP en GNS3
Switch1#debug spanning-tree ?
  all           All Spanning Tree debugging messages
  backbonefast  BackboneFast events
  bpdu          Spanning tree bridge protocol data units
  bpdu-opt      Optimized BPDU handling
  config        Spanning tree config changes
  etherchannel  EtherChannel support
  events        Spanning tree topology events
  exceptions    Spanning tree exceptions
  general       Spanning tree general
  pvst+         PVST+ events
  root          Spanning tree root events
  snmp          Spanning Tree SNMP handling
  uplinkfast    UplinkFast events
Como se muestra en la salida anterior, hay varias opciones disponibles en GNS3. Nosotros activaremos uno en especifico, el debug de los eventos de la topologia de Spanning Tree.
Switch1#debug spanning-tree events 
Spanning Tree event debugging is on

Eleccion de Root Bridge

Un Root Switch es el Switch que tenga el Bridge ID (BID) mas pequeña. El bridge ID esta compuesto por:

La prioridad.
La mac address.

Si en todos los Switches son iguales en la prioridad, entonces busca la dirección MAC mas pequeña. En este ejemplo como en todos los switches la prioridad es la misma entonces lo que tomara para elegir el root bridge sera el switch que tenga la mac address mas pequeña. En nuestro caso el Root Brigde con la Mac Address mas pequeña es el Switch1. Ahora veamos un ejemplo de como cambiar la prioridad para que el Switch2 sea el Root.

Cambiar a que Switch2 sea el Root.

Para que el Switch2 sea elegido como Root lo que haremos es cambiar la prioridad y para esto se hace de la siguiente manera.

Switch2(config)#spanning-tree vlan 1 priority 4096
Al hacer esto, las notificaciones en consola del STP se han generado en cada Switch.
Switch1#
*Mar  1 00:53:30.151: STP: VLAN1 heard root  4096-c205.1490.0000 on Fa1/1
*Mar  1 00:53:30.151: current Root has 32768-c204.1490.0000
*Mar  1 00:53:30.151:     supersedes 32768-c204.1490.0000
*Mar  1 00:53:30.151: STP: VLAN1 new root is 4096, c205.1490.0000 on port Fa1/1, cost 19
Switch2#
*Mar  1 00:52:51.147: STP: VLAN1 we are the spanning tree root
*Mar  1 00:52:51.323: STP: VLAN1 Topology Change rcvd on Fa1/1
*Mar  1 00:52:51.331: STP: VLAN1 Topology Change rcvd on Fa1/3
*Mar  1 00:53:21.331: STP: VLAN1 Topology Change rcvd on Fa1/3
Switch3#
*Mar  1 00:52:19.175: STP: VLAN1 heard root  4096-c205.1490.0000 on Fa1/2
*Mar  1 00:52:19.175: current Root has 32768-c204.1490.0000
*Mar  1 00:52:19.175:     supersedes 32768-c204.1490.0000
*Mar  1 00:52:19.179: STP: VLAN1 new root is 4096, c205.1490.0000 on port Fa1/2, cost 19
*Mar  1 00:52:19.251: STP: VLAN1 Fa1/2 -> listening
*Mar  1 00:52:19.259: STP: VLAN1 sent Topology Change Notice on Fa1/2
*Mar  1 00:52:19.331: STP: VLAN1 Fa1/1 -> blocking
*Mar  1 00:52:34.271: STP: VLAN1 Fa1/2 -> learning
*Mar  1 00:52:49.295: STP: VLAN1 sent Topology Change Notice on Fa1/2
*Mar  1 00:52:49.295: STP: VLAN1 Fa1/2 -> forwarding
Switch4#
*Mar  1 00:51:57.111: STP: VLAN1 heard root  4096-c205.1490.0000 on Fa1/2
*Mar  1 00:51:57.111: current Root has 32768-c204.1490.0000
*Mar  1 00:51:57.111:     supersedes 32768-c204.1490.0000
*Mar  1 00:51:57.111: STP: VLAN1 new root is 4096, c205.1490.0000 on port Fa1/2, cost 19
*Mar  1 00:51:57.143: STP: VLAN1 Fa1/1 -> listening
*Mar  1 00:51:57.207: STP: VLAN1 Fa1/2 -> listening
*Mar  1 00:51:57.211: STP: VLAN1 sent Topology Change Notice on Fa1/2
*Mar  1 00:51:57.259: STP: VLAN1 Fa1/3 -> blocking
*Mar  1 00:51:57.327: STP: VLAN1 Fa1/1 -> blocking
*Mar  1 00:52:12.227: STP: VLAN1 Fa1/2 -> learning
*Mar  1 00:52:27.247: STP: VLAN1 Fa1/2 -> forwarding
Como hemos cambiado la prioridad al Switch2 ahora es el Root.
Switch2#show spanning-tree brief   

VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    4096
             Address     c205.1490.0000
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    4096
             Address     c205.1490.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 FWD     0  4096 c205.1490.0000 128.42 
FastEthernet1/2      128.43   128    19 FWD     0  4096 c205.1490.0000 128.43 
FastEthernet1/3      128.44   128    19 FWD     0  4096 c205.1490.0000 128.44 
Otros modos de la eleccion de Root Switch es cambiando la prioridad mas baja. Por ejemplo, ahora queremos que el Switch3 sea el Root.

Switch3(config)#spanning-tree vlan 1 priority 0
Switch3(config)#spanning-tree vlan 1 priority 0
Switch3(config)#
*Mar  1 01:01:16.907: STP: VLAN1 we are the spanning tree root
*Mar  1 01:01:16.931: STP: VLAN1 Fa1/1 -> listening
*Mar  1 01:01:17.091: STP: VLAN1 Topology Change rcvd on Fa1/1
*Mar  1 01:01:18.039: STP: VLAN1 Topology Change rcvd on Fa1/3
Switch3(config)#end
Switch3#show spanning-tree brief

VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    0
             Address     c206.1490.0000
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    0
             Address     c206.1490.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 LIS     0     0 c206.1490.0000 128.42 
FastEthernet1/2      128.43   128    19 FWD     0     0 c206.1490.0000 128.43 
FastEthernet1/3      128.44   128    19 FWD     0     0 c206.1490.0000 128.44 
Otra manera es indicandole que por ejemplo el Switch4 sea el Root.

Switch4(config)# spanning-tree vlan 1 root primary

Switch4(config)#spanning-tree vlan 1 root primary 
 VLAN 1 bridge priority set to 8192
 VLAN 1 bridge max aging time unchanged at 20
 VLAN 1 bridge hello time unchanged at 2
 VLAN 1 bridge forward delay unchanged at 15
Switch4#show spanning-tree brief

VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     c207.1490.0000
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    8192
             Address     c207.1490.0000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time 300

Interface                                   Designated
Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/1      128.42   128    19 FWD     0  8192 c207.1490.0000 128.42 
FastEthernet1/2      128.43   128    19 FWD     0  8192 c207.1490.0000 128.43 
FastEthernet1/3      128.44   128    19 FWD     0  8192 c207.1490.0000 128.44 

Routing entre VLANs (InterVLAN Routing)

Configurar el siguiente escenario. Donde tenemos dos Switches, en cada uno de los switches configuraremos dos VLANs, uno con nombre de vlan10 y el segundo con nombre de vlan20. Cada uno de los switches tendra conectado un host, el primero switch tendra un host que estara en la vlan10 y el segundo switch tendra otro host que estara en la vlan20.
Inter-VLAN Routing
Para que halla comunicación entre vlans en diferentes segmentos de red necesitaremos un dispositivo de capa 3, un router con como se ve en la imagen. A este router le configuraremos dos subinterfaces el cual nos ayudara a que halla comunicion entre vlans.

Inter-VLAN Routing en GNS3
Lo primero que haremos es crear dos vlan en cada switch (sin el VTP).
SW1(config)#vlan 10
SW1(config-vlan)#name VLAN10
SW1(config-vlan)#vlan 20
SW1(config-vlan)#name VLAN20
SW1(config-vlan)#end

SW2(config)#vlan 10
SW2(config-vlan)#name VLAN10
SW2(config-vlan)#vlan 20
SW2(config-vlan)#name VLAN20
SW2(config-vlan)#end
Verificamos
SW1#show vlan-sw
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/0, Fa1/1, Fa1/2, Fa1/3
                                                Fa1/4, Fa1/5, Fa1/6, Fa1/7
                                                Fa1/8, Fa1/9, Fa1/10, Fa1/11
                                                Fa1/12, Fa1/13, Fa1/14, Fa1/15
10   VLAN10                           active   
20   VLAN20                           active   
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup
Una vez creada las VLANs, ahora las asignaremos a los puertos.
SW1(config)#int f1/3
SW1(config-if)#switchport access vlan 10
SW1(config-if)#end
SW1#show vlan-sw brief
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/0, Fa1/1, Fa1/2, Fa1/4
                                                Fa1/5, Fa1/6, Fa1/7, Fa1/8
                                                Fa1/9, Fa1/10, Fa1/11, Fa1/12
                                                Fa1/13, Fa1/14, Fa1/15
10   VLAN10                           active    Fa1/3
20   VLAN20                           active   
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup
SW2(config)#int f1/2
SW2(config-if)#switchport access vlan 20
SW2(config-if)#end
SW2#show vlan-sw brief
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/0, Fa1/1, Fa1/3, Fa1/4
                                                Fa1/5, Fa1/6, Fa1/7, Fa1/8
                                                Fa1/9, Fa1/10, Fa1/11, Fa1/12
                                                Fa1/13, Fa1/14, Fa1/15
10   VLAN10                           active   
20   VLAN20                           active    Fa1/2
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup
Configuramos los Puertos en modo Trunk.
SW1(config)#int f1/2
SW1(config-if)#switchport mode trunk
SW1(config)#int f1/1
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#end
SW1#show int trunk

Port      Mode         Encapsulation  Status        Native vlan
Fa1/1     on           802.1q         trunking      1
Fa1/2     on           802.1q         trunking      1

Port      Vlans allowed on trunk
Fa1/1     1-4094
Fa1/2     1-4094

Port      Vlans allowed and active in management domain
Fa1/1     1,10,20
Fa1/2     1,10,20

Port      Vlans in spanning tree forwarding state and not pruned
Fa1/1     none
Fa1/2     1,10,20
SW2(config)#int f1/1
SW2(config-if)#switchport mode trunk
SW2#show int trunk

Port      Mode         Encapsulation  Status        Native vlan
Fa1/1     on           802.1q         trunking      1

Port      Vlans allowed on trunk
Fa1/1     1-4094

Port      Vlans allowed and active in management domain
Fa1/1     1,10,20

Port      Vlans in spanning tree forwarding state and not pruned
Fa1/1     none
Configuramos el Router
R1(config)#int f0/0
R1(config-if)#no ip address
R1(config-if)#no shutdown
R1(config-if)#int f0/0.10
R1(config-subif)#encapsulation dot1Q 10
R1(config-subif)#ip address 172.17.10.1 255.255.255.0
R1(config-subif)#exit
R1(config)#int f0/0.20
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip add 172.17.20.1 255.255.255.0
R1(config-subif)#end
R1#show ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES manual up                    up     
FastEthernet0/0.10         172.17.10.1     YES manual up                    up     
FastEthernet0/0.20         172.17.20.1     YES manual up                    up     
FastEthernet0/1            unassigned      YES unset  administratively down down   
R1#
Configuramos una IP y el Default Gateway a cada uno de los hosts (qemu host):
PC1:
ifconfig eth0 172.17.10.10 netmask 255.255.255.0 up
route add default gw 172.17.10.1
PC2:
ifconfig eth0 172.17.20.10 netmask 255.255.255.0 up
route add default gw 172.17.20.1
Verificamos con un ping desde cada PC.



Modos de Switch Frame Transmission


Cuando un switch recibe un frame, el switch decide que hace con el frame. Para tener un mejor rendimiento en la red es importante mantener una latencia baja como sea posible. La latencia es el tiempo en entre el envió y la recepción de un frame. Los Switches de una LAN pueden realizar una de las tres modos de operación para trasmitir un frame. Los tres modos son los siguiente.
  • Cut-through
  • Store and Forward
  • Fragment-Free
En los Switches Cisco Catalyst 1900, el valor por defecto es fragment free, mientras que la seria de Cisco Catalyst 2950 utiliza el modo Store & Forward como configuración predeterminada.

Cut-Through
El switch comenzará a enviar datos después de que éste reciba la DD (dirección de destino) del Frame. La diferencia entre éste y store-and-forward es que store-and-forward recibe el Frame completo antes de enviarlo. Así, Frames con Errores no pueden ser detectados leyendo sólo la DD, por lo que el método de switching cut-through puede impactar en el rendimiento de una red, al enviar Frames corruptos o truncados. Estos "Bad" Frames pueden originar Tormentas de Broadcasts (Broadcasts Storms) en que muchos de los dispositivos de la red responderán a los Frames corruptos simultáneamente.

Store and Forward
El Switch esperará hasta que todo el Frame haya arribado, antes de enviarlo. Este proceso asegura que la red de destino no se verá afectada por Frames corruptos o truncados, pero con la desventaja que tiene mayor latencia que cut-through.

Fragment Free (Modificacion de Cut-Through)
El punto medio entre cut-through y store-and-forward, es el método fragment free cut-through el cuál sólo envía paquetes cuyo largo mínimo es de 64 bytes, y filtra aquellos paquetes cuya longitud es menor que 64 bytes, tales como paquetes corruptos o runt. La diferencia entre éste método y store-and-forward es que de todas formas puede enviar paquetes corruptos aún cuando ellos sean mayores que 64 bytes.

Como utilizar un Switch en GNS3

En GNS3 no podemos simular la serie de Switches Cisco 2900 y 3500. Solo podemos practicar un 40% de la parte de Switching utilizando un IOS de un router 3700, específicamente el ios c3725-adventerprisek9-mz124-15.bin y agregando el modulo NM-16ESW. Así podemos practicar una parte de los temas de Switching, como VTP, VLANs, InterVLAN Routing, modos de puertos trunk, access y la encapsulación de datos (ISL & IEEE 802.1Q).
  • En nuestro primer paso, abriremos GNS3, después nos vamos al menú Editar - Administrador de Símbolos.

  • Añadimos ethernet_switching, agreamos un nombre y en la parte de Tipo seleccionamos el router 3700, al final damos clic en aceptar.
  • Ahora podemos ver el SW en la parte de abajo.

  • Ahora arrastramos el Switch en el campo de trabajo de GNS3, hacemos clic derecho y añadimos el modulo NM-16ESW desde el menu Slots.
Laboratorio de Switching en GNS3

Bueno ahora que tenemos el modulo instalado, toca realizar las conexiones con los equipos o simplemente iniciar el Switch para realizar las diferentes configuración.

  • Cambiamos el nombre del equipo, creamos dos VLANs y verificamos.
R2>
R2>en
R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#hostname Switch
Switch(config)#
Switch(config)#do show ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down
FastEthernet0/1            unassigned      YES unset  administratively down down
FastEthernet1/0            unassigned      YES unset  up                    up
FastEthernet1/1            unassigned      YES unset  up                    down
FastEthernet1/2            unassigned      YES unset  up                    down
FastEthernet1/3            unassigned      YES unset  up                    down
FastEthernet1/4            unassigned      YES unset  up                    down
FastEthernet1/5            unassigned      YES unset  up                    down
FastEthernet1/6            unassigned      YES unset  up                    down
FastEthernet1/7            unassigned      YES unset  up                    down
FastEthernet1/8            unassigned      YES unset  up                    down
FastEthernet1/9            unassigned      YES unset  up                    down
FastEthernet1/10           unassigned      YES unset  up                    down
FastEthernet1/11           unassigned      YES unset  up                    down
FastEthernet1/12           unassigned      YES unset  up                    down
FastEthernet1/13           unassigned      YES unset  up                    down
FastEthernet1/14           unassigned      YES unset  up                    down
FastEthernet1/15           unassigned      YES unset  up                    down
Vlan1                      unassigned      YES unset  up                    up
Switch(config)#int vlan1
Switch(config-if)#ip add 192.168.1.1 255.255.255.0
Switch(config-if)#no shut
Switch(config-if)#exit
Switch(config)#
Switch(config)#vlan 10
Switch(config-vlan)#name delfirosales
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name RH
Switch(config-vlan)#exit
Switch(config)#end
Switch#show
*Mar  1 00:08:02.799: %SYS-5-CONFIG_I: Configured from console by console
Switch#show vlan-sw

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa1/0, Fa1/1, Fa1/2, Fa1/3
                             Fa1/4, Fa1/5, Fa1/6, Fa1/7
                             Fa1/8, Fa1/9, Fa1/10, Fa1/11
                             Fa1/12, Fa1/13, Fa1/14, Fa1/15
10   delfirosales                     active
20   RH                               active
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        1002   1003
10   enet  100010     1500  -      -      -        -    -        0      0
20   enet  100020     1500  -      -      -        -    -        0      0
1002 fddi  101002     1500  -      -      -        -    -        1      1003
1003 tr    101003     1500  1005   0      -        -    srb      1      1002
1004 fdnet 101004     1500  -      -      1        ibm  -        0      0
1005 trnet 101005     1500  -      -      1        ibm  -        0      0
Switch#show ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down
FastEthernet0/1            unassigned      YES unset  administratively down down
FastEthernet1/0            unassigned      YES unset  up                    up
FastEthernet1/1            unassigned      YES unset  up                    down
FastEthernet1/2            unassigned      YES unset  up                    down
FastEthernet1/3            unassigned      YES unset  up                    down
FastEthernet1/4            unassigned      YES unset  up                    down
FastEthernet1/5            unassigned      YES unset  up                    down
FastEthernet1/6            unassigned      YES unset  up                    down
FastEthernet1/7            unassigned      YES unset  up                    down
FastEthernet1/8            unassigned      YES unset  up                    down
FastEthernet1/9            unassigned      YES unset  up                    down
FastEthernet1/10           unassigned      YES unset  up                    down
FastEthernet1/11           unassigned      YES unset  up                    down
FastEthernet1/12           unassigned      YES unset  up                    down
FastEthernet1/13           unassigned      YES unset  up                    down
FastEthernet1/14           unassigned      YES unset  up                    down
FastEthernet1/15           unassigned      YES unset  up                    down
Vlan1                      192.168.1.1     YES manual up                    up
Switch#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms
Switch#ping 192.168.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 12/50/116 ms
Switch#
En GNS3 podemos usar un router como switch mediante el uso del modulo NM16-ESW, pero este modulo no tiene todas las funciones de un switches. La lista de funciones que hacen falta son las siguientes.
  • Access Switch Device Manager (SDM) Template
  • ACL – Improved Merging Algorithm
  • ARP Optimization
  • BGP Increased Support of Numbered as-path Access Lists to 500
  • BGP Restart Neighbor Session After max-prefix Limit Reached
  • BGP Route-Map Continue Support for Outbound Policy
  • Clear Counters Per Port
  • DHCP Snooping
  • DHCP Snooping Counters
  • Diagnotics Options on bootup
  • ErrDisable Reactivation Per Port
  • ErrDisable timeout
  • EtherChannel
  • EtherChannel – Flexible PAgP
  • Etherchannel Guard
  • Fallback Bridging
  • Flex Link Bi-directional Fast Convergence
  • Flex Link VLAN Load-Balancing
  • Flex Links Interface Preemption
  • GOLD – Generic Online Diagnostics
  • IEEE 802.1ab, Link Layer Discovery Protocol
  • IEEE 802.1s – Multiple Spanning Tree (MST) Standard Compliance
  • IEEE 802.1s VLAN Multiple Spanning Trees
  • IEEE 802.1t
  • IEEE 802.1W Spanning Tree Rapid Reconfiguration
  • IEEE 802.1x – Auth Fail Open
  • IEEE 802.1x – Auth Fail VLAN
  • IEEE 802.1x – VLAN Assignment
  • IEEE 802.1x – Wake on LAN Support
  • IEEE 802.1x Authenticator
  • IEEE 802.1X Multi-Domain Authentication
  • IEEE 802.1x RADIUS Accounting
  • IEEE 802.1x with Port Security
  • IEEE 802.3ad Link Aggregation (LACP)
  • IEEE 802.3af Power over Ethernet
  • IGMP Fast Leave
  • IGMP Version 1
  • IGRP
  • IP Phone Detection Enhancements
  • IP Phone Enhancement – PHY Loop Detection
  • IPSG (IP Source Guard)
  • Jumbo Frames
  • L2PT – Layer 2 Protocol Tunneling
  • MAC Authentication Bypass
  • MLD Snooping
  • Multicast Etherchannel Load Balancing
  • NAC – L2 IEEE 802.1x
  • NAC – L2 IP
  • NAC – L2 IP with Auth Fail Open
  • Packet-Based Storm Control
  • Per Port Per VLAN Policing
  • Port Security
  • Port Security on Private VLAN Ports
  • Private VLANs
  • QoS Policy Propagation via Border Gateway Protocol (QPPB)
  • Rapid-Per-VLAN-Spanning Tree (Rapid-PVST)
  • Reduced MAC Address Usage
  • Remote SPAN (RSPAN)
  • Smart Port
  • Spanning Tree Protocol (STP) – Loop Guard
  • Spanning Tree Protocol (STP) – Portfast
  • Spanning Tree Protocol (STP) – PortFast BPDU Filtering
  • Spanning Tree Protocol (STP) – Portfast Support for Trunks
  • Spanning Tree Protocol (STP) – Root Guard
  • Spanning Tree Protocol (STP) – Uplink Load Balancing
  • SRR (Shaped Round Robin)
  • Standby Supervisor Port Usage
  • STP Syslog Messages
  • Switching Database Manager (SDM)
  • Trunk Failover
  • Trusted boundary (extended trust for CDP devices)
  • Unicast Mac Filtering
  • UniDirectional Link Detection (UDLD)
  • VLAN Access Control List (VACL)
  • VLAN Aware Port Security
  • Weighted Tail Drop (WTD)

Usando VTP: Configurando Servers y Clientes

Todos los Switches cisco están configurados por defecto como servidores VTP. Para configurar VTP (VLAN Trunking Protocol), primero necesitamos configurar el nombre de dominio, seguido por el modo de funcionamiento del Switch (Modo Server, Modo Cliente, Modo Transparente), establecer una contraseña a VTP (opcional pero si recomendado), todo esto desde configuración global.

En resumen los pasos para configurar VTP, son las siguientes:
Paso 1: Lo primero es configurar que los Switches estén en modo Trunk.
Paso 2: Configurar el Configurar el nombre de dominio
Paso 3: Configurar el modo de funcionamiento del Switch (mode server, mode client, mode tranparent)
Paso 4: Configurar una contraseña (Opcional)
Paso 5: Configurar VTP Pruning en el Servidor (Opcional)
Paso 6: Habilitar VTP versión 2 (Opcional)

En este ejemplo configuraremos tres Switches. El primero lo pondremos en Modo Server, el segundo en Modo Transparente y el tercero en Modo Cliente. Tal como se muestra en la siguiente imagen.


Modos VTP (VLAN Trunking Protocol).

Lo primero es configurar las interfaces donde tenemos conectados los Switches en modo Trunk.

Configurar la interface Fa0/1 en el Switch1.
Switch1#configure terminal
Switch1(config)#int fa0/1
Switch1(config-if)#switchport mode trunk
Switch1(config-if)#end
Switch1#show int trunk

Port        Mode         Encapsulation  Status        Native vlan
Fa0/1       on           802.1q         trunking      1

Port      Vlans allowed on trunk
Fa0/1       1-4094

Port        Vlans allowed and active in management domain
Fa0/1       1

Port        Vlans in spanning tree forwarding state and not pruned
Fa0/1       1

Switch1#show run int fa0/1
Building configuration...

Current configuration : 56 bytes
!
interface FastEthernet0/1
switchport mode trunk
end
Configurar Interfaces Fa0/1 y Fa0/2 en el Switch2.
Switch2#configure terminal
Switch2(config)#int fa0/1
Switch2(config-if)#switchport mode trunk
Switch2(config-if)#exit
Switch2(config)#int fa0/2
Switch2(config-if)#switchport mode trunk
Switch2(config-if)#end
Switch2#show int trunk

Port        Mode         Encapsulation  Status        Native vlan
Fa0/1       on           802.1q         trunking      1
Fa0/2       on           802.1q         trunking      1

Port      Vlans allowed on trunk
Fa0/1       1-4094
Fa0/2       1-4094

Port        Vlans allowed and active in management domain
Fa0/1       1
Fa0/2       1

Port        Vlans in spanning tree forwarding state and not pruned
Fa0/1       1
Fa0/2       1

Switch2#show run int fa0/1
Building configuration...

Current configuration : 56 bytes
!
interface FastEthernet0/1
switchport mode trunk
end

Switch2#show run int fa0/2
Building configuration...

Current configuration : 56 bytes
!
interface FastEthernet0/2
switchport mode trunk
end
Configurar Interface Fa0/1 en el Switch3.
Switch3#configure terminal
Switch3(config)#int f0/1
Switch3(config-if)#switchport mode trunk
Switch3(config-if)#end
Switch3#show int trunk

Port        Mode         Encapsulation  Status        Native vlan
Fa0/1       on           802.1q         trunking      1

Port      Vlans allowed on trunk
Fa0/1       1-4094

Port        Vlans allowed and active in management domain
Fa0/1       1

Port        Vlans in spanning tree forwarding state and not pruned
Fa0/1       1
Switch3#show run int fa0/1
Building configuration...

Current configuration : 56 bytes
!
interface FastEthernet0/1
switchport mode trunk
end
Configurar el nombre de dominio, Modo Server, un password y el VTP Pruning en el Switch1.
Switch1#configure terminal
Switch1(config)#vtp domain delfirosales
Changing VTP domain name from NULL to delfirosales
Switch1(config)#vtp mode server
Device mode already VTP SERVER.
Switch1(config)#vtp password cisco
Setting device VLAN database password to cisco
Switch1(config)#vtp pruning
Pruning switched on
Switch1(config)#end
Switch1#
Verificamos la configuración de VTP en el Switch1
Switch1#show vtp status
VTP Version                     : 2
Configuration Revision          : 4
Maximum VLANs supported locally : 128
Number of existing VLANs        : 8
VTP Operating Mode              : Server
VTP Domain Name                 : delfirosales
VTP Pruning Mode                : Enabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x34 0xFC 0x71 0x0B 0x6F 0x86 0x1B 0x6D
Configuration last modified by 192.168.1.1 at 3-1-93 00:25:41
Local updater ID is 192.168.1.1 on interface Vl1 (lowest numbered VLAN interface found)
Switch1#
Configurar un nombre de dominio, VTP en modo Transparente y un password en el Switch2.
Switch2#configure terminal
Switch2(config)#vtp domain delfirosales
Domain name already set to delfirosales.
Switch2(config)#vtp mode transparent
Setting device to VTP TRANSPARENT mode.
Switch2(config)#vtp password cisco
Setting device VLAN database password to cisco
Switch2(config)#end
Switch2#
Verificamos la configuracion realizada en el Switch2.
Switch2#show vtp status
VTP Version                     : 2
Configuration Revision          : 0
Maximum VLANs supported locally : 128
Number of existing VLANs        : 8
VTP Operating Mode              : Transparent
VTP Domain Name                 : delfirosales
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x6C 0x55 0x26 0x46 0x3B 0xBA 0xAD 0xA1
Configuration last modified by 192.168.1.1 at 3-1-93 00:16:19
Switch2#
Configurar un nombre de dominio, vtp en Modo Cliente y un password en el Switch3.
Switch3#configure terminal
Switch3(config)#vtp domain delfirosales
Domain name already set to delfirosales.
Switch3(config)#vtp mode client
Setting device to VTP CLIENT mode.
Switch3(config)#vtp password cisco
Setting device VLAN database password to cisco
Switch3(config)#end
Switch3#
Verificamos la configuración de VTP.
Switch3#show vtp status
VTP Version                     : 2
Configuration Revision          : 3
Maximum VLANs supported locally : 128
Number of existing VLANs        : 8
VTP Operating Mode              : Client
VTP Domain Name                 : delfirosales
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x84 0xA5 0x24 0x73 0x35 0x8C 0x3F 0x2C
Configuration last modified by 192.168.1.1 at 3-1-93 00:16:19
Switch3#
Hemos terminado de configurar los tres Switches, el primero en modo Server, el segundo en modo Tranparente y el tercero en modo Cliente. Ahora lo que aremos es verificar que VTP funcione correctamente, para esto debemos de saber que funciones realiza cada Switch.

Modo Server: El modo Server como lo mencione anteriormente, esta habilitado por defecto en los switches cisco, necesita al menos un servidor de dominio VTP para propagar la información de las VLANs a través de ese dominio. Un Switch en modo server puede crear, agregar y borrar VLANs. Cuando en un VTP Server se crean o borran las VLANs, esta información se envía a todos los switches conectados, asi que cualquier cambio realizado en un Switch en Modo Server se envia toda la información en todo el dominio VTP.

Modo Transparente: Un Switch en modo Transparente si recibe la información del dominio VTP, el detalle es que no ejecuta ninguna información recibida, mantiene su propia base de datos y solo envía la información de dominio VTP a todos los demas Switches.

Modo Cliente: Los Switches en Modo cliente si reciben la informacion de los servers de VTP, también envían información a los demás Switches, así que el comportamiento de este modo es parecido a los de modo Server. La diferencia es que en este modo no se pueden crear, modificar o borrar VLANs.

VTP Pruning: Habilitar VTP pruning nos da una forma de preservar el ancho de banda mediante la reduccion de paquetes broadcast, multicast y unicast. Lo que hace es darse cuenta que paquetes deben de avanzar hacia el siguiente Switch.

Crear una VLAN en el Switch1 (modo server), esto hará que el Switch2 reciba información de la creación de una VLAN pero no le hará caso, lo que hará es enviar la información al Switch3 (cliente) donde si se creara la VLAN. Vamos a verificar que VTP funcione correctamente.
Switch1#configure terminal
Switch1(config)#vlan 3
Switch1(config-vlan)#name users
Switch1(config-vlan)#end
Switch1#
Verficicamos el estado de VTP y las VLANs en el Switch1 (Modo Server)
Switch1#show vtp status
VTP Version                     : 2
Configuration Revision          : 5
Maximum VLANs supported locally : 128
Number of existing VLANs        : 9
VTP Operating Mode              : Server
VTP Domain Name                 : delfirosales
VTP Pruning Mode                : Enabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x68 0x34 0x28 0xF9 0xBC 0x11 0xFD 0x0D
Configuration last modified by 192.168.1.1 at 3-1-93 00:34:23
Local updater ID is 192.168.1.1 on interface Vl1 (lowest numbered VLAN interface found)
Switch1#
Switch1#show vlan  

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/2, Fa0/3, Fa0/4, Fa0/5
                                      Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                      Fa0/10, Fa0/11, Fa0/12
2    VLAN2                            active
3    users                            active
101  VLAN101                          active
105  VLAN105                          active
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0
2    enet  100002     1500  -      -      -        -    -        0      0
3    enet  100003     1500  -      -      -        -    -        0      0
15   enet  100015     1500  -      -      -        -    -        0      0
101  enet  100101     1500  -      -      -        -    -        0      0

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
105  enet  100105     1500  -      -      -        -    -        0      0
1002 fddi  101002     1500  -      -      -        -    -        0      0
1003 tr    101003     1500  -      -      -        -    -        0      0
1004 fdnet 101004     1500  -      -      -        ieee -        0      0
1005 trnet 101005     1500  -      -      -        ibm  -        0      0

Remote SPAN VLANs
------------------------------------------------------------------------------

Primary Secondary Type              Ports
------- --------- ----------------- ------------------------------------------
Como podemos observar, hemos creado la VLAN 3 llamada users, ahora verificaremos el Switch2, no tiene que tener la VLAN 3 ya que esta en modo transparente.

Verficicar el estado de VTP y las VLANs en el Switch2 (Modo Transparente).
Switch2#show vtp status
VTP Version                     : 2
Configuration Revision          : 0
Maximum VLANs supported locally : 128
Number of existing VLANs        : 8
VTP Operating Mode              : Transparent
VTP Domain Name                 : delfirosales
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x6C 0x55 0x26 0x46 0x3B 0xBA 0xAD 0xA1
Configuration last modified by 192.168.1.1 at 3-1-93 00:16:19
Switch2#show vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/3, Fa0/4, Fa0/5, Fa0/6
                                   Fa0/7, Fa0/8, Fa0/9, Fa0/10
                                   Fa0/11, Fa0/12
2    VLAN2                            active
101  VLAN101                          active
105  VLAN105                          active
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0
2    enet  100002     1500  -      -      -        -    -        0      0
101  enet  100101     1500  -      -      -        -    -        0      0
105  enet  100105     1500  -      -      -        -    -        0      0
1002 fddi  101002     1500  -      -      -        -    -        0      0
1003 tr    101003     1500  -      -      -        -    srb      0      0
1004 fdnet 101004     1500  -      -      -        ieee -        0      0

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1005 trnet 101005     1500  -      -      -        ibm  -        0      0

Remote SPAN VLANs
------------------------------------------------------------------------------

Primary Secondary Type              Ports
------- --------- ----------------- ------------------------------------------
Tal como se muestra no se creo ninguna VLAN, pero si debió de enviar la información al Switch3 donde tiene que haber creado la VLAN 3. Asi que vamos a ver que paso en el Switch3.

Verficicar el estado de VTP y las VLANs en el Switch3 (Modo Cliente).
Switch3#show vtp status
VTP Version                     : 2
Configuration Revision          : 5
Maximum VLANs supported locally : 128
Number of existing VLANs        : 9
VTP Operating Mode              : Client
VTP Domain Name                 : delfirosales
VTP Pruning Mode                : Enabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x68 0x34 0x28 0xF9 0xBC 0x11 0xFD 0x0D
Configuration last modified by 192.168.1.1 at 3-1-93 00:34:23
Switch3#show vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/2, Fa0/3, Fa0/4, Fa0/5
                                   Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                   Fa0/10, Fa0/11, Fa0/12
2    VLAN2                            active
3    users                            active
101  VLAN101                          active
105  VLAN105                          active
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0
2    enet  100002     1500  -      -      -        -    -        0      0
3    enet  100003     1500  -      -      -        -    -        0      0
101  enet  100101     1500  -      -      -        -    -        0      0
105  enet  100105     1500  -      -      -        -    -        0      0
1002 fddi  101002     1500  -      -      -        -    -        0      0

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1003 tr    101003     1500  -      -      -        -    srb      0      0
1004 fdnet 101004     1500  -      -      -        ieee -        0      0
1005 trnet 101005     1500  -      -      -        ibm  -        0      0

Remote SPAN VLANs
------------------------------------------------------------------------------

Primary Secondary Type              Ports
------- --------- ----------------- ------------------------------------------
Como podemos observar el Switch3 ha creado la VLAN 3 llamada users creada desde el Switch1 Modo Server. Tambien podemos observar que el vtp pruning esta habilita en el Switch3 aunque lo hallamos habilitado desde el Switch1.

Ahora en el Switch3 si tratamos de crear vlans en el switch3, no podremos crearlas ni borrarlas.
Switch3#configure terminal
Switch3(config)#vlan 10
VTP VLAN configuration not allowed when device is in CLIENT mode.
Switch3(config)#
En cambio en el Switch2 modo tranparente si podemos crear vlans, pero se quedan en su base de datos, no se envían la información a los demás Switches.
Switch2#configure terminal
Switch2(config)#vlan 20
Switch2(config-vlan)#name VLAN20
Switch2(config-vlan)#exit
Switch2(config)#end
Switch2#show vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/3, Fa0/4, Fa0/5, Fa0/6
                                   Fa0/7, Fa0/8, Fa0/9, Fa0/10
                                   Fa0/11, Fa0/12
2    VLAN2                            active
20   VLAN20                           active
101  VLAN101                          active
105  VLAN105                          active
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup
Switch2#
En el Switch1 y el Switch3 no se crea ninguna VLAN, ya que el modo tranparente no participa en el dominio VTP pero si recibe y envia la informacion a los diferentes Switches.

Switch1
Switch1#show vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/2, Fa0/3, Fa0/4, Fa0/5
                                   Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                   Fa0/10, Fa0/11, Fa0/12
2    VLAN2                            active
3    users                            active
101  VLAN101                          active
105  VLAN105                          active
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup
Switch1#
Switch2
Switch3#show vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/2, Fa0/3, Fa0/4, Fa0/5
                                   Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                   Fa0/10, Fa0/11, Fa0/12
2    VLAN2                            active
3    users                            active
101  VLAN101                          active
105  VLAN105                          active
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup
Switch3#
Si se te ha olvidado el password de VTP
Switch3#show vtp password
VTP Password: cisco
Switch3#
Algo basico en la configuracion de VTP (VLAN Trunking Protocol).

Backup & Upgrade del IOS de un Switch Cisco

En este poste veremos como realizar un Backup y Actualizar el IOS de un Switch Catalyst Cisco. En este ejemplo utilice un Switch 2950. Así que primero veremos como realizar el backup del IOS y después realizaremos la actualización. Lo primero que haremos es configurarle una IP al Switch, para esto hacemos lo siguiente.
Switch#conf t
Switch(config)#int vlan1
Switch(config-if)#ip address 192.168.1.1 255.255.255.0
Switch(config-if)#no shut
Switch(config-if)#end
Switch#
Visualizamos la configuración.
Interface                  IP-Address      OK? Method Status                Protocol
VLAN1                      192.168.1.1     YES manual up                    up 
FastEthernet0/1            unassigned      YES unset  down                  down
FastEthernet0/2            unassigned      YES unset  down                  down
FastEthernet0/3            unassigned      YES unset  down                  down
FastEthernet0/4            unassigned      YES unset  down                  down
FastEthernet0/5            unassigned      YES unset  down                  down
FastEthernet0/6            unassigned      YES unset  down                  down
FastEthernet0/7            unassigned      YES unset  down                  down
FastEthernet0/8            unassigned      YES unset  down                  down
FastEthernet0/9            unassigned      YES unset  down                  down
FastEthernet0/10           unassigned      YES unset  down                  down
FastEthernet0/11           unassigned      YES unset  down                  down
FastEthernet0/12           unassigned      YES unset  up                    up
Como podemos ver, ya tiene una dirección IP la interface VLAN1 y esta en "UP". También se puede visualizar que en la interface FastEthernet0/12 esta UP porque ahí tengo conectado el cable Crosover a la PC.

Ahora para confirmar que tenemos conectividad, hacemos un Ping a la PC.
Switch#ping 192.168.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is 2 seconds:
!!!!!
Una vez probada la conectividad, ahora por seguridad toca realizar un Backup al IOS que tiene el Switch, para este teclear el comando "copy flash tftp".
Switch#copy flash tftp
Source filename []? c2950-c3h2s-mz.120-5.3.WC.1.bin
Address or name of remote host []? 192.168.1.3
Destination filename [c2950-c3h2s-mz.120-5.3.WC.1.bin]?
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1674921 bytes copied in 30.800 secs (55830 bytes/sec)
Switch#
En Source filename []? ponemos el nombre del IOS a respaldar. Si no sabes el nombre del IOS puedes teclear el comando "show flash" para ver el nombre de IOS. En Address or name of remote host []? ponemos el nombre del servidor TFTP, en este caso es la direccion de la PC 192.168.1.3. En Destination filename [c2950-c3h2s-mz.120-5.3.WC.1.bin]? nos pregunta si sera el mismo nombre para guardarlo en el destino. Una vez realizado el Backup del IOS, ahora si toca actualizar el IOS.

Upgrade del IOS.

Para realizar un upgrade, tenemos que teclear el comando "copy tftp flash" en consola. Tal como se muestra a continuación.
Switch#copy tftp flash
Address or name of remote host []? 192.168.1.3
Source filename []? c2950-i6k2l2q4-mz.121-22.EA11.bin
Destination filename [c2950-i6k2l2q4-mz.121-22.EA11.bin]?
Accessing tftp://192.168.1.3/c2950-i6k2l2q4-mz.121-22.EA11.bin...
Loading c2950-i6k2l2q4-mz.121-22.EA11.bin from 192.168.1.3 (via VLAN1): !!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 3721126 bytes]

3721126 bytes copied in 116.188 secs (32078 bytes/sec)
Switch#
En Address or name of remote host []? Tecleamos la dirección IP del servidor TFTP, en este caso la PC 192.168.1.3. En Source filename []? Aqui nos pregunta el nombre del IOS a copiar del servidor TFTP. En este caso es un IOS mas actualizado de nombre c2950-i6k2l2q4-mz.121-22.EA11.bin. En Destination filename [c2950-i6k2l2q4-mz.121-22.EA11.bin]? Pregunta el que nombre tendra en el destino. Podemos teclear cualquier nombre o en este caso dejarlo el nombre del IOS. Y como se puedes ver se ha copiado correctamente.
Para comprobar si se ha copiado a la flash tecleamos el comando "show flash".
Switch#show flash

Directory of flash:/

  2  -rwx     1674921   Apr 30 2001 15:09:51  c2950-c3h2s-mz.120-5.3.WC.1.bin
  3  -rwx         220   Jan 01 1970 00:00:52  env_vars
  4  drwx       10176   Jan 01 1970 00:00:23  html
  5  -rwx         813   Mar 01 1993 00:34:06  config.text
165  -rwx         780   Mar 01 1993 00:15:23  vlan.dat
166  -rwx     3721126   Mar 01 1993 00:12:45  c2950-i6k2l2q4-mz.121-22.EA11.bin
Ahora lo que aremos es eliminar el IOS que tenia el switch, para esto tecleamos el comando "delete flash:nombredelios".
Switch#delete flash:c2950-c3h2s-mz.120-5.3.WC.1.bin
Delete filename [c2950-c3h2s-mz.120-5.3.WC.1.bin]?
Delete flash:c2950-c3h2s-mz.120-5.3.WC.1.bin? [confirm]
Switch#
Le indicamos que inicie desde el IOS actualizado y guardamos la configuración.
Switch#conf t
Switch(config)#boot ? 
boothlpr            Boot Helper System Image
buffersize          Specify the buffer size for filesystem-simulated NVRAM
config-file         Configuration File
enable-break        Enable Break while booting
helper              Helper Image(s)
helper-config-file  Helper Configuration File
manual              Manual Boot
system              System Image

Switch(config)#boot system flash:c2950-i6k2l2q4-mz.121-22.EA11.bin
Switch(config)#end
Switch#wr
Building configuration...
[OK]
Switch#
Comprobamos la configuración.
Switch#show boot
BOOT path-list:      flash:c2950-i6k2l2q4-mz.121-22.EA11.bin
Config file:         flash:config.text
Enable Break:        no
Manual Boot:         no
HELPER path-list:
NVRAM/Config file
buffer size:   32768
Switch#
Ahora reiniciamos el switch.
Switch#reload
Proceed with reload? [confirm]
Una vez reiniciado el switch iniciara con el IOS actualizado, lo podemos verificar con el comando "show version".
Switch#show ver
Cisco Internetwork Operating System Software
IOS (tm) C2950 Software (C2950-I6K2L2Q4-M), Version 12.1(22)EA11, RELEASE SOFTWARE (fc2)
Copyright (c) 1986-2008 by cisco Systems, Inc.
Compiled Tue 08-Jan-08 11:12 by amvarma
Image text-base: 0x80010000, data-base: 0x80680000

ROM: Bootstrap program is C2950 boot loader

Switch uptime is 0 minutes
System returned to ROM by power-on
System image file is "flash:c2950-i6k2l2q4-mz.121-22.EA11.bin"

This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:
https://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
export@cisco.com.

cisco WS-C2950-12 (RC32300) processor (revision B0) with 19912K bytes of memory.
Processor board ID FAB0534Q2CW
Last reset from system-reset
Running Standard Image
12 FastEthernet/IEEE 802.3 interface(s)

32K bytes of flash-simulated non-volatile configuration memory.
Base ethernet MAC Address: 00:06:52:C4:9D:40
Motherboard assembly number: 73-5782-08
Motherboard serial number: FAB0531A2YT
Model revision number: B0
Model number: WS-C2950-12
System serial number: FAB0534Q2CW
Configuration register is 0xF
Tambien podemos comprobar que el Switch tiene mas opciones de configuración, por ejemplo, este equipo con el cual estoy realizando el ejemplo, ya lo habia utilizado para crear VLANs mostrado en este post. Y como se pude observar, para crear una VLAN es diferente ya que tienes que teclear el comando "vlan database" y empezar a crear las VLANs. Ahora con el IOS actualizado se puede realizar desde la configuracion global.


Switch#conf t
Switch(config)#vlan ?
WORD      ISL VLAN IDs 1-4094
internal  internal VLAN
Switch(config)#vlan 10
Switch(config-vlan)#name VLAN10
Switch(config-vlan)#end
Switch#
Switch#show vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/5, Fa0/6, Fa0/7
                                   Fa0/8, Fa0/9, Fa0/10, Fa0/11
                                   Fa0/12
2    VLAN2                            active    Fa0/2
3    VLAN3                            active    Fa0/3
4    VLAN4                            active    Fa0/4
10   VLAN10                           active
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        1002   1003
2    enet  100002     1500  -      -      -        -    -        0      0
3    enet  100003     1500  -      -      -        -    -        0      0
4    enet  100004     1500  -      -      -        -    -        0      0
10   enet  100010     1500  -      -      -        -    -        0      0
1002 fddi  101002     1500  -      -      -        -    -        1      1003

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1003 tr    101003     1500  1005   -      -        -    srb      1      1002
1004 fdnet 101004     1500  -      -      1        ibm  -        0      0
1005 trnet 101005     1500  -      -      1        ibm  -        0      0

Remote SPAN VLANs
------------------------------------------------------------------------------

Primary Secondary Type              Ports
------- --------- ----------------- ------------------------------------------

Switch#