Agenda: lab-ospf+static.txt

File lab-ospf+static.txt, 13.0 KB (added by cvicente, 6 years ago)
Line 
1% Network Design Workshop
2% Basic Routing Lab
3
4\pagebreak
5
6# Introduction
7
8The purpose of this exercise is to:
9
10* Configure the basics of a Cisco router
11* Enable OSPF to exchange internal routing information
12* Configure static routing towards a service provider
13
14![Physical Topology - Module 1](ex1-1.png)
15
16![Physical Topology - Module 2](ex1-2.png)
17
18
19The network configuration is designed to be modular to
20allow the lab to grow as needed depending on the number
21of partipants. Each module will contain 1 ISP and 3 customer
22networks (universities, etc). Modules will be interconnected
23(see Fig. 3)
24
25![Topology with 2 modules](ex1-3.png)
26
27# Logistics
28
29Each participant will be assigned to a network. Depending on the
30number of participants, either a single person or a group will be
31responsible for the configuration of a router. You may be asked
32to rotate and work on a different router so that you have the
33opportunity to understand the network from another point of view.
34
35As you go through the exercises, you will see examples of
36configurations for one or more routers. **Make sure to take those
37examples and adapt them to your own router, network topology and
38addressing scheme. Use the diagrams to guide you.**
39
40Refer to the *Lab Access Instructions* document for information
41about logging into the routers that have been assigned to you.
42
43# Address Space Allocation
44
45## End networks (universities, etc)
46
47Group      IPv4            IPv6            ASN
48-------    ------------    -------------   -------
491          10.10.0.0/16    fd00:10::/32    10
502          10.20.0.0/16    fd00:20::/32    20
513          10.30.0.0/16    fd00:30::/32    30
52
53*The list will continue in the same pattern if there are more
54groups.*
55
56Each group will then further partition their space as follows:
57
58IPv4               IPv6                 Description
59---------------    ---------------      --------------------
6010.X0.0.0/17       fd00:X0::/40         End user space
6110.X0.254.0/24     fd00:X0:fe::/64      Point-to-point links   
6210.X0.255.0/24     fd00:X0:ff::/64      Router loopbacks
63
64Where X is your group number (1,2,3...)
65
66Prefixes for point to point links will be of length /30 for IPv4
67and /127 for IPv6 (we will adopt the recommendations of RFC6164
68for IPv6 inter-router links):
69
70IPv4                IPv6                Description
71---------------     ----------------    --------------------
7210.X0.254.0/30      fd00:X0:fe::/127    P2P #1
7310.X0.254.4/30      fd00:X0:fe::2/127   P2P #2
7410.X0.254.8/30      fd00:X0:fe::4/127   P2P #3
75
76... and so on.
77
78Router loopback addresses will be of size /32 for IPv4 and /128
79for IPv6:
80
81IPv4                IPv6                Description
82---------------     ----------------    --------------------
8310.X0.255.1/32      fd00:X0:ff::1/128   RX1 Loopback
8410.X0.255.2/32      fd00:X0:ff::2/128   RX2 Loopback
85
86
87## Commercial Internet Service Providers (ISPs)
88
89ISP     IPv4            IPv6            ASN
90-----   ------------    -------------   -------
911       10.201.0.0/16   fd00:200::/32   201
922       10.202.0.0/16   fd00:201::/32   202
93
94... and so on.
95
96## Internet Exchange Points (IXPs)
97
98IXP     IPv4            IPv6   
99-----   ------------    ---------------
1001       10.251.1.0/24   fd00:251:1::/64
101
102
103# Basic Router Configuration
104
1051. Name the router
106
107~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108enable
109config terminal
110hostname R11
111~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112
1132. Configure Authentication
114
115~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116aaa new-model
117aaa authentication login default local
118aaa authentication enable default enable
119username nsrc secret nsrc
120enable secret nsrc
121service password-encryption
122line vty 0 4
123 transport preferred none
124line console 0
125 transport preferred none
126~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
127
1283. Configure logging
129
130~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
131no logging console
132logging buffered 8192 debugging
133~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
134
1354. Disable DNS resolution
136
137~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138no ip domain-lookup
139~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
140
1415. Make sure the router understands CIDR. This is the default
142setting in recent IOS versions, but just in case.
143
144~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
145ip subnet-zero
146ip classless
147~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
148
1496. Disable source routing
150
151~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
152no ip source-route
153~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154
1557. Activate IPv6 routing
156
157~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
158ipv6 unicast-routing
159~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160
1618. Exit configuration mode and save
162
163~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
164end
165write memory
166~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
167
1689. Configure your interfaces according to the diagram
169
170*Notice that for the links to the ISP we will use the ISP's
171addresses, while for internal links we use internal addresses.*
172
173On R11:
174
175~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
176interface GigabitEthernet2/0
177 ip address 10.10.254.1 255.255.255.252
178 description P2P Link to R12
179 ipv6 address fd00:10:fe::/127
180 no shutdown
181!
182~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
183
184
185On R12:
186
187~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
188interface GigabitEthernet1/0
189 ip address 10.201.254.2 255.255.255.252
190 description P2P Link to ISP1
191 ipv6 address fd00:201:fe::1/127
192 no shutdown
193!
194interface GigabitEthernet2/0
195 ip address 10.10.254.2 255.255.255.252
196 description P2P Link to R11
197 ipv6 address fd00:10:fe::1/127
198 no shutdown
199~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
200
201
20210. Do some PING tests
203
204~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
205R12# ping 10.10.254.1           <- R11
206R12# ping fd00:10:fe::0         <- R11
207R12# ping 10.201.254.1          <- ISP1
208R12# ping fd00:201:fe::0        <- ISP1
209~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
210
211and then verify the output of the following commands:
212
213~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
214show arp                    : Show ARP cache
215show interface <int>        : Show interface state and config
216show ip interface           : Show interface IP state and config
217show ipv6 neighbors         : Show IPv6 neighbors
218show ipv6 interface <int>   : Show interface state and config
219show cdp neighbors          : Show neighbors seen via CDP
220~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
221
22211. Create Loopback interface
223
224On R11:
225
226~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
227interface loopback 0
228 ip address 10.10.255.1 255.255.255.255
229 ipv6 address fd00:10:ff::1/128
230~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
231
232do the same for R12 (obviously, using different
233addresses).
234
23512. Verify and save the configuration.
236
237~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
238show running-config
239write memory
240~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
241
242# Routing
243
244## OSPF
245
2461. Try pinging the loopback addresses of your neighbor
247
248~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
249R11# ping 10.10.255.2           <- R12 loopback
250R11# ping fd00:10:ff:2          <- R12 loopback
251~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
252
253What is happening?
254
2552. Configure a new OSPF routing process.
256
257Notice that we will use the numbrer "10" as the
258OSPF process number for routers R11 and R12.
259This number is local to the router, so it doesn't
260need to match the process number of a neighboring
261router. However, it is strongly recommended that you
262use the same number throughout your network. Most
263people use their Autonomous System number (although
264OSPF has nothing to do with the BGP AS).
265
266
267On R11 and R12:
268
269~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
270router ospf 10
271 log-adjacency-changes
272 passive-interface default
273!
274ipv6 router ospf 10
275 log-adjacency-changes
276 passive-interface default
277 area 0 authentication ipsec spi 256 md5 0123456789ABCDEF0123456789ABCDEF
278!
279~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
280
281
2823. Now configure OSPF on the interfaces *where adjacencies
283need to be established, and also on any interface that needs
284to have its subnets advertised by OSPF*
285
286On R11 and R12:
287
288~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
289interface Loopback0
290 ip ospf 10 area 0
291 ipv6 ospf 10 area 0
292!
293interface GigabitEthernet2/0
294 ip ospf 10 area 0
295 ip ospf authentication message-digest
296 ip ospf authentication-key N$RC
297 ipv6 ospf 10 area 0
298~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
299
300Finally, since we have configured OSPF to make all
301interfaces passive by default (good idea!), we need
302to explicitly activate the BGP Hello function in
303the interfaces where adjacencies need to happen:
304
305~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
306router ospf 10
307 no passive-interface GigabitEthernet2/0
308!
309ipv6 router ospf 10
310 no passive-interface GigabitEthernet2/0
311~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
312
313
3144. STOP. Checkpoint
315
316Now try the following show commands:
317
318~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
319sh ip ospf neighbor     : show adjacencies             
320sh ip route             : show routes in routing table
321sh ip ospf              : show general OSPF information
322sh ip ospf interface    : show the status of OSPF in an interface
323
324show ipv6 ospf neighbor
325show ipv6 route
326show ipv6 ospf
327show ipv6 ospf interface
328~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
329
330Repeat the last ping tests. Can you ping the loopback
331address of the neighboring router now?
332
333## Static default routes
334
3351. Configure static default routes to reach the outside world.
336
337On R11:
338
339~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
340ip route 0.0.0.0 0.0.0.0 10.10.254.2
341ipv6 route ::/0 fd00:10:fe::1
342~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
343
344On R12:
345
346~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
347ip route 0.0.0.0 0.0.0.0 10.201.254.1
348ipv6 route ::/0 fd00:201:fe::
349~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
350
351Do some ping and traceroute tests.
352
353~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
354R11# ping 10.20.255.1
355R11# ping 10.30.255.1
356R11# traceroute 10.20.255.1
357R11# traceroute 10.30.255.1
358~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
359
360Can you reach the routers in other networks?
361
362Don't forget to save your configurations.
363
364\pagebreak
365
366# Appendix A - ISP1 Initial Configuration
367
368~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
369hostname ISP1
370aaa new-model
371aaa authentication login default local
372aaa authentication enable default enable
373username nsrc secret nsrc
374enable secret nsrc
375service password-encryption
376line vty 0 4
377 transport preferred none
378line console 0
379 transport preferred none
380no logging console
381logging buffered 8192 debugging
382no ip domain-lookup
383ip subnet-zero
384ip classless
385no ip source-route
386ipv6 unicast-routing
387!
388interface Loopback0
389 ip address 10.201.255.1 255.255.255.255
390 ipv6 address fd00:201:ff::1/128
391!
392interface GigabitEthernet1/0
393 description Link to IXP
394 ip address 10.251.1.1 255.255.255.0
395 ipv6 address fd00:251:1::1/64
396 no shutdown
397!
398interface GigabitEthernet3/0
399 description P2P Link to R12
400 ip address 10.201.254.1 255.255.255.252
401 ipv6 address fd00:201:fe::/127
402 no shutdown
403!
404interface GigabitEthernet4/0
405 description P2P Link to R22
406 ip address 10.201.254.5 255.255.255.252
407 ipv6 address fd00:201:fe::2/127
408 no shutdown
409!
410interface GigabitEthernet5/0
411 description P2P Link to R32
412 ip address 10.201.254.9 255.255.255.252
413 ipv6 address FD00:201:fe::4/127
414 no shutdown
415!
416ip route 10.10.0.0 255.255.0.0 10.201.254.2
417ipv6 route fd00:10::/32 fd00:201:fe::1
418!
419ip route 10.20.0.0 255.255.0.0 10.201.254.6
420ipv6 route fd00:20::/32 fd00:201:fe::3
421!
422ip route 10.30.0.0 255.255.0.0 10.201.254.10
423ipv6 route fd00:30::/32 fd00:201:fe::5
424!
425ip route 0.0.0.0 0.0.0.0 10.251.1.2
426ipv6 route ::/0 fd00:251:1::2
427
428~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
429
430\pagebreak
431
432# Appendix B - ISP2 Initial Configuration
433
434~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
435hostname ISP2
436aaa new-model
437aaa authentication login default local
438aaa authentication enable default enable
439username nsrc secret nsrc
440enable secret nsrc
441service password-encryption
442line vty 0 4
443 transport preferred none
444line console 0
445 transport preferred none
446no logging console
447logging buffered 8192 debugging
448no ip domain-lookup
449ip subnet-zero
450ip classless
451no ip source-route
452ipv6 unicast-routing
453!
454interface Loopback0
455 ip address 10.202.255.1 255.255.255.255
456 ipv6 address fd00:202:ff::1/128
457!
458interface GigabitEthernet1/0
459 description Link to IXP
460 ip address 10.251.1.2 255.255.255.0
461 ipv6 address fd00:251:1::2/64
462 no shutdown
463!
464interface GigabitEthernet3/0
465 description P2P Link to R42
466 ip address 10.202.254.1 255.255.255.252
467 ipv6 address fd00:202:fe::0/127
468 no shutdown
469!
470interface GigabitEthernet4/0
471 description P2P Link to R52
472 ip address 10.202.254.5 255.255.255.252
473 ipv6 address fd00:202:fe::2/127
474 no shutdown
475!
476interface GigabitEthernet5/0
477 description P2P Link to R62
478 ip address 10.202.254.9 255.255.255.252
479 ipv6 address FD00:202:fe::4/127
480 no shutdown
481!
482ip route 10.40.0.0 255.255.0.0 10.202.254.2
483ipv6 route fd00:40::/32 fd00:202:fe::1
484!
485ip route 10.50.0.0 255.255.0.0 10.202.254.6
486ipv6 route fd00:50::/32 fd00:202:fe::3
487!
488ip route 10.60.0.0 255.255.0.0 10.202.254.10
489ipv6 route fd00:60::/32 fd00:202:fe::5
490!
491ip route 0.0.0.0 0.0.0.0 10.251.1.1
492ipv6 route ::/0 fd00:251:1::1
493~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
494