Tải bản đầy đủ (.pdf) (38 trang)

cisco press ccna portable command guide 2nd edition 640 802 phần 5 pot

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (5.03 MB, 38 trang )

VLAN Trunking Protocol (VTP) 127
TIP: With the switchport trunk encapsulation negotiate command set, the
preferred trunking method is ISL.
CAUTION: The 2960 series switch supports only dot1q trunking.
VLAN Trunking Protocol (VTP)
VTP is a Cisco proprietary protocol that allows for VLAN configuration (addition, deletion,
or renaming of VLANs) to be consistently maintained across a common administrative
domain.
Using Global Configuration Mode
3560Switch(config-if)
#
ss
ss
ww
ww
ii
ii
tt
tt
cc
cc
hh
hh
pp
pp
oo
oo
rr
rr
tt
tt




tt
tt
rr
rr
uu
uu
nn
nn
kk
kk


ee
ee
nn
nn
cc
cc
aa
aa
pp
pp
ss
ss
uu
uu
ll
ll

a
a
aa
tt
tt
ii
ii
oo
oo
nn
nn


nn
nn
ee
ee
gg
gg
oo
oo
tt
tt
ii
ii
aa
aa
tt
tt
ee

ee
Specifies that the interface negotiate with
the neighboring interface to become either
an ISL or dot1q trunk, depending on the
capabilities or configuration of the
neighboring interface
Switch(config)#vv
vv
tt
tt
pp
pp


mm
mm
oo
oo
dd
dd
ee
ee


cc
cc
ll
ll
ii
ii

ee
ee
nn
nn
tt
tt
Changes the switch to VTP client mode.
Switch(config)#vv
vv
tt
tt
pp
pp


mm
mm
oo
oo
dd
dd
ee
ee


ss
ss
ee
ee
rr

rr
vv
vv
ee
ee
rr
rr
Changes the switch to VTP server mode.
Switch(config)#vv
vv
tt
tt
pp
pp


mm
mm
oo
oo
dd
dd
ee
ee


tt
tt
rr
rr

aa
aa
nn
nn
ss
ss
pp
pp
aa
aa
rr
rr
ee
ee
nn
nn
tt
tt
Changes the switch to VTP transparent mode.
NOTE: By default, all Catalyst switches are in
server mode.
Switch(config)#nn
nn
oo
oo


vv
vv
tt

tt
pp
pp


mm
mm
oo
oo
dd
dd
ee
ee
Returns the switch to the default VTP server
mode.
Switch(config)#vv
vv
tt
tt
pp
pp


dd
dd
oo
oo
mm
mm
aa

aa
ii
ii
nn
nn

domain-name
Configures the VTP domain name. The name
can be from 1 to 32 characters long.
NOTE: All switches operating in VTP server or
client mode must have the same domain name
to ensure communication.
Switch(config)#vv
vv
tt
tt
pp
pp


pp
pp
aa
aa
ss
ss
ss
ss
ww
ww

oo
oo
rr
rr
dd
dd

password
Configures a VTP password. In Cisco IOS
Software Release 12.3 and later, the password is
an ASCII string from 1 to 32 characters long. If
you are using a Cisco IOS Software release
earlier than 12.3, the password length ranges
from 8 to 64 characters long.
128 VLAN Trunking Protocol (VTP)
NOTE: Only VLANs included in the pruning-eligible list can be pruned. VLANs 2
through 1001 are pruning eligible by default on trunk ports. Reserved VLANs
and extended-range VLANs cannot be pruned. To change which eligible
VLANs can be pruned, use the interface-specific switchport trunk pruning
vlan command:
Switch(config-if)#ss
ss
ww
ww
ii
ii
tt
tt
cc
cc

hh
hh
pp
pp
oo
oo
rr
rr
tt
tt


tt
tt
rr
rr
uu
uu
nn
nn
kk
kk


pp
pp
rr
rr
uu
uu

nn
nn
ii
ii
nn
nn
gg
gg


vv
vv
ll
ll
aa
aa
nn
nn


rr
rr
ee
ee
mm
mm
oo
oo
vv
vv

ee
ee


44
44
,,
,,


22
22
00
00


33
33
00
00
! Removes VLANs 4 and 20-30
Switch(config-if)#
ss
ss
ww
ww
ii
ii
tt
tt

cc
cc
hh
hh
pp
pp
oo
oo
rr
rr
tt
tt


tt
tt
rr
rr
uu
uu
nn
nn
kk
kk


pp
pp
rr
rr

uu
uu
nn
nn
ii
ii
nn
nn
gg
gg


vv
vv
ll
ll
aa
aa
nn
nn


ee
ee
xx
xx
cc
cc
ee
ee

pp
pp
tt
tt


44
44
00
00


55
55
00
00
! All VLANs are added to the pruning list except for 40-50
Using VLAN Database Mode
CAUTION: The VLAN database mode has been deprecated and will be removed
in some future Cisco IOS release. Recommended practice dictates using only
the VLAN configuration mode.
NOTE: To communicate with each other, all
switches must have the same VTP password set.
Switch(config)#vv
vv
tt
tt
pp
pp



vv
vv
22
22


mm
mm
oo
oo
dd
dd
ee
ee
Sets the VTP domain to Version 2. This
command is for Cisco IOS Software Release
12.3 and later. If you are using a Cisco IOS
Software release earlier than 12.3, the command
is vtp version 2.
NOTE: VTP Versions 1 and 2 are not
interoperable. All switches must use the same
version. The biggest difference between
Versions 1 and 2 is that Version 2 has support
for Token Ring VLANs.
Switch(config)#vv
vv
tt
tt
pp

pp


pp
pp
rr
rr
uu
uu
nn
nn
ii
ii
nn
nn
gg
gg
Enables VTP pruning.
NOTE: By default, VTP pruning is disabled.
You need to enable VTP pruning on only
1 switch in VTP server mode.
Switch##
##
vv
vv
ll
ll
aa
aa
nn

nn


dd
dd
aa
aa
tt
tt
aa
aa
bb
bb
aa
aa
ss
ss
ee
ee
Enters VLAN database mode.
Switch(vlan)##
##
vv
vv
tt
tt
pp
pp



cc
cc
ll
ll
ii
ii
ee
ee
nn
nn
tt
tt
Changes the switch to VTP client mode.
Switch(vlan)##
##
vv
vv
tt
tt
pp
pp


ss
ss
ee
ee
rr
rr
vv

vv
ee
ee
rr
rr
Changes the switch to VTP server mode.
Switch(vlan)##
##
vv
vv
tt
tt
pp
pp


tt
tt
rr
rr
aa
aa
nn
nn
ss
ss
pp
pp
aa
aa

rr
rr
ee
ee
nn
nn
tt
tt
Changes the switch to VTP transparent mode.
NOTE: By default, all Catalyst switches are in server
mode.
VLAN Trunking Protocol (VTP) 129
Switch(vlan)##
##
vv
vv
tt
tt
pp
pp


dd
dd
oo
oo
mm
mm
aa
aa

ii
ii
nn
nn


dd
dd
oo
oo
mm
mm
aa
aa
ii
ii
nn
nn


nn
nn
aa
aa
mm
mm
ee
ee
Configures the VTP domain name. The name can be
from 1 to 32 characters long.

NOTE: All switches operating in VTP server or client
mode must have the same domain name to ensure
communication.
Switch(vlan)##
##
vv
vv
tt
tt
pp
pp


pp
pp
aa
aa
ss
ss
ss
ss
ww
ww
oo
oo
rr
rr
dd
dd



pp
pp
aa
aa
ss
ss
ss
ss
ww
ww
oo
oo
rr
rr
dd
dd
Configures a VTP password. In Cisco IOS Software
Release 12.3 and later, the password is an ASCII string
from 1 to 32 characters long. If you are using a Cisco
IOS release earlier than 12.3, the password length
ranges from 8 to 64 characters long.
NOTE: All switches must have the same VTP
password set to communicate with each other.
Switch(vlan)##
##
vv
vv
tt
tt

pp
pp


vv
vv
22
22


mm
mm
oo
oo
dd
dd
ee
ee
Sets the VTP domain to Version 2. This command is
for Cisco IOS Release 12.3 and later. If you are using a
Cisco IOS release earlier than 12.3, the command is
vtp version 2.
NOTE: VTP Versions 1 and 2 are not interoperable.
All switches must use the same version. The
biggest difference between Versions 1 and 2 is that
Version 2 has support for Token Ring VLANs.
Switch(vlan)##
##
vv
vv

tt
tt
pp
pp


pp
pp
rr
rr
uu
uu
nn
nn
ii
ii
nn
nn
gg
gg
Enables VTP pruning.
NOTE: By default, VTP pruning is disabled. You
need to enable VTP pruning on only one switch in
VTP server mode.
NOTE: Only VLANs included in the pruning-eligible
list can be pruned. VLANs 2 through 1001 are pruning
eligible by default on trunk ports. Reserved VLANs
and extended-range VLANs cannot be pruned. To
change which eligible VLANs can be pruned, use the
interface-specific switchport trunk pruning vlan

command:
Switch(config-if)##
##
ss
ss
ww
ww
ii
ii
tt
tt
cc
cc
hh
hh
pp
pp
oo
oo
rr
rr
tt
tt


tt
tt
rr
rr
uu

uu
nn
nn
kk
kk


pp
pp
rr
rr
uu
uu
nn
nn
ii
ii
nn
nn
gg
gg


vv
vv
ll
ll
aa
aa
nn

nn


rr
rr
ee
ee
mm
mm
oo
oo
vv
vv
ee
ee


44
44
,,
,,


22
22
00
00


33

33
00
00
Removes VLANs 4 and 20 through 30.
Switch(config-if)##
##
ss
ss
ww
ww
ii
ii
tt
tt
cc
cc
hh
hh
pp
pp
oo
oo
rr
rr
tt
tt


tt
tt

rr
rr
uu
uu
nn
nn
kk
kk


pp
pp
rr
rr
uu
uu
nn
nn
ii
ii
nn
nn
gg
gg


vv
vv
ll
ll

aa
aa
nn
nn


ee
ee
xx
xx
cc
cc
ee
ee
pp
pp
tt
tt


44
44
00
00


55
55
00
00

