Agenda: Layer2-lab.txt

File Layer2-lab.txt, 15.1 KB (added by dean, 5 years ago)
Line 
1% Layer 2 Network Design Lab
2
3\pagebreak
4
5# Part 1
6
7## Introduction
8
9The purpose of these exercises is to build Layer 2 (switched) networks
10utilizing the concepts explained in today's design presentations. Students
11will see how star topology, aggregation, virtual LANs, Spanning Tree
12Protocol, etc. are put to work.
13
14There will be 5 groups of students, with 4 switches per group.  The
15distribution of IP address space for the building (Layer 2) networks will be
16as follows:
17
18* Group 1: 10.10.64.0/24
19* Group 2: 10.20.64.0/24
20* Group 3: 10.30.64.0/24
21* Group 4: 10.40.64.0/24
22* Group 5: 10.50.64.0/24
23
24### Switch types used in the lab
25
26Cisco 3725 with 16 Port 10BaseT/100BaseTX EtherSwitch (NM-16ESW) module
27
28*Note: This Cisco model is actually a router, but the 16-port module provides
29basic Layer-2 capabilities, and we will use these as switches. Dynamips does
30not support the emulation of the Cisco Catalyst class of switches, unfortunately.*
31
32### Lab access instructions
33
34Refer to the file called [lab-access-dynamips.txt]()
35
36## Hierarchical, redundant network
37
38Our building network consists of two redundant backbone switches and two edge
39switches. The backbone switches connect to the core of our campus network
40and serve as aggregation points for all the edge switches. Edge switches serve
41the end users. Each edge switch has a connection to both backbone switches, so that
42if one of the backbone switches fails, the switch has an alternative connection.
43
44![Lab topology](lab-L2-topology.png)
45
46### Basic Switch Configuration
47
48Follow these instructions to configure each switch:
49
501. Name the switch
51
52~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53enable
54config terminal
55hostname <NAME>
56~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57
582. Configure Authentication
59
60~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61aaa new-model
62aaa authentication login default local
63aaa authentication enable default enable
64username nsrc secret nsrc
65enable secret nsrc
66service password-encryption
67line vty 0 4
68 transport preferred none
69line console 0
70 transport preferred none
71~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72
733. Configure logging
74
75~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76no logging console
77logging buffered 8192 debugging
78~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79
804. Disable DNS resolution
81
82~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
83no ip domain-lookup
84~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85
865. Exit configuration mode and save
87
88~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89end
90write memory
91~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92
93
94### IP Address Configuration
95
961. Assign each switch a different IP address as follows:
97
98~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99int vlan 1
100 ip address 10.X0.64.Y 255.255.255.0
101 no shut
102end
103~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104
105Replace the "X" with the corresponding octet from your group's IP prefix,
106and replace "Y" like this:
107
108    1. BBX1: 10.X0.64.4
109    1. BBX2: 10.X0.64.5
110    1. SWX1: 10.X0.64.6
111    1. SWX2: 10.X0.64.7
112
113Verify connectivity by pinging each switch. Do not continue until you
114can ping each switch from every other switch.
115
116HINT: If ping fails, but the configuration seems OK, try doing the following:
117
118~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119int vlan 1
120 shutdown
121 no shutdown
122end
123~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
124
125(this is not normal, but most likely a bug in the IOS code somewhere)
126
127## Spanning Tree Protocol
128
129### STP Status
130
131Run the following commands and pay close attention to the output:
132
133~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
134show spanning-tree brief
135show spanning-tree blockedports
136show spanning-tree
137~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138
139a. What is the priority on each switch?
140
141b. Which switch is the root? Why?
142
143c. Which ports are blocked? Why?
144
145### STP Configuration
146
1471. Configure the STP priorities explicitly for each switch, according
148to the plan in Appendix A.
149
150For example, on BB11:
151
152~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
153BB11(config)#spanning-tree vlan 1 priority 12288
154~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
155
1562. Verify:
157
158~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
159show spannning-tree brief
160~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161
162Why is it so important to set the priorities explicitly?
163
164### Disabling STP
165
166We are now going to disable spanning tree to see what effect it has.
167
168*WARNING: Disabling spanning tree has a significant effect on the Dynamips
169server's CPU load. For this reason, we cannot have all groups disable
170spanning tree at the same time. We will take turns.*
171
172
173 **ASK THE INSTRUCTOR BEFORE DISABLING STP!!!**
174
175
176When you get the go-ahead from the instructor, execute the following
177on each switch:
178
179~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
180no spanning-tree vlan 1
181~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
182
183Can the switches ping each other reliably now? Why?
184
185Watch the port counters on the inter-switch links.
186 
187~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
188show interfaces stats
189~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
190
191What happens with the counters of the connected interfaces?
192What is going on?
193
194Very quickly enable STP again on all switches:
195
196~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
197spanning-tree vlan 1
198~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
199
200### Simulate a backbone failure
201
2021. Disconnect BBX1 from the rest of the network:
203
204~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
205interface range fastEthernet 1/12 - 15
206 shutdown
207~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
208
209While it is cut off from the rest, verify spanning tree status on the
210other switches.
211
212a. Who is the root now?
213
214b. Verify port roles and status.  Verify connectivity with ping.
215
2162. Reconnect BBX1:
217
218~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
219interface range fastEthernet 1/12 - 15
220 no shutdown
221~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
222
223What happens to the spanning tree when the switch comes back online?
224
225# Part 2
226
227## VLANs
228
229We now want to segment the network to separate end-user traffic from VOIP and
230network management traffic. Each of these segments will be a separate subnet.
231
232### Configure the switches with DATA, VOIP and MGMT VLANs.
233
234VTP (VLAN Trunking Protocol) is a proprietary Cisco technology that allows
235for dynamic VLAN provisioning. We will not use it here.
236
2371. Disable VTP by setting it to 'transparent mode':
238
239~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
240vtp mode transparent
241~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
242
2432. Add the VLANs to the VLAN database and give them names to better identify them:
244
245~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
246vlan 64
247 name DATA
248vlan 65
249 name VOIP
250vlan 255
251 name MGMT
252~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
253
2543. Move the IP address to the MGMT vlan (notice the new subnet octet "255"):
255
256~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
257interface vlan 1
258 no ip address
259interface vlan 255
260 ip address 10.X0.255.Y 255.255.255.0
261~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
262
263Verify connectivity between switches. Can you ping? What's missing?
264
2654. Configure trunk ports. Do the following for each port that needs
266to tag VLAN frames:
267
268~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
269interface FastEthernet1/14
270 switchport mode trunk
271 switchport trunk encapsulation dot1q
272~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
273
274Note: Check Figure 1 to see which ports you need to modify. BBX1 and
275BBX2 are each connected to a router on Fast1/1. This port also needs
276to be a trunk.
277
278Try pinging between switches again. It should work now.
279
2805. Designate 5 edge ports for each DATA and VOIP VLAN access:
281
282On SWX1 and SWX2 only:
283
284~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
285interface range Fast1/1 - 5
286 switchport mode access
287 switchport access vlan 64
288!
289interface range Fast1/6 - 10
290 switchport mode access
291 switchport access vlan 65
292~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
293
294Verify which ports are members or trunks of each vlan:
295
296~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
297show vlan-switch id <VLAN ID>
298~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
299
300Imagine that there are computers connected to the DATA vlan. Would they be able
301to ping the switch? Explain your response.
302
303Verify the Spanning Tree status:
304
305~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
306show spanning-tree brief
307~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
308
309Notice the root and bridge priorities on each VLAN (1,64,65,255). Are they the same?
310
311*Note: This is called "Per-VLAN spanning tree", or PVST. This means that the switches are
312creating 4 separate trees, each with its own parameters, status, calculations, etc.
313Imagine if you had several hundred VLANs! This is certainly not ideal. There are
314better standards, like "Multiple Spanning Tree" (MST), that allow the administrator
315to create only the desired number of trees, and map groups of VLANs to each tree.
316Unfortunately, this Cisco device does not support MST.*
317
318## VLAN load-balancing with PVST
319
320Your two aggregation switches are each connected to a core router (not shown
321in the pictures).
322
323Suppose you wanted to load-balance the traffic from your various VLANs as
324they leave your aggregation switches towards your routers? How can you achieve
325this?
326
3271. Configure BBX1 as the root switch for VLANs 64,65, and BBX2 as the root switch
328for VLAN 255. Also, make each switch a secondary root for the other VLAN(s):
329
330On BBX1:
331
332~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
333spanning-tree vlan 64 priority 12288
334spanning-tree vlan 65 priority 12288
335spanning-tree vlan 255 priority 16384
336~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
337
338On BBX2:
339
340~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
341spanning-tree vlan 64 priority 16384
342spanning-tree vlan 65 priority 16384
343spanning-tree vlan 255 priority 12288
344~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
345
346On SWX1 and SWX2, the priorities are the same on every VLAN:
347
348~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
349spanning-tree vlan 64 priority 24576
350spanning-tree vlan 65 priority 24576
351spanning-tree vlan 255 priority 24576
352~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
353
3542. Verify that the root switch is the correct one in all cases:
355
356~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
357show spanning-tree brief
358~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
359
360## STP Extended Features
361
362### PortFast
363
364PortFast is a feature that allows end-user stations to be granted instant access
365to the L2 network. Instead of starting at the bottom of the Blocking-Listening-
366Learning-Forwarding hierarchy of states (30 seconds!), Portfast starts at the top.
367The port starts in Forwarding state, and if a loop is detected, STP does all its
368calculations and blocks the necessary ports. This feature should only be applied
369to ports that connect end-user stations.
370
3711. Configure end-user ports to be in PortFast mode:
372
373~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
374interface range fast1/1 - 10
375 spanning-tree portfast
376~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
377
378### BPDUGuard
379
380With PortFast, end-user ports still participate in STP. That means that anything
381connected to those ports can send BPDUs and participate in (and affect the status of)
382the spanning tree calculations. For example, if the device connected to the edge port
383is configured with a lower bridge priority, it becomes the root switch and the tree
384topology becomes suboptimal.
385
386Another useful Cisco feature that avoids this situation is BPDUGuard. At the reception
387of BPDUs, the BPDU guard operation disables the port that has PortFast configured.
388
3891. Enable BPDUGuard on all ports with PortFast enabled:
390
391~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
392spanning-tree portfast bpduguard
393~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
394
395## Port Bundling
396
397We now want more capacity and link redundancy between the aggregation switches.
398
3991. Configure a Port Channel between BBX1 and BBX2:
400
401~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
402interface port-channel 1
403 description BBX1-BBX2 aggregate link
404!
405interface range fast1/12 - 13
406 channel-group 1 mode on
407~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
408
4092. Verify the status:
410
411~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
412show interface port-channel 1
413~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
414
415What capacity do you have now on the new trunk?
416Hint: Look for the line that says BW ... Kbit/sec
417
4183. Disable one of the ports in the bundle.
419
420~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
421interface fast 1/12
422 shutdown
423~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
424
425Is the channel still up?
426
4274. Enable it again:
428
429~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
430interface fast 1/12
431 no shutdown
432~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
433
434*Note: There is a standard protocol for port bundling. It's called "LACP"
435(Link Aggregation Control Protocol). This particular Cisco device does
436not support LACP, so these port channels are actually using a proprietary
437Cisco protocol called "EtherChannel". All modern switches support LACP, so
438we strongly recommend using it, instead of any proprietary versions.*
439
440\pagebreak
441
442# Reference
443
444## Appendix A - Spanning Tree Configuration
445
446Refer to this priority table below for the appropriate priorities on each
447switch.
448
449---------------------------------------------------------------------------
450Priority   Description               Notes
451--------   -----------------------   --------------------------------------
4520          Core Node                 The core switches/routers will not be
453                                     participating in STP... reserved in
454                                     case they ever are
455
4564096       Redundant Core Node       Ditto
457                                 
458
4598192       Reserved
460
46112288      **Building Backbone**
462
46316384      **Redundant Backbones**
464
46520480      Secondary Backbone        This is for building complexes, where
466                                     there are separate building (secondary)
467                                     backbones that terminate at the complex
468                                     backbone.
469
47024576      **Access Switches**       This is the normal edge-device priority
471
47228672      Access Switches           Used for access switches that are
473                                     daisy-chained from another access switch.
474                                     We're using this terminology instead of
475                                     "aggregation switch" because it's hard to
476                                     define when a switch stops being an
477                                     access switch and becomes an
478                                     aggregation switch.
479 
48032768      Default                   No managed network devices should have
481                                     this priority.
482---------------------------------------------------------------------------
483
484Table: Priority Table
485
486
487\pagebreak
488