Escolar Documentos
Profissional Documentos
Cultura Documentos
2.
3.
Introduccin a STP.......................................................................................................................................... 1
1.1.
1.2.
1.3.
1.4.
1.5.
2.2.
Configuracin de STP.......................................................................................................................... 5
2.3.
Configuracin de Etherchannel............................................................................................................ 6
3.2.
Configuracin de STP.......................................................................................................................... 7
3.3.
Configuracin de Etherchannel............................................................................................................ 8
1. Introduccin a STP
Objetivo: construir una topologa libre de bucles (en rbol) con los caminos ptimos (de mnimo coste). Los
puertos que no forman parte del rbol se bloquean.
El coste se calcula en base a la velocidad de transmisin:
Velocidad de transmisin
10 Gbps
1 Gbps
100Mbps
10 Mbps
Coste
2
4
19
100
Inicialmente todos los switches suponen que son Root Bridge, todos sus puertos son Designated Ports y
generan BPDUs con Root BID = Sender BID.
Si un switch recibe una BPDU con un Root BID menor, deja de generar BPDUs y asume ese BID como Root
BID. En poco tiempo slo genera BPDUs el RB. Los dems switches modifican el Root Path Cost, Sender
BID y Port ID antes de enviar la BPDU. El RB enva BPDUs por todos los puertos. Los dems switches slo
se envian los BPDUs recibidos por el Root Port.
La prioridad se puede configurar manualmente. Inicialmente vale 0x8000 (32768). Hay que configurar el
valor menor en el switch que se desee sea el RB
La eleccin del RB es importante: debe ser el switch ms centralizado, para tener un rbol en forma de
estrella (ver la Figura 2).
Eleccin incorrecta del RB:
Spanning
tree
RB
RB
Figura 2: Eleccin del Root Bridge.
Todos los puertos del RB son Designated Ports, exceptuando aquellos que formen un bucle de nivel 1 (dos
puertos conectados a un hub, o entre ellos con un cable cruzado).
Para los dems switches:
Los puertos por los que no se reciben BPSUs son Desingated Ports.
Los puertos por los que se reciben BPDUs y no son Root Ports: se compara la informacin de las BPDUs
recibidas y enviadas por ese puerto. El puerto es Designated Port si cumple la siguiente secuencia de
condiciones (ver la Figura 3):
1.
2.
3.
4.
BPDU-3 S3
BPDU-1
S2
S1
BPDU-2
BPDU-4
RB
BID-S4 = 80:00:00:00:00:44:44:44
BPDU-5
BPDU-6
S4
STP cost = 19
BPDU-3: Root BID = BID-S1, Sender BID = BID-S2
Root Ports
Designated Ports
Puerto bloqueado
RB
Estados de STP
Los puertos pueden estar en uno de los siguientes estados (ver la Figura 4):
Blocking No se hace forwarding de las tramas. Se escuchan BPDUs. Es el estado inicial.
Listening - No se hace forwarding de las tramas. Se escuchan/transmiten BPDUs (construccin del rbol).
Learning - No se hace forwarding de las tramas. Se aprenden direcciones. Se escuchan/transmiten BPDUs
Forwarding - Se hace forwarding de las tramas y se aprenden direcciones. Se escuchan/transmiten BPDUs
Disabled - No se hace forwarding de las tramas ni se escuchan/transmiten BPDUs. Puerto shutdown.
En los cambios de estado intervienen los siguientes temporizadores:
Hello: tiempo etre BPDUs enviadas por un switch Root Bridge (2 segundos).Forward: tiempo en los estados
de listening/learning (15 segundos).
Max Age.: Tiempo mximo en que se guarda una BPDU (20 segundos). Si en ese tiempo no se reciben otras
BPDUs, se pasa al estado de construccin del rbol STP (listening).
Transicin entre estados:
1. Inicializacin o no shutdown.
2. Puerto seleccionado como Root o Designated, o expira el timer Max.
Age (20 segundos).
3. Expira el timer forwarding (15 segundos).
4. El puerto deja de ser Root o Designated. Inicialmente todos los switches
suponen que son Root Bridge y todos sus puertos Designated Ports.
5. Shutdown
Especficos de CISCO:
disabled
6
blocking
5
2
4
listening
forwarding
4
learning
3
5
La entradas de la tabla MAC tienen un max-age-timer por defecto de 300 segundos (5 minutos). Es decir, si no
se ve llegar una trama con direccin fuente igual a la de la tabla durante 300 segundos, la entrada se elimina.
Esto implica que si se produce un cambio en la topologa del STP, pueden hacer falta hasta 5 minutos hasta que
El switch 1900 entra por defecto en un modo de configuracin por mens. Para entrar en el CLI, pulsar [k]
Command Line en el men. Para volver al men, ejecutar el comando:
Switch# menu
Para poder acceder al switch remotamente con una sesin telnet hace falta asignar una direccin IP y activar un
password para acceder al modo privileged Exec (level 15):
Switch#conf term
Switch(config)#ip add 192.168.10.1 255.255.255.0
Switch(config)#enable password level 15 cisco
Switch(config)#exit
La direccin IP asignada al switch debe pertenecer a la VLAN1. Puede cambiarse a otra VLAN con el comando
ip mgmt-vlan.
2.2.
Configuracin de STP
Para ajustar los parmetros se definen templates y se aplican a una vlan (cada vlan crea un rbol STP
independiente). Por defecto la template 1 se aplica a todas la vlanes.
Para asignar un template a una vlan:
Switch(config)# spantree-template bridge-template-id vlan vlan-list
Verificacin:
Switch# show spantree-template [bridge-template-id]
Switch# show spantree [bridge-group | vlan]
Por ejemplo, para ver el estado de STP en los puertos con la VLAN9 activa:
2.3.
Configuracin de Etherchannel
El switch 1900 permite agrupar 2 puertos fastethernet, incrementando as el ancho de banda e introduciendo
redundancia (ver la Figura 5). Los dos puertos deben pertenecer a la misma VLAN o ser trunk.
Switch 1900
Switch 1900
fa0/26
fa0/26
fa0/27
fa0/27
port-channel preserve-order
Para la formacin del etherchannel los switches 1900 usan el llamado Port Aggregation Protocol (PAgP). Con
este protocolo los switches se envan unas tramas para negociar los parmetros para la configuracin del
etherchannel. El comando port-channel template-port permite especificar qu parmetros deben usarse. Hay que
usar el comando pagp-port-priority para indicar la interfaz por donde se envan las tramas PAgP.
Ejemplo de configuracin de un etherchannel:
Switch(config)# port-channel mode on
Switch(config)# port-channel template-port fastethernet 0/26
Switch(config)# interface fastethernet 0/26
Switch(config-if)# pagp-port-priority 100
Verificacin:
Switch# show interfaces
Para poder acceder al switch remotamente con una sesin telnet hace falta asignar una direccin IP a una VLAN
y activar un password para acceder al privileged Exec y para los terminales vty:
3.2.
Configuracin de STP
Descripcin:
vlan-id
VLAN range associated with a spanning-tree instance. You can specify a single
VLAN identified by VLAN ID number, a range of VLANs separated by a hyphen, or a
series of VLANs separated by a comma. The range is 1 to 4094 when the enhanced
software image (EI) is installed and 1 to 1005 when the standard software image
(SI) is installed.
forward-time
seconds
Set the forward-delay time for the specified spanning-tree instance. The
forwarding time determines how long each of the listening and learning states
last before the interface begins forwarding. The range is 4 to 30 seconds
hello-time
seconds
Set the interval between hello bridge protocol data units (BPDUs) sent by the
root switch configuration messages. The range is 1 to 10 seconds.
max-age
seconds
Set the interval between messages the spanning tree receives from the root
switch. If a switch does not receive a BPDU message from the root switch within
this interval, it recomputes the spanning-tree topology. The range is 6 to 40
seconds.
priority
priority
Set the switch priority for the specified spanning-tree instance. This setting
affects the likelihood that the switch is selected as the root switch. A lower
value increases the probability that the switch is selected as the root switch.
The range is 0 to 61440 in increments of 4096. Valid priority values are 4096,
8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152,
53248, 57344, and 61440. All other values are rejected.
root primary
root
secondary
Set this switch to be the root switch should the primary root switch fail.
diameter
net-diameter
Set the maximum number of switches between any two end stations. The range is 2
to 7.
Verificacin:
Switch# show spanning-tree active
Por ejemplo, para ver el estado de STP en los puertos con la VLAN8 activa:
Switch#sh spanning-tree vlan 8
VLAN0008
Spanning tree enabled protocol ieee
Root ID
Priority
32776
Address
000a.b7e6.7e00
Cost
19
Port
25 (GigabitEthernet0/1)
Hello Time
2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID
Priority
32776 (priority 32768 sys-id-ext 8)
Address
000f.f7d5.e040
Hello Time
2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface
---------------Gi0/1
Gi0/2
3.3.
Role
---Root
Altn
Sts
--FWD
BLK
Cost
--------19
19
Prio.Nbr
-------128.25
128.26
Type
-------------------------------P2p
P2p
Configuracin de Etherchannel
El switch 2950 permite agrupar puertos, incrementando as el ancho de banda e introduciendo redundancia. Los
dos puertos deben pertenecer a la misma VLAN o ser trunk.
Para configurar un etherchannel primero se crea con el comando interface port-channel port-channel-number y
despus se asignan los puertos con el comando channel-group. Para la formacin del etherchannel puede usarse
el Port Aggregation Protocol (PAgP).
Ejemplo de configuracin:
Switch(config)# interface port-channel 1
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# channel-group 1 mode on
Verificacin:
Switch# show etherchannel [channel-group-number] {detail | load-balance | port | port-channel
| summary}
Switch# show pagp [channel-group-number]