All VLANs are added to the pruning list except for 40
through 50.
Switch(vlan)##
##
ee
ee
xx
xx
ii
ii
tt
tt
Applies changes to the VLAN database, increases the
revision number by 1, and exits back to privileged
mode.
130 Inter-VLAN Communication Using an External Router: Router-on-a-Stick
Verifying VTP
NOTE: If trunking has been established before VTP is set up, VTP information
is propagated throughout the switch fabric almost immediately. However,
because VTP information is advertised only every 300 seconds (5 minutes),
unless a change has been made to force an update, it can take several minutes
for VTP information to be propagated.
Inter-VLAN Communication Using an External Router:
Router-on-a-Stick
Switch#ss
ss
hh
hh
oo
oo

ww
ww


vv
vv
tt
tt
pp
pp


ss
ss
tt
tt
aa
aa
tt
tt
uu
uu
ss
ss
Displays general information about VTP configuration
Switch#ss
ss
hh
hh
oo

oo
ww
ww


vv
vv
tt
tt
pp
pp


cc
cc
oo
oo
uu
uu
nn
nn
tt
tt
ee
ee
rr
rr
ss
ss
Displays the VTP counters for the switch

Router(config)##
##
ii
ii
nn
nn
tt
tt
ee
ee
rr
rr
ff
ff
aa
aa
cc
cc
ee
ee


ff
ff
aa
aa
ss
ss
tt
tt

ee
ee
tt
tt
hh
hh
ee
ee
rr
rr
nn
nn
ee
ee
tt
tt


00
00
/
/
//
00
00
Moves to interface configuration mode.
Router(config-if)##
##
dd
dd

uu
uu
pp
pp
ll
ll
ee
ee
xx
xx


ff
ff
uu
uu
ll
ll
ll
ll
Sets the interface to full duplex.
Router(config-if)##
##
nn
nn
oo
oo


ss

ss
hh
hh
uu
uu
tt
tt
dd
dd
oo
oo
ww
ww
nn
nn
Enables the interface.
Router(config-if)##
##
ii
ii
nn
nn
tt
tt
ee
ee
rr
rr
ff
ff

aa
aa
cc
cc
ee
ee


ff
ff
aa
aa
ss
ss
tt
tt
ee
ee
tt
tt
hh
hh
ee
ee
rr
rr
nn
nn
ee
ee

tt
tt


00
00
/
/
//
00
00


11
11
Creates subinterface 0/0.1 and moves to
subinterface configuration mode.
Router(config-subif)##
##
dd
dd
ee
ee
ss
ss
cc
cc
rr
rr
ii

ii
pp
pp
tt
tt
ii
ii
oo
oo
nn
nn


MM
MM
aa
aa
nn
nn
aa
aa
gg
gg
ee
ee
mm
mm
ee
ee
nn

nn
tt
tt


VV
VV
L
L
LL
AA
AA
NN
NN


11
11
(Optional) Sets the locally significant
description of the subinterface.
Router(config-subif)
##
##
ee
ee
nn
nn
cc
cc
aa

aa
pp
pp
ss
ss
uu
uu
ll
ll
aa
aa
tt
tt
ii
ii
oo
oo
nn
nn


dd
dd
oo
oo
tt
tt
11
11
qq

qq


11
11


nn
nn
aa
aa
tt
tt
ii
ii
vv
vv
ee
ee
Assigns VLAN 1 to this subinterface.
VLAN 1 will be the native VLAN. This
subinterface will use the 802.1q trunking
protocol.
Router(config-subif)##
##
ii
ii
pp
pp



aa
aa
dd
dd
dd
dd
rr
rr
ee
ee
ss
ss
ss
ss


11
11
99
99
22
22


11
11
66
66
88

88


11
11


11
11


22
22
5
5
55
55
55


22
22
55
55
55
55


22
22

55
55
55
55


00
00
Assigns the IP address and netmask.
Router(config-subif)##
##
ii
ii
nn
nn
tt
tt
ee
ee
rr
rr
ff
ff
aa
aa
cc
cc
ee
ee



ff
ff
aa
aa
ss
ss
tt
tt
ee
ee
tt
tt
hh
hh
ee
ee
rr
rr
nn
nn
ee
ee
tt
tt


00
00
/

/
//
00
00


11
11
00
00
Creates subinterface 0/0.10 and moves to
subinterface configuration mode.
Router(config-subif)##
##
dd
dd
ee
ee
ss
ss
cc
cc
rr
rr
ii
ii
pp
pp
tt
tt

ii
ii
oo
oo
nn
nn


AA
AA
cc
cc
cc
cc
oo
oo
uu
uu
nn
nn
tt
tt
ii
ii
nn
nn
gg
gg



VV
VV
L
L
LL
AA
AA
NN
NN


11
11
00
00
(Optional) Sets the locally significant
description of the subinterface.
Router(config-subif)
##
##
ee
ee
nn
nn
cc
cc
aa
aa
pp
pp

ss
ss
uu
uu
ll
ll
aa
aa
tt
tt
ii
ii
oo
oo
nn
nn


dd
dd
oo
oo
tt
tt
11
11
qq
qq



11
11
00
00

Assigns VLAN 10 to this subinterface. This
subinterface will use the 802.1q trunking
protocol.
Inter-VLAN Communication Tips 131
NOTE: The subnets of the VLANs are directly connected to the router. Routing
between these subnets does not require a dynamic routing protocol. In a more
complex topology, these routes need to either be advertised with whatever
dynamic routing protocol is being used or be redistributed into whatever dynamic
routing protocol is being used.
NOTE: Routes to the subnets associated with these VLANs appear in the routing
table as directly connected networks.
Inter-VLAN Communication Tips
• Although most routers support both ISL and dot1q encapsulation, some switch models
only support dot1q (the 2950 and 2960 series, for example).
• If you need to use ISL as your trunking protocol, use the command encapsulation isl
x, where x is the number of the VLAN to be assigned to that subinterface.
• Recommended best practice is to use the same number of the VLAN number for the
subinterface number. It is easier to troubleshoot VLAN 10 on subinterface fa0/0.10
than on fa0/0.2.
• The native VLAN (usually VLAN 1) cannot be configured on a subinterface for Cisco
IOS Software releases that are earlier than 12.1(3)T. Native VLAN IP addresses
therefore need to be configured on the physical interface. Other VLAN traffic is
configured on subinterfaces:
Router(config)#interface fastethernet 0/0
Router(config-if)#encapsulation dot1q 1 native

Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#interface fastethernet 0/0.10
Router(config-subif)#encapsulation dot1q 10
Router(config-subif)#ip address 192.168.10.1 255.255.255.0
Router(config-subif)##
##
ii
ii
pp
pp


aa
aa
dd
dd
dd
dd
rr
rr
ee
ee
ss
ss
ss
ss


11
11

99
99
22
22


11
11
66
66
88
88


11
11
00
00


11
11


2
2
22
55
55
55

55


22
22
55
55
55
55


22
22
55
55
55
55


00
00
Assigns the IP address and netmask.
Router(config-subif)##
##
ee
ee
xx
xx
ii
ii

tt
tt
Returns to interface configuration mode.
Router(config-if)##
##
ee
ee
xx
xx
ii
ii
tt
tt
Returns to global configuration mode.
Router(config)##
##
132 Configuration Example: Inter-VLAN Communication
Configuration Example: Inter-VLAN Communication
Figure 13-1 illustrates the network topology for the configuration that follows, which shows
how to configure inter-VLAN communication using commands covered in this chapter.
Some commands used in this configuration are from previous chapters.
Figure 13-3 Network Topology for Inter-VLAN Communication Configuration
L2Switch1
192.168.10.10/24
WS1
Sales
VLAN 10
fa0/2-4
192.168.10.0/24
192.168.20.20/24

WS2
Engineering
VLAN 20
fa0/5-8
192.168.20.0/24
192.168.30.30/24
WS3
Marketing
VLAN 30
fa0/9-12
192.168.30.0/24
Internet
Native
VLAN 1
fa0/2-4
192.168.1.0/24
VLAN 1
192.168.1.2/24
IEEE 802.1q
Trunk
s0/0/0
192.31.7.6/30
Lo 0
198.133.219.1/24
s0/0/0 DCE
192.31.7.5/30
fa0/0 – no IP address
fa0/00.1 – VLAN 1 (Native) - 192.168.1.1/24
fa0/0.10 – VLAN 10 - 192.168.10.1/24
fa0/0.20 – VLAN 20 - 192.168.20.1/24

fa0/0.30 – VLAN 30- 192.168.30.1/24
CORP
ISP
2960
fa0/1
Configuration Example: Inter-VLAN Communication 133
ISP Router
Router>ee
ee
nn
nn
aa
aa
bb
bb
ll
ll
ee
ee
Moves to privileged mode
Router>#cc
cc
oo
oo
nn
nn
ff
ff
ii
ii

gg
gg
uu
uu
rr
rr
ee
ee


tt
tt
ee
ee
rr
rr
mm
mm
ii
ii
nn
nn
aa
aa
ll
ll
Moves to global configuration mode
Router(config)#hh
hh
oo

oo
ss
ss
tt
tt
nn
nn
aa
aa
mm
mm
ee
ee


II
II
SS
SS
PP
PP
Sets the host name
ISP(config)#ii
ii
nn
nn
tt
tt
ee
ee

rr
rr
ff
ff
aa
aa
cc
cc
ee
ee


ll
ll
oo
oo
oo
oo
pp
pp
bb
bb
aa
aa
cc
cc
kk
kk



00
00
Moves to interface configuration mode
ISP(config-if)#dd
dd
ee
ee
ss
ss
cc
cc
rr
rr
ii
ii
pp
pp
tt
tt
ii
ii
oo
oo
nn
nn


ss
ss
ii

ii
mm
mm
uu
uu
ll
ll
aa
aa
tt
tt
ee
ee
dd
dd


aa
aa
dd
dd
dd
dd
r
r
rr
ee
ee
ss
ss

ss
ss


rr
rr
ee
ee
pp
pp
rr
rr
ee
ee
ss
ss
ee
ee
nn
nn
tt
tt
ii
ii
nn
nn
gg
gg



rr
rr
ee
ee
mm
mm
oo
oo
tt
tt
ee
ee


ww
ww
ee
ee
bb
bb
ss
ss
ii
ii
tt
tt
ee
ee
Sets the locally significant interface
description

