- •Warning and Disclaimer
- •Feedback Information
- •Trademark Acknowledgments
- •About the Author
- •About the Technical Reviewers
- •Dedication
- •Acknowledgments
- •Contents at a Glance
- •Contents
- •Icons Used in This Book
- •Command Syntax Conventions
- •Cisco’s Motivation: Certifying Partners
- •Format of the CCNA Exams
- •What’s on the CCNA Exams
- •ICND Exam Topics
- •Cross-Reference Between Exam Topics and Book Parts
- •CCNA Exam Topics
- •INTRO and ICND Course Outlines
- •Objectives and Methods
- •Book Features
- •How This Book Is Organized
- •Part I: LAN Switching
- •Part II: TCP/IP
- •Part III: Wide-Area Networks
- •Part IV: Network Security
- •Part V: Final Preparation
- •Part VI: Appendixes
- •How to Use These Books to Prepare for the CCNA Exam
- •For More Information
- •Part I: LAN Switching
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Brief Review of LAN Switching
- •The Forward-Versus-Filter Decision
- •How Switches Learn MAC Addresses
- •Forwarding Unknown Unicasts and Broadcasts
- •LAN Switch Logic Summary
- •Basic Switch Operation
- •Foundation Summary
- •Spanning Tree Protocol
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Spanning Tree Protocol
- •What IEEE 802.1d Spanning Tree Does
- •How Spanning Tree Works
- •Electing the Root and Discovering Root Ports and Designated Ports
- •Reacting to Changes in the Network
- •Spanning Tree Protocol Summary
- •Optional STP Features
- •EtherChannel
- •PortFast
- •Rapid Spanning Tree (IEEE 802.1w)
- •RSTP Link and Edge Types
- •RSTP Port States
- •RSTP Port Roles
- •RSTP Convergence
- •Edge-Type Behavior and PortFast
- •Link-Type Shared
- •Link-Type Point-to-Point
- •An Example of Speedy RSTP Convergence
- •Basic STP show Commands
- •Changing STP Port Costs and Bridge Priority
- •Foundation Summary
- •Foundation Summary
- •Virtual LANs and Trunking
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Review of Virtual LAN Concepts
- •Trunking with ISL and 802.1Q
- •ISL and 802.1Q Compared
- •VLAN Trunking Protocol (VTP)
- •How VTP Works
- •VTP Pruning
- •Foundation Summary
- •Part II: TCP/IP
- •IP Addressing and Subnetting
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •IP Addressing Review
- •IP Subnetting
- •Analyzing and Interpreting IP Addresses and Subnets
- •Math Operations Used to Answer Subnetting Questions
- •Converting IP Addresses from Decimal to Binary and Back Again
- •The Boolean AND Operation
- •How Many Hosts and How Many Subnets?
- •What Is the Subnet Number, and What Are the IP Addresses in the Subnet?
- •Finding the Subnet Number
- •Finding the Subnet Broadcast Address
- •Finding the Range of Valid IP Addresses in a Subnet
- •Finding the Answers Without Using Binary
- •Easier Math with Easy Masks
- •Which Subnet Masks Meet the Stated Design Requirements?
- •What Are the Other Subnet Numbers?
- •Foundation Summary
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Extended ping Command
- •Distance Vector Concepts
- •Distance Vector Loop-Avoidance Features
- •Route Poisoning
- •Split Horizon
- •Split Horizon with Poison Reverse
- •Hold-Down Timer
- •Triggered (Flash) Updates
- •RIP and IGRP
- •IGRP Metrics
- •Examination of RIP and IGRP debug and show Commands
- •Issues When Multiple Routes to the Same Subnet Exist
- •Administrative Distance
- •Foundation Summary
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Link-State Routing Protocol and OSPF Concepts
- •Steady-State Operation
- •Loop Avoidance
- •Scaling OSPF Through Hierarchical Design
- •OSPF Areas
- •Stub Areas
- •Summary: Comparing Link-State and OSPF to Distance Vector Protocols
- •Balanced Hybrid Routing Protocol and EIGRP Concepts
- •EIGRP Loop Avoidance
- •EIGRP Summary
- •Foundation Summary
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Route Summarization and Variable-Length Subnet Masks
- •Route Summarization Concepts
- •VLSM
- •Route Summarization Strategies
- •Sample “Best” Summary on Seville
- •Sample “Best” Summary on Yosemite
- •Classless Routing Protocols and Classless Routing
- •Classless and Classful Routing Protocols
- •Autosummarization
- •Classful and Classless Routing
- •Default Routes
- •Classless Routing
- •Foundation Summary
- •Advanced TCP/IP Topics
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Scaling the IP Address Space for the Internet
- •CIDR
- •Private Addressing
- •Network Address Translation
- •Static NAT
- •Dynamic NAT
- •Overloading NAT with Port Address Translation (PAT)
- •Translating Overlapping Addresses
- •Miscellaneous TCP/IP Topics
- •Internet Control Message Protocol (ICMP)
- •ICMP Echo Request and Echo Reply
- •Destination Unreachable ICMP Message
- •Time Exceeded ICMP Message
- •Redirect ICMP Message
- •Secondary IP Addressing
- •FTP and TFTP
- •TFTP
- •MTU and Fragmentation
- •Foundation Summary
- •Part III: Wide-Area Networks
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Review of WAN Basics
- •Physical Components of Point-to-Point Leased Lines
- •Data-Link Protocols for Point-to-Point Leased Lines
- •HDLC and PPP Compared
- •Looped Link Detection
- •Enhanced Error Detection
- •Authentication Over WAN Links
- •PAP and CHAP Authentication
- •Foundation Summary
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •ISDN Protocols and Design
- •Typical Uses of ISDN
- •ISDN Channels
- •ISDN Protocols
- •ISDN BRI Function Groups and Reference Points
- •ISDN PRI Function Groups and Reference Points
- •BRI and PRI Encoding and Framing
- •PRI Encoding
- •PRI Framing
- •BRI Framing and Encoding
- •DDR Step 1: Routing Packets Out the Interface to Be Dialed
- •DDR Step 2: Determining the Subset of the Packets That Trigger the Dialing Process
- •DDR Step 3: Dialing (Signaling)
- •DDR Step 4: Determining When the Connection Is Terminated
- •ISDN and DDR show and debug Commands
- •Multilink PPP
- •Foundation Summary
- •Frame Relay
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Frame Relay Protocols
- •Frame Relay Standards
- •Virtual Circuits
- •LMI and Encapsulation Types
- •DLCI Addressing Details
- •Network Layer Concerns with Frame Relay
- •Layer 3 Addressing with Frame Relay
- •Frame Relay Layer 3 Addressing: One Subnet Containing All Frame Relay DTEs
- •Frame Relay Layer 3 Addressing: One Subnet Per VC
- •Frame Relay Layer 3 Addressing: Hybrid Approach
- •Broadcast Handling
- •Frame Relay Service Interworking
- •A Fully-Meshed Network with One IP Subnet
- •Frame Relay Address Mapping
- •A Partially-Meshed Network with One IP Subnet Per VC
- •A Partially-Meshed Network with Some Fully-Meshed Parts
- •Foundation Summary
- •Part IV: Network Security
- •IP Access Control List Security
- •“Do I Know This Already?” Quiz
- •Foundation Topics
- •Standard IP Access Control Lists
- •IP Standard ACL Concepts
- •Wildcard Masks
- •Standard IP ACL: Example 2
- •Extended IP Access Control Lists
- •Extended IP ACL Concepts
- •Extended IP Access Lists: Example 1
- •Extended IP Access Lists: Example 2
- •Miscellaneous ACL Topics
- •Named IP Access Lists
- •Controlling Telnet Access with ACLs
- •ACL Implementation Considerations
- •Foundation Summary
- •Part V: Final Preparation
- •Final Preparation
- •Suggestions for Final Preparation
- •Preparing for the Exam Experience
- •Final Lab Scenarios
- •Scenario 1
- •Scenario 1, Part A: Planning
- •Solutions to Scenario 1, Part A: Planning
- •Scenario 2
- •Scenario 2, Part A: Planning
- •Solutions to Scenario 2, Part A: Planning
- •Part VI: Appendixes
- •Glossary
- •Answers to the “Do I Know This Already?” Quizzes and Q&A Questions
- •Chapter 1
- •“Do I Know This Already?” Quiz
- •Chapter 2
- •“Do I Know This Already?” Quiz
- •Chapter 3
- •“Do I Know This Already?” Quiz
- •Chapter 4
- •“Do I Know This Already?” Quiz
- •Chapter 5
- •“Do I Know This Already?” Quiz
- •Chapter 6
- •“Do I Know This Already?” Quiz
- •Chapter 7
- •“Do I Know This Already?” Quiz
- •Chapter 8
- •“Do I Know This Already?” Quiz
- •Chapter 9
- •“Do I Know This Already?” Quiz
- •Chapter 10
- •“Do I Know This Already?” Quiz
- •Chapter 11
- •“Do I Know This Already?” Quiz
- •Chapter 12
- •“Do I Know This Already?” Quiz
- •Using the Simulation Software for the Hands-on Exercises
- •Accessing NetSim from the CD
- •Hands-on Exercises Available with NetSim
- •Scenarios
- •Labs
- •Listing of the Hands-on Exercises
- •How You Should Proceed with NetSim
- •Considerations When Using NetSim
- •Routing Protocol Overview
- •Comparing and Contrasting IP Routing Protocols
- •Routing Through the Internet with the Border Gateway Protocol
- •RIP Version 2
- •The Integrated IS-IS Link State Routing Protocol
- •Summary of Interior Routing Protocols
- •Numbering Ports (Interfaces)
Spanning Tree Protocol Configuration 57
The following examples were taken from a small network with two switches, as shown in Figure 2-12.
Figure 2-12 Two-Switch Network
|
|
Fa 0/16 |
Fa 0/16 |
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fa 0/17 |
Fa 0/17 |
|
|
||
SW1-2950 |
SW2-2950 |
The examples in the rest of this chapter use the network as shown in the figure. Two 2950s connect using crossover cables. The cables are plugged into interfaces 0/16 and 0/17 on both switches.
Basic STP show Commands
Example 2-1 lists information about the current state of STP in this network, with all default STP parameters.
Example 2-1 STP Status for the Network Shown in Figure 2-12 with Default STP Parameters
sw1-2950#show spanning-tree
VLAN0001 |
|
|
|
|
|
|
|
|
|
|
|
Spanning tree enabled protocol ieee |
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|||
Root ID |
Priority |
32768 |
|
|
|
|
|
|
|||
|
Address |
0050.f035.a940 |
|
|
|
|
|||||
|
Cost |
19 |
|
|
|
|
|
|
|
||
|
Port |
16 |
(FastEthernet0/16) |
|
|
|
|||||
|
Hello Time |
2 |
sec |
|
Max Age 20 sec |
Forward Delay 15 sec |
|
||||
|
|
|
|
|
|
||||||
Bridge ID |
Priority |
32769 |
|
(priority 32768 sys-id-ext 1) |
|
||||||
|
Address |
000a.b7dc.b780 |
|
|
|
|
|||||
|
Hello Time |
2 |
sec |
|
Max Age 20 sec |
Forward Delay 15 sec |
|
||||
|
Aging Time 300 |
|
|
|
|
|
|
|
|||
Interface |
|
Port ID |
|
|
|
|
Designated |
|
Port ID |
||
Name |
|
Prio.Nbr |
|
|
Cost Sts |
Cost Bridge ID |
Prio.Nbr |
||||
---------------- -------- --------- --- --------- -------------------- |
-------- |
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
Fa0/16 |
|
128.16 |
|
|
|
|
19 FWD |
|
0 32768 |
0050.f035.a940 |
128.26 |
Fa0/17 |
|
128.17 |
|
|
|
|
19 BLK |
|
0 32768 |
0050.f035.a940 |
128.27 |
sw1-2950#show spanning-tree interface fastethernet 0/17 |
|
|
|||||||||
Vlan |
|
Port ID |
|
|
|
|
Designated |
|
Port ID |
||
Name |
|
Prio.Nbr |
|
|
Cost Sts |
Cost Bridge ID |
Prio.Nbr |
||||
---------------- -------- --------- --- --------- -------------------- |
-------- |
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
VLAN0001 |
128.17 |
|
|
|
|
19 BLK |
|
0 32768 |
0050.f035.a940 |
128.27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
58 Chapter 2: Spanning Tree Protocol
This example lists the output of the show spanning-tree command on SW1. At the beginning of the example, the SW1 output lists the root bridge ID, comprised of the priority and MAC address, first. The bridge ID combines the priority and the MAC address used to identify each bridge or switch. Next, the output lists SW1-2950’s own bridge ID. Notice that the root bridge ID is different from SW1-2950's bridge ID.
The topology in this example ends up with SW2 as the root bridge, so it forwards on both interfaces. SW1-2950 receives BPDUs on FastEthernet ports 0/16 and 0/17. From the topology, you know that the two BPDUs are both from SW2, and both tie in every respect. However, SW1 must choose one interface to put into forwarding state and one into blocking state to avoid a loop. You can see from the in the example that the port cost is 19 on each interface, the default IEE port cost for FastEthernet interfaces. So SW1 breaks the tie by using the lowest internal interface number, which is FastEthernet 0/16. So, in the example, you see SW1 port 0/16 in forwarding state and 0/17 in blocking state.
Changing STP Port Costs and Bridge Priority
In Example 2-2, the configuration changes to affect the spanning tree. First, on SW1-2950, the port cost is changed on fastethernet 0/17, which makes SW1-2950 transition that port from blocking state to forwarding state and interface fastethernet 0/16 to blocking state.
Next, SW1-2950 becomes the root by changing its bridge priority.
Example 2-2 Manipulating STP Port Cost and Bridge Priority
sw1-2950#debug spanning-tree
Spanning Tree event debugging is on
sw1-2950#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. sw1-2950(config)#interface fastethernet 0/17 sw1-2950(config-if)#spanning-tree cost 2 sw1-2950(config-if)#^Z
sw1-2950#
00:23:19: STP: VLAN0001 new Root Port Fa0/17, cost 2 00:23:19: STP: VLAN0001 Fa0/17 -> listening 00:23:34: STP: VLAN0001 Fa0/17 -> learning 00:23:49: STP: VLAN0001 Fa0/17 -> forwarding
sw1-2950#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID |
Priority |
32768 |
|
|
Address |
0050.f035.a940 |
|
|
|
|
|
|
Cost |
2 |
|
|
Port |
17 |
(FastEthernet0/17) |
|
Hello Time |
2 |
sec Max Age 20 sec Forward Delay 15 sec |
|
|
|
|
|
Spanning Tree Protocol Configuration 59 |
|
Example 2-2 Manipulating STP Port Cost and Bridge Priority (Continued) |
|
|||||
|
Bridge ID |
Priority |
32769 |
(priority 32768 sys-id-ext 1) |
|
|
|
|
|||||
|
|
Address |
000a.b7dc.b780 |
|
|
|
|
|
Hello Time |
2 sec |
Max Age 20 sec Forward Delay 15 sec |
|
|
|
|
Aging Time |
300 |
|
|
|
|
Interface |
Port ID |
|
|
Designated |
Port ID |
|
Name |
Prio.Nbr |
Cost Sts |
Cost Bridge ID |
Prio.Nbr |
|
|
---------------- -------- --------- --- --------- -------------------- -------- |
|||||
|
|
|
|
|
|
|
|
Fa0/16 |
128.16 |
|
19 BLK |
0 32768 0050.f035.a940 128.26 |
|
|
Fa0/17 |
128.17 |
|
2 FWD |
0 32768 0050.f035.a940 128.27 |
|
|
sw1-2950#configure terminal |
|
|
|
||
|
sw1-2950(config)#spanning-tree vlan 1 root primary |
|
||||
|
vlan 1 bridge priority set to 24576 |
|
|
|||
|
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 |
|
|
|||
|
sw1-2950(config)#^Z |
|
|
|
|
|
|
sw1-2950# |
|
|
|
|
|
|
|
|||||
|
00:24:49: setting bridge id (which=1) prio 24577 prio cfg 24576 sysid 1 (on) id |
|||||
|
6001.000a.b7dc.b780 |
|
|
|
|
|
|
00:24:49: STP: VLAN0001 |
we are the spanning tree root |
|
|||
|
00:24:49: STP: VLAN0001 |
Fa0/16 -> listening |
|
|
||
|
00:24:49: STP: VLAN0001 |
Topology Change rcvd on Fa0/16 |
|
|||
|
00:25:04: STP: VLAN0001 |
Fa0/16 -> learning |
|
|
||
|
00:25:19: STP: VLAN0001 |
Fa0/16 -> forwarding |
|
|
||
|
|
|
|
|
|
|
This example starts with the debug spanning-tree command on SW1-2950. This command tells the switch to issue informational messages whenever STP performs any significant work. These messages show up in the example as a result of the commands shown later in the example output.
Next, the port cost of the SW1-2950 interface fastethernet 0/17 is changed using the spanning-tree cost 2 command. (The default cost on a 100-Mbps link is 19.) Immediately following this command, you see the first meaningful debug messages. SW1-2950 issues a message each time an interface transitions to another state, and it includes a time stamp. Notice that the message stating that fastethernet 0/17 moves to listening state is followed by a message stating that fastethernet 0/17 has been placed in learning state—and the time stamp shows that this message was issued 15 seconds after the first one. Similarly, the message stating that fastethernet 0/17 was placed in forwarding state happens 15 seconds after that. So the debug messages simply reinforce the notion of the Forward Delay timer.
60 Chapter 2: Spanning Tree Protocol
Following the debug messages, the output of the show spanning-tree command lists fastethernet 0/16 as blocking and fastethernet 0/17 as forwarding, with the cost to the root bridge now only 2, based on the changed cost of interface fastethernet 0/17.
The next change occurs when the spanning-tree vlan 1 root primary command is issued on SW1-2950. This command changes the bridge priority to 24,576, which makes SW1-2950 the root. The debug messages that follow confirm this fact.
EtherChannel Configuration
Finally, the two switches do have parallel Ethernet connections that could be configured for EtherChannel. By doing so, STP does not block on either interface, because STP treats both interfaces on each switch as one link. Example 2-3 shows the SW1-2950 configuration and show commands for the new EtherChannel.
Example 2-3 Configuring and Monitoring EtherChannel
sw1-2950#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. sw1-2950(config)#int fa 0/16 sw1-2950(config-if)#channel-group 1 mode on sw1-2950(config)#int fa 0/17 sw1-2950(config-if)#channel-group 1 mode on sw1-2950(config-if)#^Z
sw1-2950#show spanning-tree
VLAN0001 |
|
|
|
|
Spanning tree enabled protocol ieee |
|
|||
Root ID |
Priority |
24577 |
|
|
|
Address |
000a.b7dc.b780 |
|
|
|
This bridge |
is the root |
|
|
|
Hello Time |
2 sec |
Max Age 20 sec |
Forward Delay 15 sec |
Bridge ID |
Priority |
24577 |
(priority 24576 sys-id-ext 1) |
|
|
Address |
000a.b7dc.b780 |
|
|
|
Hello Time |
2 sec |
Max Age 20 sec |
Forward Delay 15 sec |
Aging Time 15 |
|
|
|
|
|
||
Interface |
Port ID |
|
|
Designated |
Port ID |
||
Name |
Prio.Nbr |
Cost |
Sts |
Cost |
Bridge ID |
Prio.Nbr |
|
---------------- |
-------- --------- |
--- --------- |
-------------------- |
-------- |
|||
|
|
|
|
|
|
|
|
Po1 |
128.65 |
|
12 |
LIS |
0 |
24577 000a.b7dc.b780 |
128.65 |
|
|
|
|
|
|
|
|
sw1-2950# |
|
|
|
|
|
|
|
00:32:27: STP: VLAN0001 Po1 -> learning 00:32:42: STP: VLAN0001 Po1 -> forwarding
Spanning Tree Protocol Configuration 61
Example 2-3 Configuring and Monitoring EtherChannel (Continued)
sw1-2950#show etherchannel 1 summary
Flags: D - down |
P - |
in port-channel |
I - stand-alone s - |
suspended |
|
R - Layer3 |
S - |
Layer2 |
u - unsuitable for bundling |
||
U - port-channel in use |
||
d - default port |
|
|
Group |
Port-channel |
Ports |
-----+ |
------------ |
+----------------------------------------------------------- |
|
|
|
1 |
Po1(SU) |
Fa0/16(P) Fa0/17(P) |
|
|
|
At the beginning of this example, you see the configuration on SW1-2950. On the 2950, any port can be part of an EtherChannel, with up to eight on a single EtherChannel, so the EtherChannel commands are interface subcommands. The channel-group 1 mode on interface subcommands enable EtherChannel on interfaces fastethernet 0/16 and 0/17. Both switches must agree on the number for the EtherChannel—1 in this case.
The channel-group command uses the on parameter on both switches to ensure that the two links are placed in an EtherChannel. If for some reason SW2 was not configured correctly for EtherChannel, the ports could not be used. Alternatively, the EtherChannel configuration commands on each switch could use parameters of auto or desirable instead of on. With these other parameters, the switches negotiate whether to use EtherChannel. If negotiated, an EtherChannel is formed. If not, the ports can be used without forming an EtherChannel, with STP blocking some interfaces.
The use of the auto and desirable parameters can be deceiving. If you configure auto on both switches, the EtherChannel never comes up! The auto keyword tells the switch to wait for the other switch to start the negotiations. If both switches are waiting, it’s a long wait! As long as one of the two switches is configured with the keyword desirable, the EtherChannel is negotiated.
In the rest of Example 2-3, you see several references to port-channel or Po. Because STP treats the channel as one link, the switch needs some way to represent the entire EtherChannel. The 2950 IOS uses the term Po, short for “port channel,” as a way to name the EtherChannel. (EtherChannel is sometimes called “port channeling.”) For instance, near the end of the example, the show etherchannel 1 summary command references Po1, for port channel/EtherChannel 1.