Agenda: lab-ospf+static.txt

File lab-ospf+static.txt, 14.0 KB (added by cvicente, 6 years ago)
Line 
1% Advanced Routing 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 description P2P Link to R12
178 ip address 10.10.254.1 255.255.255.252
179 no ip directed-broadcast
180 no ip redirects
181 no ip proxy-arp
182 ipv6 address fd00:10:fe::/127
183 ipv6 nd ra suppress
184 no shutdown
185!
186~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
187
188
189On R12:
190
191~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192interface GigabitEthernet1/0
193 description P2P Link to ISP1
194 ip address 10.201.254.2 255.255.255.252
195 no ip directed-broadcast
196 no ip redirects
197 no ip proxy-arp
198 ipv6 address fd00:201:fe::1/127
199 ipv6 nd ra suppress
200 no shutdown
201!
202interface GigabitEthernet2/0
203 description P2P Link to R11
204 ip address 10.10.254.2 255.255.255.252
205 no ip directed-broadcast
206 no ip redirects
207 no ip proxy-arp
208 ipv6 address fd00:10:fe::1/127
209 ipv6 nd ra suppress
210 no shutdown
211
212~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
213
214Explanations for some of the above commands:
215
216*no ip directed-broadcast*
217
218An IP directed broadcast is an IP packet whose destination address
219is a valid broadcast address for some IP subnet, but which originates
220from a node that is not itself part of that destination subnet.
221
222Because directed broadcasts, and particularly Internet Control Message
223Protocol (ICMP) directed broadcasts, have been abused by malicious persons,
224we recommend disabling the ip directed-broadcast command on any intereface
225where directed broadcasts are not needed (probably all).
226
227*no ip proxy-arp*
228
229Proxy ARP is the technique in which one host, usually a router, answers
230ARP requests intended for another machine. By "faking" its identity, the
231router accepts responsibility for routing packets to the "real" destination.
232Proxy ARP can help machines on a subnet reach remote subnets without the need
233to configure routing or a default gateway.
234
235Disadvantages of proxy arp:
236
237* It increases the impact of ARP spoofing, in which a machine claims to
238be another in order to intercept packets.
239* It hides network misconfigurations in hosts
240* Hosts will have larger ARP tables
241
242*no ip redirects*
243
244ICMP redirects can be sent to a host when the router knows that another router in
245the same subnet has a better path to a destination. If a hacker installs
246a router in the network that causes the legitimate router to learn these
247ilegitimate paths, the hacker's router will end up diverting legitimate
248traffic thanks to ICMP redirects. Thus, we recommend that you disable this
249feature in all your interfaces.
250
251*ipv6 nd ra supress*
252
253IPv6 router advertisements are sent periodically by routers to inform hosts
254that the router is present, and to allow hosts to autoconfigure themselves using
255stateless autoconfiguration mechanisms. This is not necessary on
256point-to-point interfaces.
257
25810. Do some PING tests
259
260~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
261R12# ping 10.10.254.1           <- R11
262R12# ping fd00:10:fe::0         <- R11
263R12# ping 10.201.254.1          <- ISP1
264R12# ping fd00:201:fe::0        <- ISP1
265~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
266
267and then verify the output of the following commands:
268
269~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
270show arp                    : Show ARP cache
271show interface <int>        : Show interface state and config
272show ip interface           : Show interface IP state and config
273show ipv6 neighbors         : Show IPv6 neighbors
274show ipv6 interface <int>   : Show interface state and config
275show cdp neighbors          : Show neighbors seen via CDP
276~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
277
27811. Create Loopback interface
279
280On R11:
281
282~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
283interface loopback 0
284 ip address 10.10.255.1 255.255.255.255
285 ipv6 address fd00:10:ff::1/128
286~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
287
288do the same for R12 (obviously, using different
289addresses).
290
29112. Verify and save the configuration.
292
293~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
294show running-config
295write memory
296~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
297
298# Routing
299
300## OSPF
301
3021. Try pinging the loopback addresses of your neighbor
303
304~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
305R11# ping 10.10.255.2           <- R12 loopback
306R11# ping fd00:10:ff:2          <- R12 loopback
307~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
308
309Q. What is happening?
310
3112. Configure a new OSPF routing process.
312
313Notice that we will use the number "10" as the
314OSPF process number for routers R11 and R12.
315This number is local to the router, so it doesn't
316need to match the process number of a neighboring
317router. However, it is recommended that you
318use the same number throughout your network. Most
319people use their Autonomous System number (although
320OSPF has nothing to do with the BGP ASN).
321
322On R11 and R12:
323
324~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
325router ospf 10
326 log-adjacency-changes
327 passive-interface default
328!
329ipv6 router ospf 10
330 log-adjacency-changes
331 passive-interface default
332 area 0 authentication ipsec spi 256 md5 0123456789ABCDEF0123456789ABCDEF
333
334~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
335
3363. Now configure OSPF on the interfaces where adjacencies
337need to be established:
338
339On R11 and R12:
340
341~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
342interface GigabitEthernet2/0
343 ip ospf 10 area 0
344 ip ospf authentication message-digest
345 ip ospf authentication-key N$RC
346 ip ospf network point-to-point
347 ipv6 ospf 10 area 0
348 ipv6 ospf network point-to-point
349~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
350
351Notice two things:
352
353a) We are configuring authentication to have control
354   over who becomes an adjacent router and protect
355   against ilegitimate routing information. We configure
356   authentication per interface in IPv4 and per area in
357   IPv6, just because it is simpler that way.
358
359b) We use the "network point-to-point" statement
360   because we are using point-to-point links over a broadcast
361   network. There is no reason for OSPF to elect a Designated
362   Router (DR) and Backup Designated Router (BDR).
363
364Then, since we have configured OSPF to make all
365interfaces passive by default (recommended!), we need
366to explicitly activate the *OSPF Hello* function on
367the interfaces where routing information needs to
368be exchanged:
369
370R11 and R12:
371
372~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
373router ospf 10
374 no passive-interface GigabitEthernet2/0
375!
376ipv6 router ospf 10
377 no passive-interface GigabitEthernet2/0
378~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
379
380Now configure OSPF on any interface that needs
381to have its subnets advertised by OSPF, if OSPF has
382not been enabled already:
383
384On R11 and R12:
385
386~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
387interface Loopback0
388 ip ospf 10 area 0
389 ipv6 ospf 10 area 0
390~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
391
3925. STOP. Checkpoint
393
394Now try the following show commands:
395
396~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
397sh ip ospf neighbor     : show adjacencies             
398sh ip route             : show routes in routing table
399sh ip ospf              : show general OSPF information
400sh ip ospf interface    : show the status of OSPF in an interface
401
402show ipv6 ospf neighbor
403show ipv6 route
404show ipv6 ospf
405show ipv6 ospf interface
406~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
407
408Repeat the last ping tests.
409
410Q. Can you ping the loopback address of the neighboring router now?
411
412## Static default routes
413
4141. Configure static default routes to reach the outside world.
415
416On R11:
417
418~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
419ip route 0.0.0.0 0.0.0.0 10.10.254.2
420ipv6 route ::/0 fd00:10:fe::1
421~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
422
423On R12:
424
425~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
426ip route 0.0.0.0 0.0.0.0 10.201.254.1
427ipv6 route ::/0 fd00:201:fe::
428~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
429
430Do some ping and traceroute tests.
431
432~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
433R11# ping 10.20.255.1
434R11# ping 10.30.255.1
435R11# traceroute 10.20.255.1
436R11# traceroute 10.30.255.1
437~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
438
439Q. Can you reach the routers in other networks?
440
441Don't forget to save your configurations.
442
443\pagebreak
444
445# Appendix A - ISP1 Sample Configuration
446
447
448~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
449hostname ISP1
450aaa new-model
451aaa authentication login default local
452aaa authentication enable default enable
453username nsrc secret nsrc
454enable secret nsrc
455service password-encryption
456line vty 0 4
457 transport preferred none
458line console 0
459 transport preferred none
460no logging console
461logging buffered 8192 debugging
462no ip domain-lookup
463ip subnet-zero
464ip classless
465no ip source-route
466ipv6 unicast-routing
467!
468interface Loopback0
469 ip address 10.201.255.1 255.255.255.255
470 ipv6 address fd00:201:ff::1/128
471!
472interface GigabitEthernet1/0
473 description Link to IXP
474 ip address 10.251.1.1 255.255.255.0
475 no ip directed-broadcast
476 no ip redirects
477 no ip proxy-arp
478 ipv6 address fd00:251:1::1/64
479 ipv6 nd ra supress
480 no shutdown
481!
482interface GigabitEthernet3/0
483 description P2P Link to R12
484 ip address 10.201.254.1 255.255.255.252
485 no ip directed-broadcast
486 no ip redirects
487 no ip proxy-arp
488 ipv6 address fd00:201:fe::/127
489 ipv6 nd ra supress
490 no shutdown
491!
492ip route 10.10.0.0 255.255.0.0 10.201.254.2
493ipv6 route fd00:10::/32 fd00:201:fe::1
494!
495ip route 0.0.0.0 0.0.0.0 10.251.1.2
496ipv6 route ::/0 fd00:251:1::2
497
498~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
499