ISP(config-if)#ii
ii
pp
pp


aa
aa
dd
dd
dd
dd
rr
rr
ee
ee
ss
ss
ss
ss


11
11
99
99
88
88



11
11
33
33
33
33


22
22
11
11
99
99


11
11


2
2
22
55
55
55
55


22

22
55
55
55
55


22
22
55
55
55
55


00
00
Assigns the IP address and netmask
ISP(config-if)#ii
ii
nn
nn
tt
tt
ee
ee
rr
rr
ff
ff

aa
aa
cc
cc
ee
ee


ss
ss
ee
ee
rr
rr
ii
ii
aa
aa
ll
ll


00
00
//
//
00
00
//
//

00
00
Moves to interface configuration mode
ISP(config-if)#dd
dd
ee
ee
ss
ss
cc
cc
rr
rr
ii
ii
pp
pp
tt
tt
ii
ii
oo
oo
nn
nn


WW
WW
AA

AA
NN
NN


ll
ll
ii
ii
nn
nn
kk
kk


tt
tt
oo
oo


tt
tt
h
h
hh
ee
ee



CC
CC
oo
oo
rr
rr
pp
pp
oo
oo
rr
rr
aa
aa
tt
tt
ee
ee


RR
RR
oo
oo
uu
uu
tt
tt
ee
ee

rr
rr
Sets the locally significant interface
description
ISP(config-if)#ii
ii
pp
pp


aa
aa
dd
dd
dd
dd
rr
rr
ee
ee
ss
ss
ss
ss


11
11
99
99

22
22


33
33
11
11


77
77


55
55


22
22
55
55
55
55
.
.

22
22
55

55
55
55


22
22
55
55
55
55


22
22
55
55
22
22
Assigns the IP address and netmask
ISP(config-if)#cc
cc
ll
ll
oo
oo
cc
cc
kk
kk



rr
rr
aa
aa
tt
tt
ee
ee


55
55
66
66
00
00
00
00
00
00
Assigns a clock rate to the interface—the
DCE cable is plugged into this interface
ISP(config-if)#nn
nn
oo
oo



ss
ss
hh
hh
uu
uu
tt
tt
dd
dd
oo
oo
ww
ww
nn
nn
Enables the interface
ISP(config-if)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to global configuration mode
ISP(config-if)#rr
rr
oo
oo

uu
uu
tt
tt
ee
ee
rr
rr


ee
ee
ii
ii
gg
gg
rr
rr
pp
pp


11
11
00
00
Creates Enhanced Interior Gateway Routing
Protocol (EIGRP) routing process 10
ISP(config-router)#nn
nn

ee
ee
tt
tt
ww
ww
oo
oo
rr
rr
kk
kk


11
11
99
99
88
88


11
11
33
33
33
33



22
22
11
11
99
99


00
00
Advertises directly connected networks
(classful address only)
ISP(config-router)#nn
nn
ee
ee
tt
tt
ww
ww
oo
oo
rr
rr
kk
kk


11
11

99
99
22
22


33
33
11
11


77
77


00
00
Advertises directly connected networks
(classful address only)
ISP(config-router)#nn
nn
oo
oo


aa
aa
uu
uu

tt
tt
oo
oo


ss
ss
uu
uu
mm
mm
mm
mm
aa
aa
rr
rr
yy
yy
Disables auto summarization
ISP(config-router)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to global configuration mode

ISP(config)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to privileged mode
ISP#cc
cc
oo
oo
pp
pp
yy
yy


rr
rr
uu
uu
nn
nn
nn
nn
ii
ii
nn

nn
gg
gg


cc
cc
oo
oo
nn
nn
ff
ff
ii
ii
gg
gg


ss
ss
tt
tt
aa
aa
rr
rr
tt
tt
uu

uu
pp
pp


cc
cc
oo
oo
nn
nn
ff
ff
ii
ii
gg
gg
Saves the configuration to NVRAM
134 Configuration Example: Inter-VLAN Communication
CORP Router
Router>ee
ee
nn
nn
aa
aa
bb
bb
ll
ll

ee
ee
Moves to privileged mode.
Router>#cc
cc
oo
oo
nn
nn
ff
ff
ii
ii
gg
gg
uu
uu
rr
rr
ee
ee


tt
tt
ee
ee
rr
rr
mm

mm
ii
ii
nn
nn
aa
aa
ll
ll
Moves to global configuration mode.
Router(config)#hh
hh
oo
oo
ss
ss
tt
tt
nn
nn
aa
aa
mm
mm
ee
ee


CC
CC

OO
OO
RR
RR
PP
PP
Sets the host name.
CORP(config)#nn
nn
oo
oo


ii
ii
pp
pp


dd
dd
oo
oo
mm
mm
aa
aa
ii
ii
nn

nn


ll
ll
oo
oo
oo
oo
kk
kk
uu
uu
pp
pp
Turns off Domain Name System (DNS)
resolution to avoid wait time due to DNS
lookup of spelling errors.
CORP(config)#ii
ii
nn
nn
tt
tt
ee
ee
rr
rr
ff
ff

aa
aa
cc
cc
ee
ee


ss
ss
ee
ee
rr
rr
ii
ii
aa
aa
ll
ll


00
00
//
//
00
00
//
//

00
00
Moves to interface configuration mode.
CORP(config-if)#dd
dd
ee
ee
ss
ss
cc
cc
rr
rr
ii
ii
pp
pp
tt
tt
ii
ii
oo
oo
nn
nn


ll
ll
ii

ii
nn
nn
kk
kk


tt
tt
oo
oo


II
II
SS
SS
PP
PP
Sets the locally significant interface
description.
CORP(config-if)#ii
ii
pp
pp


aa
aa
dd

dd
dd
dd
rr
rr
ee
ee
ss
ss
ss
ss


11
11
99
99
22
22


33
33
11
11


77
77



66
66


22
22
55
55
55
55
.
.

22
22
55
55
55
55


22
22
55
55
55
55



22
22
55
55
22
22
Assigns the IP address and netmask.
CORP(config-if)#nn
nn
oo
oo


ss
ss
hh
hh
uu
uu
tt
tt
dd
dd
oo
oo
ww
ww
nn
nn
Enables the interface.

CORP(config-if)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to global configuration mode.
CORP(config)#ii
ii
nn
nn
tt
tt
ee
ee
rr
rr
ff
ff
aa
aa
cc
cc
ee
ee


ff

ff
aa
aa
ss
ss
tt
tt
ee
ee
tt
tt
hh
hh
ee
ee
rr
rr
nn
nn
ee
ee
tt
tt


00
00
//
//
0

0
00
Enters interface configuration mode.
CORP(config-if)#dd
dd
uu
uu
pp
pp
ll
ll
ee
ee
xx
xx


ff
ff
uu
uu
ll
ll
ll
ll
Enables full-duplex operation to ensure
trunking takes effect between here and
L2Switch1.
CORP(config-if)#nn
nn

oo
oo


ss
ss
hh
hh
uu
uu
tt
tt
dd
dd
oo
oo
ww
ww
nn
nn
Enables the interface.
CORP(config-if)#ii
ii
nn
nn
tt
tt
ee
ee
rr

rr
ff
ff
aa
aa
cc
cc
ee
ee


ff
ff
aa
aa
ss
ss
tt
tt
ee
ee
tt
tt
hh
hh
ee
ee
rr
rr
nn

nn
ee
ee
tt
tt


00
00
//
//
0
0
00


11
11
Creates a virtual subinterface and moves
to subinterface configuration mode.
CORP(config-subif)#dd
dd
ee
ee
ss
ss
cc
cc
rr
rr

ii
ii
pp
pp
tt
tt
ii
ii
oo
oo
nn
nn


MM
MM
aa
aa
nn
nn
aa
aa
gg
gg
ee
ee
mm
mm
ee
ee

nn
nn
tt
tt


VV
VV
LL
LL
A
A
AA
NN
NN


11
11


––
––


NN
NN
aa
aa
tt

tt
ii
ii
vv
vv
ee
ee


VV
VV
LL
LL
AA
AA
NN
NN
Sets the locally significant interface
description.
CORP(config-subif)#ee
ee
nn
nn
cc
cc
aa
aa
pp
pp
ss

ss
uu
uu
ll
ll
aa
aa
tt
tt
ii
ii
oo
oo
nn
nn


dd
dd
oo
oo
tt
tt
11
11
qq
qq


11

11


nn
nn
aa
aa
tt
tt
i
i
ii
vv
vv
ee
ee
Assigns VLAN 1 to this subinterface.
VLAN 1 will be the native VLAN. This
subinterface will use the 802.1q trunking
protocol.
CORP(config-subif)#ii
ii
pp
pp


aa
aa
dd
dd

dd
dd
rr
rr
ee
ee
ss
ss
ss
ss


11
11
99
99
22
22


11
11
66
66
88
88


11
11



11
11


22
22
55
55
5
5
55


22
22
55
55
55
55


22
22
55
55
55
55



00
00
Assigns the IP address and netmask.
CORP(config-subif)#ii
ii
nn
nn
tt
tt
ee
ee
rr
rr
ff
ff
aa
aa
cc
cc
ee
ee


ff
ff
aa
aa
ss
ss

tt
tt
ee
ee
tt
tt
hh
hh
ee
ee
rr
rr
nn
nn
ee
ee
tt
tt


00
00
//
//
0
0
00


11

11
00
00
Creates a virtual subinterface and moves
to subinterface configuration mode.
Configuration Example: Inter-VLAN Communication 135
CORP(config-subif)#dd
dd
ee
ee
ss
ss
cc
cc
rr
rr
ii
ii
pp
pp
tt
tt
ii
ii
oo
oo
nn
nn



SS
SS
aa
aa
ll
ll
ee
ee
ss
ss


VV
VV
LL
LL
AA
AA
NN
NN


11
11
00
00
Sets the locally significant interface
description.
CORP(config-subif)#ee
ee

nn
nn
cc
cc
aa
aa
pp
pp
ss
ss
uu
uu
ll
ll
aa
aa
tt
tt
ii
ii
oo
oo
nn
nn


dd
dd
oo
oo

tt
tt
11
11
qq
qq


11
11
00
00

Assigns VLAN 10 to this subinterface.
This subinterface will use the 802.1q
trunking protocol.
CORP(config-subif)#ii
ii
pp
pp


aa
aa
dd
dd
dd
dd
rr
rr

ee
ee
ss
ss
ss
ss


11
11
99
99
22
22


11
11
66
66
88
88


11
11
00
00



11
11


22
22
5
5
55
55
55


22
22
55
55
55
55


22
22
55
55
55
55


00

00
Assigns the IP address and netmask.
CORP(config-subif)#ii
ii
nn
nn
tt
tt
ee
ee
rr
rr
ff
ff
aa
aa
cc
cc
ee
ee


ff
ff
aa
aa
ss
ss
tt
tt

ee
ee
tt
tt
hh
hh
ee
ee
rr
rr
nn
nn
ee
ee
tt
tt


00
00
//
//
0
0
00


22
22
00

00
Creates a virtual subinterface and moves
to subinterface configuration mode.
CORP(config-subif)#dd
dd
ee
ee
ss
ss
cc
cc
rr
rr
ii
ii
pp
pp
tt
tt
ii
ii
oo
oo
nn
nn


EE
EE
nn

nn
gg
gg
ii
ii
nn
nn
ee
ee
ee
ee
rr
rr
ii
ii
nn
nn
gg
gg


VV
VV
L
L
LL
AA
AA
NN
NN



22
22
00
00
Sets the locally significant interface
description.
CORP(config-subif)#ee
ee
nn
nn
cc
cc
aa
aa
pp
pp
ss
ss
uu
uu
ll
ll
aa
aa
tt
tt
ii
ii

oo
oo
nn
nn


dd
dd
oo
oo
tt
tt
11
11
qq
qq


22
22
00
00
Assigns VLAN 20 to this subinterface.
This subinterface will use the 802.1q
trunking protocol.
CORP(config-subif)#ii
ii
pp
pp



aa
aa
dd
dd
dd
dd
rr
rr
ee
ee
ss
ss
ss
ss


11
11
99
99
22
22


11
11
66
66
88

88


22
22
00
00


11
11


22
22
5
5
55
55
55


22
22
55
55
55
55



22
22
55
55
55
55


00
00
Assigns the IP address and netmask.
CORP(config-subif)#ii
ii
nn
nn
tt
tt
ee
ee
rr
rr
ff
ff
aa
aa
cc
cc
ee
ee



ff
ff
aa
aa
ss
ss
tt
tt
ee
ee
tt
tt
hh
hh
ee
ee
rr
rr
nn
nn
ee
ee
tt
tt


00
00
//

//
0
0
00


33
33
00
00
Creates a virtual subinterface and moves
to subinterface configuration mode.
CORP(config-subif)#dd
dd
ee
ee
ss
ss
cc
cc
rr
rr
ii
ii
pp
pp
tt
tt
ii
ii

oo
oo
nn
nn


MM
MM
aa
aa
rr
rr
kk
kk
ee
ee
tt
tt
ii
ii
nn
nn
gg
gg


VV
VV
LL
LL

AA
AA
N
N
NN


33
33
00
00
Sets the locally significant interface
description.
CORP(config-subif)#ee
ee
nn
nn
cc
cc
aa
aa
pp
pp
ss
ss
uu
uu
ll
ll
aa

aa
tt
tt
ii
ii
oo
oo
nn
nn


dd
dd
oo
oo
tt
tt
11
11
qq
qq


33
33
00
00
Assigns VLAN 30 to this subinterface.
This subinterface will use the 802.1q
trunking protocol.

CORP(config-subif)#ii
ii
pp
pp


aa
aa
dd
dd
dd
dd


11
11
99
99
22
22


11
11
66
66
88
88



33
33
00
00


11
11


22
22
55
55
55
55


22
22
5
5
55
55
55


22
22
55

55
55
55


00
00
Assigns the IP address and netmask.
CORP(config-subif)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to interface configuration mode.
CORP(config-if)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to global configuration mode.
CORP(config)#rr
rr
oo
oo

uu
uu
tt
tt
ee
ee
rr
rr


ee
ee
ii
ii
gg
gg
rr
rr
pp
pp


11
11
00
00
Creates EIGRP routing process 10 and
moves to router configuration mode.
CORP(config-router)#nn
nn

ee
ee
tt
tt
ww
ww
oo
oo
rr
rr
kk
kk


11
11
99
99
22
22


11
11
66
66
88
88



11
11


00
00
Advertises the 192.168.1.0 network.
CORP(config-router)#nn
nn
ee
ee
tt
tt
ww
ww
oo
oo
rr
rr
kk
kk


11
11
99
99
22
22



11
11
66
66
88
88


11
11
00
00


00
00
Advertises the 192.168.10.0 network.
CORP(config-router)#nn
nn
ee
ee
tt
tt
ww
ww
oo
oo
rr
rr

kk
kk


11
11
99
99
22
22


11
11
66
66
88
88


22
22
00
00


00
00
Advertises the 192.168.20.0 network.
136 Configuration Example: Inter-VLAN Communication

L2Switch1 (Catalyst 2960)
CORP(config-router)#nn
nn
ee
ee
tt
tt
ww
ww
oo
oo
rr
rr
kk
kk


11
11
99
99
22
22


11
11
66
66
88

88


33
33
00
00


00
00
Advertises the 192.168.30.0 network.
CORP(config-router)#nn
nn
ee
ee
tt
tt
ww
ww
oo
oo
rr
rr
kk
kk


11
11

99
99
22
22


33
33
11
11


77
77


00
00
Advertises the 192.31.7.0 network.
CORP(config-router)#nn
nn
oo
oo


aa
aa
uu
uu
tt

tt
oo
oo


ss
ss
uu
uu
mm
mm
mm
mm
aa
aa
rr
rr
yy
yy
Turns off automatic summarization at the
classful boundary.
CORP(config-router)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to global configuration mode.

CORP(config)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to privileged mode.
CORP#cc
cc
oo
oo
pp
pp
yy
yy


rr
rr
uu
uu
nn
nn
nn
nn
ii
ii
nn

nn
gg
gg


cc
cc
oo
oo
nn
nn
ff
ff
ii
ii
gg
gg


ss
ss
tt
tt
aa
aa
rr
rr
tt
tt
uu

uu
pp
pp


cc
cc
oo
oo
nn
nn
ff
ff
ii
ii
gg
gg
Saves the configuration in NVRAM.
Switch>ee
ee
nn
nn
aa
aa
bb
bb
ll
ll
ee
ee

Moves to privileged mode.
Switch#cc
cc
oo
oo
nn
nn
ff
ff
ii
ii
gg
gg
uu
uu
rr
rr
ee
ee


tt
tt
ee
ee
rr
rr
mm
mm
ii

ii
nn
nn
aa
aa
ll
ll
Moves to global configuration mode.
Switch(config)#hh
hh
oo
oo
ss
ss
tt
tt
nn
nn
aa
aa
mm
mm
ee
ee


LL
LL
22
22

SS
SS
ww
ww
ii
ii
tt
tt
cc
cc
hh
hh
11
11
Sets the host name.
L2Switch1(config)#nn
nn
oo
oo


ii
ii
pp
pp


dd
dd
oo

oo
mm
mm
aa
aa
ii
ii
nn
nn


ll
ll
oo
oo
oo
oo
kk
kk
uu
uu
pp
pp
Turns off DNS resolution.
L2Switch1(config)#vv
vv
ll
ll
aa
aa

nn
nn


11
11
00
00
Creates VLAN 10 and enters VLAN
configuration mode.
L2Switch1(config-vlan)#nn
nn
aa
aa
mm
mm
ee
ee


SS
SS
aa
aa
ll
ll
ee
ee
ss
ss

Assigns a name to the VLAN.
L2Switch1(config-vlan)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to global configuration mode.
L2Switch1(config)#vv
vv
ll
ll
aa
aa
nn
nn


22
22
00
00
Creates VLAN 20 and enters VLAN
configuration mode.
L2Switch1(config-vlan)#nn
nn
aa
aa

mm
mm
ee
ee


EE
EE
nn
nn
gg
gg
ii
ii
nn
nn
ee
ee
ee
ee
rr
rr
ii
ii
nn
nn
gg
gg
Assigns a name to the VLAN.
L2Switch1(config-vlan)#vv

vv
ll
ll
aa
aa
nn
nn


33
33
00
00
Creates VLAN 30 and enters VLAN
configuration mode. Note that you do
not have to exit back to global
configuration mode to execute this
command.
L2Switch1(config-vlan)#nn
nn
aa
aa
mm
mm
ee
ee


MM
MM

aa
aa
rr
rr
kk
kk
ee
ee
tt
tt
ii
ii
nn
nn
gg
gg
Assigns a name to the VLAN.
L2Switch1(config-vlan)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to global configuration mode.
Configuration Example: Inter-VLAN Communication 137
L2Switch1(config)#ii
ii
nn

nn
tt
tt
ee
ee
rr
rr
ff
ff
aa
aa
cc
cc
ee
ee


rr
rr
aa
aa
nn
nn
gg
gg
ee
ee


ff

ff
aa
aa
ss
ss
tt
tt
ee
ee
tt
tt
hh
hh
ee
ee
rr
rr
n
n
nn
ee
ee
tt
tt


00
00
//
//

22
22


––
––


44
44
Enables you to set the same
configuration parameters on multiple
ports at the same time.
L2Switch1(config-if-range)#ss
ss
ww
ww
ii
ii
tt
tt
cc
cc
hh
hh
pp
pp
oo
oo
rr

rr
tt
tt


mm
mm
oo
oo
dd
dd
ee
ee


aa
aa
cc
cc
cc
cc
ee
ee
ss
ss
ss
ss
Sets ports 2–4 as access ports.
L2Switch1(config-if-range)#ss
ss

ww
ww
ii
ii
tt
tt
cc
cc
hh
hh
pp
pp
oo
oo
rr
rr
tt
tt


aa
aa
cc
cc
cc
cc
ee
ee
ss
ss

ss
ss


vv
vv
ll
ll
aa
aa
nn
nn


11
11
00
00
Assigns ports 2–4 to VLAN 10.
L2Switch1(config-if-range)#ii
ii
nn
nn
tt
tt
ee
ee
rr
rr
ff

ff
aa
aa
cc
cc
ee
ee


rr
rr
aa
aa
nn
nn
gg
gg
ee
ee


ff
ff
aa
aa
ss
ss
tt
tt
ee

ee
tt
tt
hh
hh
ee
ee
rr
rr
n
n
nn
ee
ee
tt
tt


00
00
//
//
55
55


––
––



88
88
Enables you to set the same
configuration parameters on multiple
ports at the same time.
L2Switch1(config-if-range)#ss
ss
ww
ww
ii
ii
tt
tt
cc
cc
hh
hh
pp
pp
oo
oo
rr
rr
tt
tt


mm
mm
oo

oo
dd
dd
ee
ee


aa
aa
cc
cc
cc
cc
ee
ee
ss
ss
ss
ss
Sets ports 5–8 as access ports.
L2Switch1(config-if-range)#ss
ss
ww
ww
ii
ii
tt
tt
cc
cc

hh
hh
pp
pp
oo
oo
rr
rr
tt
tt


aa
aa
cc
cc
cc
cc
ee
ee
ss
ss
ss
ss


vv
vv
ll
ll

aa
aa
nn
nn


22
22
00
00
Assigns ports 5–8 to VLAN 20.
L2Switch1(config-if-range)#ii
ii
nn
nn
tt
tt
ee
ee
rr
rr
ff
ff
aa
aa
cc
cc
ee
ee



rr
rr
aa
aa
nn
nn
gg
gg
ee
ee


ff
ff
aa
aa
ss
ss
tt
tt
ee
ee
tt
tt
hh
hh
ee
ee
rr

rr
n
n
nn
ee
ee
tt
tt


00
00
//
//
99
99






11
11
22
22
Enables you to set the same
configuration parameters on multiple
ports at the same time
L2Switch1(config-if-range)#ss

ss
ww
ww
ii
ii
tt
tt
cc
cc
hh
hh
pp
pp
oo
oo
rr
rr
tt
tt


mm
mm
oo
oo
dd
dd
ee
ee



aa
aa
cc
cc
cc
cc
ee
ee
ss
ss
ss
ss
Sets ports 9–12 as access ports.
L2Switch1(config-if-range)#ss
ss
ww
ww
ii
ii
tt
tt
cc
cc
hh
hh
pp
pp
oo
oo

rr
rr
tt
tt


aa
aa
cc
cc
cc
cc
ee
ee
ss
ss
ss
ss


vv
vv
ll
ll
aa
aa
nn
nn



33
33
00
00
Assigns ports 9–12 to VLAN 30.
L2Switch1(config-if-range)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to global configuration mode.
L2Switch1(config)#ii
ii
nn
nn
tt
tt
ee
ee
rr
rr
ff
ff
aa
aa
cc
cc

ee
ee


ff
ff
aa
aa
ss
ss
tt
tt
ee
ee
tt
tt
hh
hh
ee
ee
rr
rr
nn
nn
ee
ee
tt
tt



00
00
//
//
1
1
11
Moves to interface configuration
mode.
L2Switch1(config)#dd
dd
ee
ee
ss
ss
cc
cc
rr
rr
ii
ii
pp
pp
tt
tt
ii
ii
oo
oo
nn

nn


TT
TT
rr
rr
uu
uu
nn
nn
kk
kk


LL
LL
ii
ii
nn
nn
kk
kk


tt
tt
oo
oo




CC
CC
OO
OO
RR
RR
PP
PP


RR
RR
oo
oo
uu
uu
tt
tt
ee
ee
rr
rr
Sets the locally significant interface
description.
L2Switch1(config-if)#ss
ss
ww
ww

ii
ii
tt
tt
cc
cc
hh
hh
pp
pp
oo
oo
rr
rr
tt
tt


mm
mm
oo
oo
dd
dd
ee
ee


tt
tt

rr
rr
uu
uu
nn
nn
kk
kk
Puts the interface into trunking mode
and negotiates to convert the link into
a trunk link
L2Switch1(config-if)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to global configuration mode.
L2Switch1(config)#ii
ii
nn
nn
tt
tt
ee
ee
rr
rr

ff
ff
aa
aa
cc
cc
ee
ee


vv
vv
ll
ll
aa
aa
nn
nn


11
11
Creates the virtual interface for
VLAN 1 and enters interface
configuration mode.
138 Configuration Example: Inter-VLAN Communication
L2Switch1(config-if)#ii
ii
pp
pp



aa
aa
dd
dd
dd
dd
rr
rr
ee
ee
ss
ss
ss
ss


11
11
99
99
22
22


11
11
66
66

88
88


11
11


22
22


22
22
55
55
5
5
55


22
22
55
55
55
55


22

22
55
55
55
55


00
00
Assigns the IP address and netmask.
L2Switch1(config-if)#nn
nn
oo
oo


ss
ss
hh
hh
uu
uu
tt
tt
dd
dd
oo
oo
ww
ww

nn
nn
Enables the interface.
L2Switch1(config-if)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to global configuration mode.
L2Switch1(config)#ii
ii
pp
pp


dd
dd
ee
ee
ff
ff
aa
aa
uu
uu
ll
ll

tt
tt


gg
gg
aa
aa
tt
tt
ee
ee
ww
ww
aa
aa
yy
yy


11
11
99
99
22
22


11
11

66
66
8
8
88


11
11


11
11
Assigns the default gateway address.
L2Switch1(config)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to privileged mode.
L2Switch1#cc
cc
oo
oo
pp
pp
yy

yy


rr
rr
uu
uu
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


cc
cc
oo
oo
nn
nn
ff
ff
ii
ii
gg

gg


ss
ss
tt
tt
aa
aa
rr
rr
tt
tt
u
u
uu
pp
pp


cc
cc
oo
oo
nn
nn
ff
ff
ii
ii

gg
gg
Saves the configuration in NVRAM.
CHAPTER 14
STP and
EtherChannel
This chapter provides information and commands concerning the following topics:
• Spanning Tree Protocol
— Enabling Spanning Tree Protocol
— Configuring the root switch
— Configuring a secondary root switch
— Configuring port priority
— Configuring the path cost
— Configuring the switch priority of a VLAN
— Configuring STP timers
— Verifying STP
— Optional STP configurations
— Changing the spanning-tree mode
— Extended System ID
— Enabling Rapid Spanning Tree
— Troubleshooting Spanning Tree
— Configuration example: STP
• EtherChannel
— Interface modes in EtherChannel
— Guidelines for configuring EtherChannel
— Configuring Layer 2 EtherChannel
— Verifying EtherChannel
— Configuration example: EtherChannel
Spanning Tree Protocol
Enabling Spanning Tree Protocol

Switch(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


vv
vv

ll
ll
aa
aa
nn
nn


55
55
Enables STP on VLAN 5
Switch(config)#nn
nn
oo
oo


ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn

nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


vv
vv
ll
ll
aa
aa
nn
nn


55
55
Disables STP on VLAN 5
140 Spanning Tree Protocol
NOTE: If more VLANs are defined in the VLAN Trunking Protocol (VTP) than

there are spanning-tree instances, you can only have STP on 64 VLANs. If you
have more than 128 VLANs, it is recommended that you use Multiple STP.
Configuring the Root Switch
Switch(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee



vv
vv
ll
ll
aa
aa
nn
nn


55
55


rr
rr
oo
oo
oo
oo
tt
tt



Modifies the switch priority from the
default 32768 to a lower value to allow
the switch to become the root switch for
VLAN 5.

NOTE: If all other switches have
extended system ID support, this switch
resets its priority to 24576. If any other
switch has a priority set to below 24576
already, this switch sets its own priority
to 4096 less than the lowest switch
priority. If by doing this the switch
would have a priority of less than 1, this
command fails.
Switch(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr

rr
ee
ee
ee
ee


vv
vv
ll
ll
aa
aa
nn
nn


55
55


rr
rr
oo
oo
oo
oo
tt
tt




pp
pp
rr
rr
ii
ii
mm
mm
aa
aa
rr
rr
yy
yy
Switch recalculates timers along with
priority to allow the switch to become
the root switch for VLAN 5.
TIP: The root switch should be a
backbone or distribution switch.
Switch(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn

nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


vv
vv
ll
ll
aa
aa
nn
nn


55

55


rr
rr
oo
oo
oo
oo
tt
tt



pp
pp
rr
rr
ii
ii
mm
mm
aa
aa
rr
rr
yy
yy



dd
dd
ii
ii
aa
aa
mm
mm
ee
ee
tt
tt
ee
ee
rr
rr


77
77
Configures the switch to be the root
switch for VLAN 5 and sets the network
diameter to 7.
TIP: The diameter keyword is used to
define the maximum number of switches
between any two end stations. The range
is from 2 to 7 switches.
Switch(config)#ss
ss
pp

pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


vv
vv
ll
ll
aa

aa
nn
nn


55
55


rr
rr
oo
oo
oo
oo
tt
tt



pp
pp
rr
rr
ii
ii
mm
mm
aa
aa

rr
rr
yy
yy


hh
hh
ee
ee
ll
ll
ll
ll
oo
oo


tt
tt
ii
ii
mm
mm
ee
ee


44
44

Configures the switch to be the root
switch for VLAN 5 and sets the hello-
delay timer to 4 seconds.
TIP: The hello-time keyword sets the
hello-delay timer to any amount
between 1 and 10 seconds. The default
time is 2 seconds.
Spanning Tree Protocol 141
Configuring a Secondary Root Switch
Configuring Port Priority
Switch(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt

rr
rr
ee
ee
ee
ee


vv
vv
ll
ll
aa
aa
nn
nn


55
55


rr
rr
oo
oo
oo
oo
tt
tt




ss
ss
ee
ee
cc
cc
oo
oo
nn
nn
dd
dd
aa
aa
rr
rr
yy
yy
Switch recalculates timers along with
priority to allow the switch to become
the root switch for VLAN 5 should the
primary root switch fail.
NOTE: If all other switches have
extended system ID support, this switch
resets its priority to 28672. Therefore, if
the root switch fails, and all other
switches are set to the default priority of

32768, this becomes the new root
switch. For switches without extended
system ID support, the switch priority is
changed to 16384.
Switch(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee



vv
vv
ll
ll
aa
aa
nn
nn


55
55


rr
rr
oo
oo
oo
oo
tt
tt



ss
ss
ee

ee
cc
cc
oo
oo
nn
nn
dd
dd
aa
aa
rr
rr
yy
yy


dd
dd
ii
ii
aa
aa
mm
mm
ee
ee
tt
tt
ee

ee
rr
rr


77
77
Configures the switch to be the
secondary root switch for VLAN 5 and
sets the network diameter to 7.
Switch(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt

rr
rr
ee
ee
ee
ee


vv
vv
ll
ll
aa
aa
nn
nn


55
55


rr
rr
oo
oo
oo
oo
tt
tt




ss
ss
ee
ee
cc
cc
oo
oo
nn
nn
dd
dd
aa
aa
rr
rr
yy
yy


hh
hh
ee
ee
ll
ll
ll

ll
oo
oo


tt
tt
ii
ii
mm
mm
ee
ee


44
44
Configures the switch to be the
secondary root switch for VLAN 5 and
sets the hello-delay timer to 4 seconds.
Switch(config)#ii
ii
nn
nn
tt
tt
ee
ee
rr
rr

ff
ff
aa
aa
cc
cc
ee
ee


gg
gg
ii
ii
gg
gg
aa
aa
bb
bb
ii
ii
tt
tt
ee
ee
tt
tt
hh
hh

ee
ee
rr
rr
nn
nn
ee
ee
tt
tt



00
00
//
//
11
11
Moves to interface configuration mode.
Switch(config-if)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn

ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


pp
pp
oo
oo
rr
rr
tt
tt


pp
pp

rr
rr
ii
ii
oo
oo
rr
rr
ii
ii
t
t
tt
yy
yy


66
66
44
44
Configures the port priority for the
interface that is an access port.
Switch(config-if)#ss
ss
pp
pp
aa
aa
nn

nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


vv
vv
ll
ll
aa
aa
nn
nn



55
55


pp
pp
oo
oo
rr
rr
tt
tt
-
-

pp
pp
rr
rr
ii
ii
oo
oo
rr
rr
ii
ii
tt
tt

yy
yy


66
66
44
44
Configures the VLAN port priority for
an interface that is a trunk port.
NOTE: Port priority is used to break a
tie when 2 switches have equal
priorities for determining the root
switch. The number can be between 0
and 255. The default port priority is
128. The lower the number, the higher
the priority.
142 Spanning Tree Protocol
Configuring the Path Cost
Configuring the Switch Priority of a VLAN
NOTE: With the priority keyword, the range is 0 to 61440 in increments of 4096.
The default is 32768. The lower the priority, the more likely the switch will be
chosen as the root switch.
Only the following numbers can be used as a priority value:
CAUTION: Cisco recommends caution when using this command. Cisco further
recommends that the spanning-tree vlan x root primary or the spanning-tree
vlan x root secondary command be used instead to modify the switch priority.
Switch(config)#ii
ii
nn

nn
tt
tt
ee
ee
rr
rr
ff
ff
aa
aa
cc
cc
ee
ee


gg
gg
ii
ii
gg
gg
aa
aa
bb
bb
ii
ii
tt

tt
ee
ee
tt
tt
hh
hh
ee
ee
rr
rr
nn
nn
ee
ee
tt
tt



00
00
//
//
11
11
Moves to interface configuration mode.
Switch(config-if)#ss
ss
pp

pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


cc
cc
oo
oo
ss

ss
tt
tt


11
11
00
00
00
00
00
00
00
00
00
00
Configures the cost for the interface that is
an access port.
Switch(config-if)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii

ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


vv
vv
ll
ll
aa
aa
nn
nn


55
55



cc
cc
oo
oo
ss
ss
tt
tt



11
11
00
00
00
00
00
00
00
00
00
00
00
00
Configures the VLAN cost for an interface
that is a trunk port.
NOTE: If a loop occurs, STP uses the
path cost when trying to determine which

interface to place into the forwarding state.
A higher path cost means a lower speed
transmission. The range of the cost
keyword is 1 through 200000000. The
default is based on the media speed of the
interface.
Switch(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee

ee
ee


vv
vv
ll
ll
aa
aa
nn
nn


55
55


pp
pp
rr
rr
ii
ii
oo
oo
r
r
rr
ii

ii
tt
tt
yy
yy


11
11
22
22
22
22
88
88
88
88
Configures the switch priority of
VLAN 5 to 12288
0 4096 8192 12288
16384 20480 24576 28672
32768 36864 40960 45056
49152 53248 57344 61440
Spanning Tree Protocol 143
Configuring STP Timers
NOTE: For the hello-time command, the range is 1 to 10 seconds. The default is
2 seconds.
For the forward-time command, the range is 4 to 30 seconds. The default is 15
seconds.
For the max-age command, the range is 6 to 40 seconds. The default is 20

seconds.
CAUTION: Cisco recommends caution when using this command. Cisco further
recommends that the spanning-tree vlan x root primary or the spanning-tree
vlan x root secondary command be used instead to modify the switch timers.
Verifying STP
Switch(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee

ee


vv
vv
ll
ll
aa
aa
nn
nn


55
55


hh
hh
ee
ee
ll
ll
ll
ll
o
o
oo



tt
tt
ii
ii
mm
mm
ee
ee


44
44
Changes the hello-delay timer to 4
seconds on VLAN 5
Switch(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg



tt
tt
rr
rr
ee
ee
ee
ee


vv
vv
ll
ll
aa
aa
nn
nn


55
55


ff
ff
oo
oo

rr
rr
ww
ww
a
a
aa
rr
rr
dd
dd


tt
tt
ii
ii
mm
mm
ee
ee


22
22
00
00
Changes the forward-delay timer
to 20 seconds on VLAN 5
Switch(config)#ss

ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


vv
vv
ll

ll
aa
aa
nn
nn


55
55


mm
mm
aa
aa
xx
xx


a
a
aa
gg
gg
ee
ee


22
22

55
55
Changes the maximum-aging timer
to 25 seconds on VLAN 5
Switch#ss
ss
hh
hh
oo
oo
ww
ww


ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg



tt
tt
rr
rr
ee
ee
ee
ee
Displays STP information
Switch#ss
ss
hh
hh
oo
oo
ww
ww


ss
ss
pp
pp
aa
aa
nn
nn
nn

nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


aa
aa
cc
cc
tt
tt
ii
ii
vv
vv
ee

ee
Displays STP information on active
interfaces only
Switch#ss
ss
hh
hh
oo
oo
ww
ww


ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg



tt
tt
rr
rr
ee
ee
ee
ee


bb
bb
rr
rr
ii
ii
ee
ee
ff
ff
Displays a brief status of the STP
Switch#ss
ss
hh
hh
oo
oo
ww
ww



ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee



dd
dd
ee
ee
tt
tt
aa
aa
ii
ii
ll
ll
Displays a detailed summary of
interface information
Switch#ss
ss
hh
hh
oo
oo
ww
ww


ss
ss
pp
pp
aa
aa

nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


ii
ii
nn
nn
tt
tt
ee
ee

rr
rr
ff
ff
aa
aa
cc
cc
ee
ee


gg
gg
ii
ii
gg
gg
aa
aa
bb
bb
ii
ii
tt
tt
ee
ee
tt
tt

hh
hh
ee
ee
rr
rr
nn
nn
ee
ee
tt
tt


00
00
//
//
11
11
Displays STP information for
interface gigabitethernet 0/1
Switch#ss
ss
hh
hh
oo
oo
ww
ww



ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee



ss
ss
uu
uu
mm
mm
mm
mm
aa
aa
rr
rr
yy
yy
Displays a summary of port states
Switch#ss
ss
hh
hh
oo
oo
ww
ww


ss
ss
pp
pp
aa

aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


ss
ss
uu
uu
mm
mm
mm

mm
aa
aa
rr
rr
yy
yy


tt
tt
oo
oo
tt
tt
aa
aa
ll
ll
ss
ss
Displays the total lines of the STP
section
Switch#ss
ss
hh
hh
oo
oo
ww

ww


ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee



vv
vv
ll
ll
aa
aa
nn
nn


55
55
Displays STP information for
VLAN 5
144 Spanning Tree Protocol
Optional STP Configurations
Although the following commands are not mandatory for STP to work, you might find these
helpful to fine-tune your network.
PortFast
BPDU Guard
Switch(config)#ii
ii
nn
nn
tt
tt
ee
ee
rr

rr
ff
ff
aa
aa
cc
cc
ee
ee


ff
ff
aa
aa
ss
ss
tt
tt
ee
ee
tt
tt
hh
hh
ee
ee
rr
rr
nn

nn
ee
ee
tt
tt


00
00
//
//
1
1
11
00
00
Moves to interface configuration mode.
Switch(config-if)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn

nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


pp
pp
oo
oo
rr
rr
tt
tt
ff
ff
aa
aa
ss
ss
tt

tt
Enables PortFast on an access port.
Switch(config-if)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee



pp
pp
oo
oo
rr
rr
tt
tt
ff
ff
aa
aa
ss
ss
tt
tt


tt
tt
rr
rr
u
u
uu
nn
nn
kk
kk
Enables PortFast on a trunk port.

WARNING: Use the portfast command only
when connecting a single end station to an
access or trunk port. Using this command on a
port connected to a switch or hub could prevent
spanning tree from detecting loops.
NOTE: If you enable the voice VLAN feature,
PortFast is enabled automatically. If you disable
voice VLAN, PortFast is still enabled.
Switch#ss
ss
hh
hh
oo
oo
ww
ww


ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii

nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


ii
ii
nn
nn
tt
tt
ee
ee
rr
rr
ff
ff
a
a

aa
cc
cc
ee
ee


ff
ff
aa
aa
ss
ss
tt
tt
ee
ee
tt
tt
hh
hh
ee
ee
rr
rr
nn
nn
ee
ee
tt

tt


00
00
//
//
11
11
00
00


pp
pp
oo
oo
rr
rr
tt
tt
ff
ff
aa
aa
ss
ss
tt
tt
Displays PortFast information on interface

fastethernet 0/10.
Switch(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


pp

pp
oo
oo
rr
rr
tt
tt
ff
ff
aa
aa
ss
ss
tt
tt


bb
bb
pp
pp
d
d
dd
uu
uu
gg
gg
uu
uu

aa
aa
rr
rr
dd
dd


dd
dd
ee
ee
ff
ff
aa
aa
uu
uu
ll
ll
tt
tt
Globally enables BPDU Guard.
Switch(config)#ii
ii
nn
nn
tt
tt
ee

ee
rr
rr
ff
ff
aa
aa
cc
cc
ee
ee


rr
rr
aa
aa
nn
nn
gg
gg
ee
ee


ff
ff
aa
aa
ss

ss
tt
tt
ee
ee
tt
tt
hh
hh
ee
ee
rr
rr
n
n
nn
ee
ee
tt
tt


00
00
//
//
11
11



––
––


55
55
Enters interface range configuration mode.
Switch(config-if-
range)#
ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr

rr
ee
ee
ee
ee


pp
pp
oo
oo
rr
rr
tt
tt
ff
ff
aa
aa
ss
ss
tt
tt
Enables PortFast on all interfaces in the range.
NOTE: By default, BPDU Guard is disabled.
Switch(config)#ee
ee
rr
rr
rr

rr
dd
dd
ii
ii
ss
ss
aa
aa
bb
bb
ll
ll
ee
ee


rr
rr
ee
ee
cc
cc
oo
oo
vv
vv
ee
ee
rr

rr
yy
yy


cc
cc
aa
aa
uu
uu
ss
ss
ee
ee



bb
bb
pp
pp
dd
dd
uu
uu
gg
gg
uu
uu

aa
aa
rr
rr
dd
dd
Allows port to reenable itself if the cause of the
error is BPDU Guard by setting a recovery timer.
Spanning Tree Protocol 145
Changing the Spanning-Tree Mode
Different types of spanning tree can be configured on a Cisco switch. The options vary
according to the platform:
• Per-VLAN Spanning Tree (PVST)—There is one instance of spanning tree for each
VLAN. This is a Cisco proprietary protocol.
• Per-VLAN Spanning Tree Plus (PVST+)—Also Cisco proprietary. Has added
extensions to the PVST protocol.
• Rapid PVST+—This mode is the same as PVST+ except that it uses a rapid
convergence based on the 802.1w standard.
• Multiple Spanning Tree Protocol (MSTP)—IEEE 802.1s. Extends the 802.1w
Rapid Spanning Tree (RST) algorithm to multiple spanning trees. Multiple VLANs
can map to a single instance of RST. You cannot run MSTP and PVST at the same
time.
Switch(config)#ee
ee
rr
rr
rr
rr
dd
dd

ii
ii
ss
ss
aa
aa
bb
bb
ll
ll
ee
ee


rr
rr
ee
ee
cc
cc
oo
oo
vv
vv
ee
ee
rr
rr
yy
yy



ii
ii
nn
nn
tt
tt
ee
ee
rr
rr
v
v
vv
aa
aa
ll
ll


44
44
00
00
00
00
Sets recovery timer to 400 seconds. The default
is 300 seconds. The range is from 30 to 86400
seconds.

Switch#ss
ss
hh
hh
oo
oo
ww
ww


ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt

rr
rr
ee
ee
ee
ee


ss
ss
uu
uu
mm
mm
mm
mm
aa
aa
rr
rr
y
y
yy


tt
tt
oo
oo
tt

tt
aa
aa
ll
ll
ss
ss
Verifies whether BPDU Guard is enabled or
disabled.
Switch#ss
ss
hh
hh
oo
oo
ww
ww


ee
ee
rr
rr
rr
rr
dd
dd
ii
ii
ss

ss
aa
aa
bb
bb
ll
ll
ee
ee


rr
rr
ee
ee
cc
cc
oo
oo
vv
vv
ee
ee
rr
rr
yy
yy
Displays errdisable recovery timer information.
Switch(config)#ss
ss

pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


mm
mm
oo
oo

dd
dd
ee
ee


mm
mm
ss
ss
tt
tt
Enables MSTP. This command is
available only on a switch running the EI
software image.
Switch(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg

gg


tt
tt
rr
rr
ee
ee
ee
ee


mm
mm
oo
oo
dd
dd
ee
ee


pp
pp
vv
vv
ss
ss
tt

tt
Enables PVST. This is the default
setting.
Switch(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee



mm
mm
oo
oo
dd
dd
ee
ee


rr
rr
aa
aa
pp
pp
ii
ii
dd
dd


p
p
pp
vv
vv
ss
ss

tt
tt
Enables Rapid PVST+.
146 Spanning Tree Protocol
Extended System ID
Enabling Rapid Spanning Tree
Switch(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee

ee
ee


ee
ee
xx
xx
tt
tt
ee
ee
nn
nn
dd
dd


ss
ss
yy
yy
ss
ss
tt
tt
e
e
ee
mm

mm


ii
ii
dd
dd
Enables extended system ID, also known as MAC
address reduction.
NOTE: Catalyst switches running software
earlier than Cisco IOS Software Release 12.1(8)
EA1 do not support the extended system ID.
Switch#ss
ss
hh
hh
oo
oo
ww
ww


ss
ss
pp
pp
aa
aa
nn
nn

nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


ss
ss
uu
uu
mm
mm
mm
mm
aa
aa

rr
rr
y
y
yy
Verifies extended system ID is enabled.
Switch#ss
ss
hh
hh
oo
oo
ww
ww


rr
rr
uu
uu
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg



cc
cc
oo
oo
nn
nn
ff
ff
ii
ii
gg
gg
Verifies extended system ID is enabled.
Switch(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg

gg


tt
tt
rr
rr
ee
ee
ee
ee


mm
mm
oo
oo
dd
dd
ee
ee


rr
rr
aa
aa
pp
pp
ii

ii
dd
dd


p
p
pp
vv
vv
ss
ss
tt
tt
Enables Rapid PVST+.
Switch(config)#ii
ii
nn
nn
tt
tt
ee
ee
rr
rr
ff
ff
aa
aa
cc

cc
ee
ee


ff
ff
aa
aa
ss
ss
tt
tt
ee
ee
tt
tt
hh
hh
ee
ee
rr
rr
nn
nn
ee
ee
tt
tt



00
00
//
//
1
1
11
Moves to interface configuration mode.
Switch(config-if)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
ss
ss
nn
nn
gg
gg


tt

tt
rr
rr
ee
ee
ee
ee


ll
ll
ii
ii
nn
nn
kk
kk


tt
tt
yy
yy
pp
pp
ee
ee


p

p
pp
oo
oo
ii
ii
nn
nn
tt
tt


tt
tt
oo
oo


pp
pp
oo
oo
ii
ii
nn
nn
tt
tt
Sets the interface to be a point-to-point
interface.

NOTE: By setting the link type to point to
point, this means that if you connect this
port to a remote port, and this port becomes
a designated port, the switch negotiates
with the remote port and transitions the
local port to a forwarding state.
Switch(config-if)#ee
ee
xx
xx
ii
ii
tt
tt
Switch(config)#cc
cc
ll
ll
ee
ee
aa
aa
rr
rr


ss
ss
pp
pp

aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


dd
dd
ee
ee
tt
tt

ee
ee
cc
cc
t
t
tt
ee
ee
dd
dd


pp
pp
rr
rr
oo
oo
tt
tt
oo
oo
cc
cc
oo
oo
ll
ll
ss

ss
NOTE: The clear spanning-tree
detected-protocols command restarts the
protocol-migration process on the switch if
any port is connected to a port on a legacy
802.1D switch.
Spanning Tree Protocol 147
Troubleshooting Spanning Tree
Configuration Example: STP
Figure 14-1 illustrates the network topology for the configuration that follows, which shows
how to configure STP using commands covered in this chapter.
Switch#dd
dd
ee
ee
bb
bb
uu
uu
gg
gg


ss
ss
pp
pp
aa
aa
nn

nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


aa
aa
ll
ll
ll
ll
Displays all spanning-tree debugging
events
Switch#dd

dd
ee
ee
bb
bb
uu
uu
gg
gg


ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt

tt
rr
rr
ee
ee
ee
ee


ee
ee
vv
vv
ee
ee
nn
nn
tt
tt
ss
ss
Displays spanning-tree debugging
topology events
Switch#dd
dd
ee
ee
bb
bb
uu

uu
gg
gg


ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee

ee


bb
bb
aa
aa
cc
cc
kk
kk
bb
bb
o
o
oo
nn
nn
ee
ee
ff
ff
aa
aa
ss
ss
tt
tt
Displays spanning-tree debugging
BackboneFast events

Switch#dd
dd
ee
ee
bb
bb
uu
uu
gg
gg


ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg



tt
tt
rr
rr
ee
ee
ee
ee


uu
uu
pp
pp
ll
ll
ii
ii
nn
nn
k
k
kk
ff
ff
aa
aa
ss
ss
tt

tt
Displays spanning-tree debugging
UplinkFast event
Switch#dd
dd
ee
ee
bb
bb
uu
uu
gg
gg


ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg

gg


tt
tt
rr
rr
ee
ee
ee
ee


mm
mm
ss
ss
tt
tt
pp
pp


aa
aa
ll
ll
ll
ll
Displays all MST debugging events

Switch#dd
dd
ee
ee
bb
bb
uu
uu
gg
gg


ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg



tt
tt
rr
rr
ee
ee
ee
ee


ss
ss
ww
ww
ii
ii
tt
tt
cc
cc
hh
hh


ss
ss
tt
tt
aa
aa

tt
tt
ee
ee
Displays spanning-tree port state
changes
Switch#dd
dd
ee
ee
bb
bb
uu
uu
gg
gg


ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii

nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


pp
pp
vv
vv
ss
ss
tt
tt
++
++
Displays PVST+ events
148 Spanning Tree Protocol
Figure 14-4 Network Topology for STP Configuration Example
VTP

Domain
stpdemo
fa0/13
fa0/8
fa0/5 fa0/5
fa0/8
fa0/8
1
16
g0/1
20 10
1
g0/1
10
1
10
20
20
1
10
g0/1
1
20
g0/2
VTP Client
VLAN 10 Root Primary
Distribution1 (2960)
Core (2960)
VLAN 1 Root Primary
VTP Server

VTP Client
VLAN 20 Root Primary
Distribution2 (2960)
VLAN 10 - Forwarding VLAN 10 - Blocking
Spanning Tree Protocol 149
Core Switch (2960)
Distribution 1 Switch (2960)
Switch>ee
ee
nn
nn
aa
aa
bb
bb
ll
ll
ee
ee
Moves to privileged mode.
Switch#cc
cc
oo
oo
nn
nn
ff
ff
ii
ii

gg
gg
uu
uu
rr
rr
ee
ee


tt
tt
ee
ee
rr
rr
mm
mm
ii
ii
nn
nn
aa
aa
ll
ll
Moves to global configuration mode.
Switch(config)#hh
hh
oo

oo
ss
ss
tt
tt
nn
nn
aa
aa
mm
mm
ee
ee


CC
CC
oo
oo
rr
rr
ee
ee
Sets the host name.
Core(config)#nn
nn
oo
oo



ii
ii
pp
pp


dd
dd
oo
oo
mm
mm
aa
aa
ii
ii
nn
nn


ll
ll
oo
oo
oo
oo
kk
kk
uu
uu

pp
pp
Turns off Dynamic Name System (DNS)
queries so that spelling mistakes do not slow
you down.
Core(config)#vv
vv
tt
tt
pp
pp


mm
mm
oo
oo
dd
dd
ee
ee


ss
ss
ee
ee
rr
rr
vv

vv
ee
ee
rr
rr
Changes the switch to VTP server mode. This
is the default mode.
Core(config)#vv
vv
tt
tt
pp
pp


dd
dd
oo
oo
mm
mm
aa
aa
ii
ii
nn
nn


ss

ss
tt
tt
pp
pp
dd
dd
ee
ee
mm
mm
oo
oo
Configures the VTP domain name to stpdemo.
Core(config)#vv
vv
ll
ll
aa
aa
nn
nn


11
11
00
00
Creates VLAN 10 and enters VLAN
configuration mode.

Core(config-vlan)#nn
nn
aa
aa
mm
mm
ee
ee


AA
AA
cc
cc
cc
cc
oo
oo
uu
uu
nn
nn
tt
tt
ii
ii
nn
nn
gg
gg

Assigns a name to the VLAN.
Core(config-vlan)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to global configuration mode.
Core(config)#vv
vv
ll
ll
aa
aa
nn
nn


22
22
00
00
Creates VLAN 20 and enters VLAN
configuration mode.
Core(config-vlan)#nn
nn
aa
aa

mm
mm
ee
ee


MM
MM
aa
aa
rr
rr
kk
kk
ee
ee
tt
tt
ii
ii
nn
nn
gg
gg
Assigns a name to the VLAN.
Core(config-vlan)#ee
ee
xx
xx
ii

ii
tt
tt
Returns to global configuration mode.
Core(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee



vv
vv
ll
ll
aa
aa
nn
nn


11
11


rr
rr
oo
oo
oo
oo
tt
tt



pp
pp
rr

rr
ii
ii
mm
mm
aa
aa
rr
rr
yy
yy
Configures the switch to become the root
switch for VLAN 1.
Core(config)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to privileged mode.
Core#cc
cc
oo
oo
pp
pp
yy
yy



rr
rr
uu
uu
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


cc
cc
oo
oo
nn
nn
ff
ff
ii
ii
gg
gg



ss
ss
tt
tt
aa
aa
rr
rr
tt
tt
u
u
uu
pp
pp


cc
cc
oo
oo
nn
nn
ff
ff
ii
ii
gg

gg
Saves the configuration to NVRAM.
Switch>ee
ee
nn
nn
aa
aa
bb
bb
ll
ll
ee
ee
Moves to privileged mode.
Switch#cc
cc
oo
oo
nn
nn
ff
ff
ii
ii
gg
gg
uu
uu
rr

rr
ee
ee


tt
tt
ee
ee
rr
rr
mm
mm
ii
ii
nn
nn
aa
aa
ll
ll
Moves to global configuration mode.
Switch(config)#hh
hh
oo
oo
ss
ss
tt
tt

nn
nn
aa
aa
mm
mm
ee
ee


DD
DD
ii
ii
ss
ss
tt
tt
rr
rr
ii
ii
bb
bb
uu
uu
tt
tt
ii
ii

oo
oo
nn
nn
11
11
Sets the host name.
Distribution1(config)#nn
nn
oo
oo


ii
ii
pp
pp


dd
dd
oo
oo
mm
mm
aa
aa
ii
ii
nn

nn


ll
ll
oo
oo
oo
oo
kk
kk
uu
uu
pp
pp
Turns off DNS queries so that spelling
mistakes do not slow you down.
150 EtherChannel
Distribution 2 Switch (2960)
EtherChannel
EtherChannel provides fault-tolerant, high-speed links between switches, routers, and
servers. An EtherChannel consists of individual Fast Ethernet or Gigabit Ethernet links
bundled into a single logical link. If a link within an EtherChannel fails, traffic previously
carried over that failed link changes to the remaining links within the EtherChannel.
Distribution1(config)#vv
vv
tt
tt
pp
pp



dd
dd
oo
oo
mm
mm
aa
aa
ii
ii
nn
nn


ss
ss
tt
tt
pp
pp
dd
dd
ee
ee
mm
mm
oo
oo

Configures the VTP domain name to
stpdemo.
Distribution1(config)#vv
vv
tt
tt
pp
pp


mm
mm
oo
oo
dd
dd
ee
ee


cc
cc
ll
ll
ii
ii
ee
ee
nn
nn

tt
tt
Changes the switch to VTP client mode.
Distribution1(config)#ss
ss
pp
pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee



vv
vv
ll
ll
aa
aa
nn
nn


11
11
00
00


rr
rr
oo
oo
oo
oo
t
t
tt


pp
pp

rr
rr
ii
ii
mm
mm
aa
aa
rr
rr
yy
yy
Configures the switch to become the root
switch of VLAN 10.
Distribution1(config)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to privileged mode.
Distribution1#cc
cc
oo
oo
pp
pp
yy

yy


rr
rr
uu
uu
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


cc
cc
oo
oo
nn
nn
ff
ff
ii
ii
gg

gg


ss
ss
tt
tt
aa
aa
rr
rr
tt
tt
u
u
uu
pp
pp


cc
cc
oo
oo
nn
nn
ff
ff
ii
ii

gg
gg
Saves the configuration to NVRAM.
Switch>ee
ee
nn
nn
aa
aa
bb
bb
ll
ll
ee
ee
Moves to privileged mode.
Switch#cc
cc
oo
oo
nn
nn
ff
ff
ii
ii
gg
gg
uu
uu

rr
rr
ee
ee


tt
tt
ee
ee
rr
rr
mm
mm
ii
ii
nn
nn
aa
aa
ll
ll
Moves to global configuration mode.
Switch(config)#hh
hh
oo
oo
ss
ss
tt

tt
nn
nn
aa
aa
mm
mm
ee
ee


DD
DD
ii
ii
ss
ss
tt
tt
rr
rr
ii
ii
bb
bb
uu
uu
tt
tt
ii

ii
oo
oo
nn
nn
22
22
Sets the host name.
Distribution2(config)#nn
nn
oo
oo


ii
ii
pp
pp


dd
dd
oo
oo
mm
mm
aa
aa
ii
ii

nn
nn


ll
ll
oo
oo
oo
oo
kk
kk
uu
uu
pp
pp
Turns off DNS queries so that spelling
mistakes do not slow you down.
Distribution2(config)#vv
vv
tt
tt
pp
pp


dd
dd
oo
oo

mm
mm
aa
aa
ii
ii
nn
nn


ss
ss
tt
tt
pp
pp
dd
dd
ee
ee
mm
mm
oo
oo
Configures the VTP domain name to
stpdemo.
Distribution2(config)#vv
vv
tt
tt

pp
pp


mm
mm
oo
oo
dd
dd
ee
ee


cc
cc
ll
ll
ii
ii
ee
ee
nn
nn
tt
tt
Changes the switch to VTP client mode.
Distribution2(config)#ss
ss
pp

pp
aa
aa
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


tt
tt
rr
rr
ee
ee
ee
ee


vv
vv
ll
ll
aa

aa
nn
nn


22
22
00
00


rr
rr
oo
oo
oo
oo
t
t
tt


pp
pp
rr
rr
ii
ii
mm
mm

aa
aa
rr
rr
yy
yy
Configures the switch to become the root
switch of VLAN 20.
Distribution2(config)#ee
ee
xx
xx
ii
ii
tt
tt
Returns to privileged mode.
Distribution2#cc
cc
oo
oo
pp
pp
yy
yy


rr
rr
uu

uu
nn
nn
nn
nn
ii
ii
nn
nn
gg
gg


cc
cc
oo
oo
nn
nn
ff
ff
ii
ii
gg
gg


ss
ss
tt

tt
aa
aa
rr
rr
tt
tt
u
u
uu
pp
pp


cc
cc
oo
oo
nn
nn
ff
ff
ii
ii
gg
gg
Saves the configuration to NVRAM.
EtherChannel 151
Interface Modes in EtherChannel
Guidelines for Configuring EtherChannel

• PAgP is Cisco proprietary.
• LACP is defined in 802.3ad.
• You can combine from two to eight parallel links.
• All ports must be identical:
— Same speed and duplex
— Cannot mix Fast Ethernet and Gigabit Ethernet
— Cannot mix PAgP and LACP
— Must all be VLAN trunk or nontrunk operational status
• All links must be either Layer 2 or Layer 3 in a single channel group.
• To create a channel in PAgP, sides must be set to
— Auto-Desirable
— Desirable-Desirable
• To create a channel in LACP, sides must be set to
— Active-Active
— Active-Passive
• To create a channel without using PAgP or LACP, sides must be set to On-On.
•Donot configure a GigaStack gigabit interface converter (GBIC) as part of an
EtherChannel.
Mode Protocol Description
On None Forces the interface into an EtherChannel without PAgP or
LACP. Channel only exists if connected to another interface
group also in On mode.
Auto PAgP Places the interface into a passive negotiating state—will
respond to PAgP packets but will not initiate PAgP
negotiation.
Desirable PAgP Places the interface into an active negotiating state—will send
PAgP packets to start negotiations.
Passive LACP Places the interface into a passive negotiating state—will
respond to LACP packets but will not initiate LACP
negotiation.

Active LACP Places the interface into an active negotiating state—will send
LACP packets to start negotiations.

×