Agenda: lab-bgp-basic.txt

File lab-bgp-basic.txt, 24.3 KB (added by cvicente, 6 years ago)
Line 
1% Advanced Routing Workshop
2% Basic BGP Lab
3
4![Multi-homed Topology](ex2-1.png)
5
6\pagebreak
7
8# Introduction
9
10The purpose of this exercise is to:
11
12* Understand the routing implications of
13  connecting to multiple external routing domains
14* Learn to configure basic eBGP to exchange routing
15  information with multiple external peers and iBGP
16  to carry that information inside your network.
17
18# Pre-requisites
19
20This exercise builds upon the configurations implemented in
21the OSPF + Static routing lab. You must be able to:
22
23* Ping your neighbor router in the same AS using its
24  loopback address (both IPv4 and IPv6!).
25* Ping your neighbor routers in other ASs using their
26  point-to-point link addresses.
27
28*Note: Actually, if everyone configured their OSPF and static
29routes properly in the previous exercise, you should be able
30to ping every other router using their loopback address.*
31
32# Address Space Allocation
33
34## Regional REN (RREN)
35
36We only need one:
37
38RREN    IPv4            IPv6            ASN
39-----   ------------    -------------   -------
401       10.100.0.0/16   fd00:100::/32   100
41
42## National RENs (NRENs)
43
44NREN    IPv4            IPv6            ASN
45-----   ------------    -------------   -------
461       10.101.0.0/16   fd00:101::/32   101
472       10.102.0.0/16   fd00:102::/32   102
48
49... and so on.
50
51# iBGP Configuration
52
53## Enable the BGP process
54
55Before we set up iBGP, we need to do some basic preparation
56on the router. The IOS defaults are not optimized, so before
57we bring up BGP sessions, we should set the parameters that we
58require.
59The default distance for eBGP is 20, the default distance for iBGP
60is 200, and the default distance for OSPF is 110. This means that
61there is a potential for a prefix learned by eBGP to override the
62identical prefix carried by OSPF. To protect against accidents, the
63eBGP distance is set to 200 also.
64
65The command to do this is the *distance bgp* subcommand:
66
67~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68distance bgp <external-routes> <internal-routes> <local-routes>
69~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70
71We also want to:
72
73* Enable logging of BGP neighbor state changes
74* Disable the requirement that a route must be present in the IGP
75  table before it can be advertised by BGP (synchronization).
76* Disable auto-summarization of routes to classful network boundaries
77* Disable the automatic exchange of IPv4 unicast routes on every
78  peering session.
79
80This must be done in all future BGP configurations of this workshop:
81
82On both R11 and R12:
83
84~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85router bgp 10
86 distance bgp 200 200 200
87 bgp log-neighbor-changes
88 no synchronization
89 no auto-summary
90 no bgp default ipv4-unicast
91~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92
93
94## Configure iBGP neighbors
95
96Again, make sure that you can ping the neighbor router
97using its loopback address, otherwise the BGP session
98will not come up!
99
100On R11:
101
102~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103router bgp 10
104 address-family ipv4
105  neighbor 10.10.255.2 remote-as 10
106  neighbor 10.10.255.2 update-source loopback 0
107  neighbor 10.10.255.2 description iBGP to R12
108  neighbor 10.10.255.2 password N$RC
109 address-family ipv6
110  neighbor fd00:10:ff::2 remote-as 10
111  neighbor fd00:10:ff::2 update-source loopback 0
112  neighbor fd00:10:ff::2 description iBGP to R12
113  neighbor fd00:10:ff::2 password N$RC
114~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115
116On R12:
117
118~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119router bgp 10
120 address-family ipv4
121  neighbor 10.10.255.1 remote-as 10
122  neighbor 10.10.255.1 update-source loopback 0
123  neighbor 10.10.255.1 description iBGP to R11 
124  neighbor 10.10.255.1 password N$RC
125 address-family ipv6
126  neighbor fd00:10:ff::1 remote-as 10
127  neighbor fd00:10:ff::1 update-source loopback 0
128  neighbor fd00:10:ff::1 description iBGP to R11
129  neighbor fd00:10:ff::1 password N$RC
130~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
131
132Check that the BGP sessions are up on both sides.
133
134~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135show ip bgp summary
136show bgp ipv6 unicast summary
137~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138
139## Advertise your network
140
1411. Use the 'network' command to tell BGP which
142prefixes you want to announce.
143
144On R11 and R12:
145
146~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
147router bgp 10
148 address-family ipv4
149  network 10.10.0.0 mask 255.255.0.0
150 address-family ipv6
151  network fd00:10::/32
152~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
153 
154Get the list of learned paths:
155
156~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
157show ip bgp
158show bgp ipv6 unicast
159~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160
161Q. Do you see any paths?
162
1632. Create a static route for the prefix being
164   announced on each router:
165
166On R11 and R12:
167
168~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
169ip route 10.10.0.0 255.255.0.0 null0
170ipv6 route fd00:10::/32 null0
171~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172
173*These are called a "pull up routes"*
174
175Get the list of learned paths again. You should see
176both your prefix and the neighbor's.
177
178Q. Why are these routes needed?
179
180# Multihoming - eBGP Configuration
181
182## Connect to the NREN
183
1841. Configure your RX1 router to connect to the NREN
185   with a a point-to-point link.
186
187NRENs: Use configuration in Appendix.
188
189On R11:
190
191~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192interface GigabitEthernet1/0
193 description P2P Link to NREN1
194 ip address 10.101.254.2 255.255.255.252
195 no ip directed-broadcast
196 no ip redirects
197 no ip proxy-arp
198 ipv6 address fd00:101:fe::1/127
199 ipv6 nd ra suppress
200 no shutdown
201~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
202
203Make sure that it's up and that you can ping the other
204side:
205
206~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
207ping 10.101.254.1
208ping fd00:101:fe::0
209~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
210
211Do some traceroutes to other networks again:
212
213~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
214R11# traceroute 10.20.255.1
215R11# traceroute 10.30.255.1
216~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
217
218Has anything changed since the last exercise?
219
220Notice that before we had only one connection to
221the Internet - via the ISP. Now we have two.
222But we are still using a default route pointing
223to the ISP only!
224
225We could add another default route pointing to the
226NREN, but that would not give us much flexibility
227in terms of traffic policies. Keep going.
228
229## BGP-peer with the NREN and the ISP
230
2311. Configure eBGP sessions to the ISP and the NREN
232
233On R11:
234
235~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
236router bgp 10
237 address-family ipv4
238  neighbor 10.101.254.1 remote-as 101
239  neighbor 10.101.254.1 description eBGP to NREN1
240  neighbor 10.101.254.1 password N$RC
241 address-family ipv6
242  neighbor fd00:101:fe:: remote-as 101
243  neighbor fd00:101:fe:: description eBGP to NREN1
244  neighbor fd00:101:fe:: password N$RC
245~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
246
247Q. **Notice that with eBGP we no longer use the
248loopback address as the endpoint of the BGP session,
249as we did with iBGP**
250
251On R12:
252
253~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
254router bgp 10
255 address-family ipv4
256  neighbor 10.201.254.1 remote-as 201
257  neighbor 10.201.254.1 description eBGP to ISP1
258  neighbor 10.201.254.1 password N$RC
259 address-family ipv6
260  neighbor fd00:201:fe:: remote-as 201
261  neighbor fd00:201:fe:: description eBGP to ISP1
262  neighbor fd00:201:fe:: password N$RC
263~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
264
265Check that the BGP sessions are up on both routers:
266
267~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
268show ip bgp summary
269show bgp ipv6 unicast summary
270~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
271
272Once those are up, check if you are learning any prefixes:
273
274~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
275R11# show ip bgp nei 10.101.254.1 routes
276R11# sh bgp ipv6 uni neigh fd00:101:fe:: routes
277~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
278
279Inject the point-to-point subnets that connect to
280your upstreams into your IGP (OSPF), to make sure
281that the external next hops are in the routing tables
282of each iBGP peer.
283
284On R11 and R12:
285
286~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
287interface GigabitEthernet1/0
288 ip ospf 10 area 0
289 ipv6 ospf 10 area 0
290~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
291
292Verify what you are advertising to the NREN:
293
294~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
295R11# show ip bgp nei 10.101.254.1 advertised-routes
296R11# sh bgp ipv6 uni neigh fd00:101:fe:: advertised
297~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
298
299... and to the ISP:
300
301~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
302R12# show ip bgp neighbor 10.201.254.1 advertised-routes
303R12# sh bgp ipv6 uni neigh fd00:201:fe:: advertised
304~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
305
306Are you perhaps announcing other prefixes that don't
307originate in your AS? If so, can you remember what
308serious negative implications this could have?
309Please stop and think about this. Ask the instructors
310if you need clarification.
311
312## Filter what you send and receive
313
3141. Create prefix lists for your inbound/outbound
315   filters.
316
317On R11:
318
319~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
320ip prefix-list out-peer permit 10.10.0.0/16 le 32
321ip prefix-list nren-in-peer deny 10.10.0.0/16 le 32
322ip prefix-list nren-in-peer permit 0.0.0.0/0 le 32
323ipv6 prefix-list ipv6-out-peer permit fd00:10::/32 le 128
324ipv6 prefix-list ipv6-nren-in-peer deny fd00:10::/32 le 128
325ipv6 prefix-list ipv6-nren-in-peer permit ::/0 le 128
326~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
327
328On R12:
329
330~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
331ip prefix-list out-peer permit 10.10.0.0/16 le 32
332ip prefix-list isp-in-peer deny 10.10.0.0/16 le 32
333ip prefix-list isp-in-peer permit 0.0.0.0/0 le 32
334ipv6 prefix-list ipv6-out-peer permit fd00:10::/32 le 128
335ipv6 prefix-list ipv6-isp-in-peer deny fd00:10::/32 le 128
336ipv6 prefix-list ipv6-isp-in-peer permit ::/0 le 128
337~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
338
3392. Now create inbound/outbound filters using those
340   prefix lists
341
342R11:
343
344~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
345router bgp 10
346 address-family ipv4
347  neighbor 10.101.254.1 prefix-list nren-in-peer in
348  neighbor 10.101.254.1 prefix-list out-peer out
349 address-family ipv6
350  neighbor fd00:101:fe:: prefix-list ipv6-nren-in-peer in
351  neighbor fd00:101:fe:: prefix-list ipv6-out-peer out
352~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
353
354R12:
355
356~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
357router bgp 10
358 address-family ipv4
359  neighbor 10.201.254.1 prefix-list isp-in-peer in
360  neighbor 10.201.254.1 prefix-list out-peer out
361 address-family ipv6
362  neighbor fd00:201:fe:: prefix-list ipv6-isp-in-peer in
363  neighbor fd00:201:fe:: prefix-list ipv6-out-peer out
364~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
365
366Use the *BGP refresh* capability to resend the
367information to the peer:
368
369~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
370R11#clear ip bgp 10.101.254.1 out
371R11#clear bgp ipv6 unicast fd00:101:fe:: out
372~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
373
374~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
375R12#clear ip bgp 10.201.254.1 out
376R12#clear bgp ipv6 unicast fd00:201:fe:: out
377~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
378
379You should now be advertising only your own address space.
380Check with the ISP and  NREN administrators to make sure
381that they are receiving your prefix.
382
383### Remove static routes
384
3851. The ISPs remove their static routes towards
386   their customers.
387
388Now your ISP has learned a route to reach your
389network, correct? The ISPs can now safely remove
390the static routes pointing to you and the other
391customers:
392
393ISP1:
394
395~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
396no ip route 10.10.0.0 255.255.0.0 10.201.254.2
397no ip route 10.20.0.0 255.255.0.0 10.201.254.6
398no ip route 10.30.0.0 255.255.0.0 10.201.254.10
399!
400no ipv6 route fd00:10::/32 fd00:201:fe::1
401no ipv6 route fd00:20::/32 fd00:201:fe::3
402no ipv6 route fd00:30::/32 fd00:201:fe::5
403~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
404
405ISP2:
406
407~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
408no ip route 10.40.0.0 255.255.0.0 10.202.254.2
409no ip route 10.50.0.0 255.255.0.0 10.202.254.6
410no ip route 10.60.0.0 255.255.0.0 10.202.254.10
411!
412no ipv6 route fd00:40::/32 fd00:202:fe::1
413no ipv6 route fd00:50::/32 fd00:202:fe::3
414no ipv6 route fd00:60::/32 fd00:202:fe::5
415~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
416
4172. Remove your static default routes
418
419In the previous exercise, we created default
420routes on both routers. But thanks to BGP, we
421should now be receiving routes from our NREN and
422our ISP.
423
424Let's check first (do this on both routers):
425
426~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
427show ip bgp
428show bgp ipv6 unicast
429show ip route
430show ipv6 route
431~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
432
433You should be learning routes advertised by other
434groups, and also from the NRENs and the ISPs.
435
436Remove your static default routes:
437
438R11:
439
440~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
441no ip route 0.0.0.0 0.0.0.0 10.10.254.2
442no ipv6 route ::/0 fd00:10:fe::1
443~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
444
445R12:
446
447~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
448no ip route 0.0.0.0 0.0.0.0 10.201.254.1
449no ipv6 route ::/0 fd00:201:fe::
450~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
451
452You should be able to ping any other router now.
453If you can't, wait for other groups to finish,
454or ask the instructors.
455
456Use traceroute to verify the paths that packets
457are following towards various destinations:
458
459~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
460R11# traceroute 10.100.255.1
461R11# traceroute 10.30.255.2
462...
463~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
464
465Repeat the same tests from the other router in
466your AS and compare. Use the diagram to help you
467visualize it.
468
469# Traffic Exchange (Peering)
470
471Direct traffic exchanges are usually established at no
472charge between two autonomous systems that want to save
473costs. The savings are achieved by not having to carry
474that traffic over expensive transit links via commercial
475providers. Also, these direct exchanges have the added
476benefit of reducing latency because there are fewer hops.
477
478Usually traffic exchanges occur at public exchange points,
479also known as IXPs. The simplest kind of exchange point is
480a Layer-2 switch. In this exercise, we will simply configure
481direct links between routers, which from the point of view of
482BGP is equivalent to connecting through a switch.
483
484![Peering Topology](ex2-2.png)
485
486## Connect to your neighbor AS
487
4881. Configure a point-to-point link to your neighbor AS
489as shown in the diagram. You will have to agree with
490your peer on which address space to use. **Make sure to
491pick a point-to-point subnet that is not already used!**
492
493The instructor will draw a map of the network at the front
494of the class and will ask you to document the subnet
495that was used for the peering session, so everybody can
496use that information when troubleshooting.
497
498For example, on R12:
499
500~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
501interface GigabitEthernet3/0
502 description Link to R21
503 ip address 10.10.254.5 255.255.255.252
504 no ip directed-broadcast
505 no ip redirects
506 no ip proxy-arp
507 ipv6 address fd00:10:fe::2/127
508 ipv6 nd ra suppress
509 no shutdown
510~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
511
512Don't forget to inject that subnet into OSPF.
513
514R12:
515
516~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
517interface GigabitEthernet3/0
518 ip ospf 10 area 0
519 ipv6 ospf 10 area 0
520~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
521
522Q. Remember why this is needed? If not, please ask.
523
5242. Configure prefix lists for your inbound filters
525
526On R12:
527
528~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
529ip prefix-list AS20-in-peer permit 10.20.0.0/16 le 32
530ipv6 prefix-list ipv6-AS20-in-peer permit fd00:20::/32 le 128
531~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
532
533*The equivalent needs to be done in R21.*
534
5353. Configure prefix lists for your outbound filters
536
537You should have these from a previous step. You can verify
538like this:
539
540~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
541R12#show ip prefix-list out-peer
542R12#show ipv6 prefix-list ipv6-out-peer
543~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
544
5454. Now create the BGP sessions and apply those
546   inbound/outbound filters:
547
548On R12:
549
550~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
551router bgp 10
552 address-family ipv4
553  neighbor 10.10.254.6 remote-as 20
554  neighbor 10.10.254.6 description eBGP to AS20
555  neighbor 10.10.254.6 password N$RC
556  neighbor 10.10.254.6 prefix-list out-peer out
557  neighbor 10.10.254.6 prefix-list AS20-in-peer in
558 address-family ipv6
559  neighbor fd00:10:fe::3 remote-as 20
560  neighbor fd00:10:fe::3 description eBGP to AS20
561  neighbor fd00:10:fe::3 password N$RC
562  neighbor fd00:10:fe::3 prefix-list ipv6-out-peer out
563  neighbor fd00:10:fe::3 prefix-list ipv6-AS20-in-peer in
564~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
565
566The equivalent needs to be done in R21.
567
568Verify that the sessions are up:
569
570~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
571show ip bgp summary
572show ipv6 bgp unicast summary
573~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
574
575..and that you are learning the prefix directly
576from the neighbor:
577
578~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
579R12#show ip bgp neighbor 10.10.254.6 routes
580R12#show bgp ipv6 unicast neighbors fd00:10:fe::3 routes
581~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
582
5835. Do some traceroutes towards your peer and
584   make sure that the path is direct.
585
586Remember to save your configurations.
587
588You are done! You have configured BGP in a multihomed
589environment and BGP is selecting the paths based on
590default values.
591
592
593\pagebreak
594
595# Appendix A - RREN Configuration
596
597~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
598hostname RREN
599aaa new-model
600aaa authentication login default local
601aaa authentication enable default enable
602username nsrc secret nsrc
603enable secret nsrc
604service password-encryption
605line vty 0 4
606 transport preferred none
607line console 0
608 transport preferred none
609no logging console
610logging buffered 8192 debugging
611no ip domain-lookup
612ip subnet-zero
613ip classless
614no ip source-route
615ipv6 unicast-routing
616!
617interface Loopback0
618 ip address 10.100.255.1 255.255.255.255
619 ipv6 address fd00:100:ff::1/128
620!
621interface GigabitEthernet1/0
622 description P2P Link to RREN1
623 ip address 10.100.254.1 255.255.255.252
624 no ip directed-broadcast
625 no ip redirects
626 no ip proxy-arp
627 ipv6 address fd00:100:fe::/127
628 ipv6 nd ra suppress
629 no shutdown
630!
631interface GigabitEthernet2/0
632 description P2P Link to RREN2
633 ip address 10.100.254.5 255.255.255.252
634 no ip directed-broadcast
635 no ip redirects
636 no ip proxy-arp
637 ipv6 address fd00:100:fe::2/127
638 ipv6 nd ra suppress
639 no shutdown
640!
641interface GigabitEthernet3/0
642 description Link to IXP
643 ip address 10.251.1.3 255.255.255.0
644 no ip directed-broadcast
645 no ip redirects
646 no ip proxy-arp
647 ipv6 address fd00:251:1::3/64
648 ipv6 nd ra supress
649 no shutdown
650!
651router bgp 100
652 bgp log-neighbor-changes
653 no synchronization
654 no auto-summary
655 no bgp default ipv4-unicast
656 distance bgp 200 200 200
657 address-family ipv4
658  network 10.100.0.0 mask 255.255.0.0
659  neighbor 10.100.254.2 remote-as 101
660  neighbor 10.100.254.2 description eBGP to AS101
661  neighbor 10.100.254.2 password N$RC
662  neighbor 10.100.254.6 remote-as 102
663  neighbor 10.100.254.6 description eBGP to AS102
664  neighbor 10.100.254.6 password N$RC
665  neighbor 10.251.1.1 remote-as 201
666  neighbor 10.251.1.1 description eBGP to AS201
667  neighbor 10.251.1.1 password N$RC
668  neighbor 10.251.1.2 remote-as 202
669  neighbor 10.251.1.2 description eBGP to AS202
670  neighbor 10.251.1.2 password N$RC address-family ipv6
671  network fd00:100::/32
672  neighbor fd00:100:fe::1 remote-as 101
673  neighbor fd00:100:fe::1 description eBGP to AS101
674  neighbor fd00:100:fe::1 password N$RC
675  neighbor fd00:100:fe::3 remote-as 102
676  neighbor fd00:100:fe::3 description eBGP to AS102
677  neighbor fd00:100:fe::3 password N$RC
678  neighbor fd00:251:1::1 remote-as 201
679  neighbor fd00:251:1::1 description eBGP to AS201
680  neighbor fd00:251:1::1 password N$RC
681  neighbor fd00:251:1::2 remote-as 202
682  neighbor fd00:251:1::2 description eBGP to AS202
683  neighbor fd00:251:1::2 password N$RC
684!
685ip route 10.100.0.0 255.255.0.0 null0
686ipv6 route fd00:100::/32 null0
687~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
688
689
690\pagebreak
691
692# Appendix B - NREN1 Configuration Example
693
694~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
695hostname NREN1
696aaa new-model
697aaa authentication login default local
698aaa authentication enable default enable
699username nsrc secret nsrc
700enable secret nsrc
701service password-encryption
702line vty 0 4
703 transport preferred none
704line console 0
705 transport preferred none
706no logging console
707logging buffered 8192 debugging
708no ip domain-lookup
709ip subnet-zero
710ip classless
711no ip source-route
712ipv6 unicast-routing
713!
714interface Loopback0
715 ip address 10.101.255.1 255.255.255.255
716 ipv6 address fd00:101:ff::1/128
717!
718interface GigabitEthernet1/0
719 description P2P Link to RREN
720 ip address 10.100.254.2 255.255.255.252
721 no ip directed-broadcast
722 no ip redirects
723 no ip proxy-arp
724 ipv6 address fd00:100:fe::1/127
725 ipv6 nd ra suppress
726 no shutdown
727!
728interface GigabitEthernet2/0
729 description P2P Link to ISP1
730 ip address 10.101.254.13 255.255.255.252
731 no ip directed-broadcast
732 no ip redirects
733 no ip proxy-arp
734 ipv6 address fd00:101:fe::6/127
735 ipv6 nd ra suppress
736 no shutdown
737!
738interface GigabitEthernet3/0
739 description P2P Link to R11
740 ip address 10.101.254.1 255.255.255.252
741 no ip directed-broadcast
742 no ip redirects
743 no ip proxy-arp
744 ipv6 address fd00:101:fe::0/127
745 ipv6 nd ra suppress
746 no shutdown
747!
748ip prefix-list AS10-in-peer permit 10.10.0.0/16 le 32
749ipv6 prefix-list ipv6-AS10-in-peer permit fd00:10::/32 le 128
750!
751router bgp 101
752 bgp log-neighbor-changes
753 no synchronization
754 no auto-summary
755 no bgp default ipv4-unicast
756 distance bgp 200 200 200
757 address-family ipv4
758  network 10.101.0.0 mask 255.255.0.0
759  neighbor 10.101.254.2 remote-as 10
760  neighbor 10.101.254.2 description eBGP to AS10
761  neighbor 10.101.254.2 password N$RC
762  neighbor 10.101.254.2 prefix-list AS10-in-peer in
763  neighbor 10.101.254.14 remote-as 201
764  neighbor 10.101.254.14 description eBGP to AS201
765  neighbor 10.101.254.14 password N$RC
766  neighbor 10.100.254.1 remote-as 100
767  neighbor 10.100.254.1 description eBGP to AS100
768  neighbor 10.100.254.1 password N$RC
769 address-family ipv6
770  network fd00:101::/32
771  neighbor fd00:101:fe::1 remote-as 10
772  neighbor fd00:101:fe::1 description eBGP to AS10
773  neighbor fd00:101:fe::1 password N$RC
774  neighbor fd00:101:fe::1 prefix-list ipv6-AS10-in-peer in
775  neighbor fd00:101:fe::7 remote-as 201
776  neighbor fd00:101:fe::7 description eBGP to AS201
777  neighbor fd00:101:fe::7 password N$RC
778  neighbor fd00:100:fe:: remote-as 100
779  neighbor fd00:100:fe:: description eBGP to AS100
780  neighbor fd00:100:fe:: password N$RC
781!
782
783ip route 10.101.0.0 255.255.0.0 null0
784ipv6 route fd00:101::/32 null0
785~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
786
787\pagebreak
788
789# Appendix C - ISP1 Configuration Example
790
791Note: *This is in addition to what was configured
792in the previous exercise*.
793
794~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
795interface GigabitEthernet2/0
796 description P2P Link to NREN1
797 ip address 10.101.254.14 255.255.255.252
798 no ip directed-broadcast
799 no ip redirects
800 no ip proxy-arp
801 ipv6 address fd00:101:fe::7/127
802 ipv6 nd ra suppress
803 no shutdown
804!
805ip prefix-list AS10-in-peer permit 10.10.0.0/16 le 32
806ipv6 prefix-list ipv6-AS10-in-peer permit fd00:10::/32 le 128
807!
808
809router bgp 201
810 bgp log-neighbor-changes
811 no synchronization
812 no auto-summary
813 no bgp default ipv4-unicast
814 bgp deterministic-med
815 distance bgp 200 200 200
816 address-family ipv4
817  network 10.201.0.0 mask 255.255.0.0
818  neighbor 10.201.254.2 remote-as 10
819  neighbor 10.201.254.2 description eBGP to AS10
820  neighbor 10.201.254.2 password N$RC
821  neighbor 10.201.254.2 prefix-list AS10-in-peer in
822  neighbor 10.101.254.13 remote-as 101
823  neighbor 10.101.254.13 description eBGP to AS101
824  neighbor 10.101.254.13 password N$RC
825  neighbor 10.251.1.2 remote-as 202
826  neighbor 10.251.1.2 description eBGP to AS202
827  neighbor 10.251.1.2 password N$RC
828  neighbor 10.251.1.3 remote-as 100
829  neighbor 10.251.1.3 description eBGP to AS100
830  neighbor 10.251.1.3 password N$RC
831 address-family ipv6
832  network fd00:201::/32
833  neighbor fd00:201:fe::1 remote-as 10
834  neighbor fd00:201:fe::1 description eBGP to AS10
835  neighbor fd00:201:fe::1 password N$RC
836  neighbor fd00:201:fe::1 prefix-list AS10-in-peer in
837  neighbor fd00:101:fe::6 remote-as 101
838  neighbor fd00:101:fe::6 description eBGP to AS101
839  neighbor fd00:101:fe::6 password N$RC
840  neighbor fd00:251:1::2 remote-as 202
841  neighbor fd00:251:1::2 description eBGP to AS202
842  neighbor fd00:251:1::2 password N$RC
843  neighbor fd00:251:1::3 remote-as 100
844  neighbor fd00:251:1::3 description eBGP to AS100
845  neighbor fd00:251:1::3 password N$RC
846!
847
848ip route 10.201.0.0 255.255.0.0 null0
849ipv6 route fd00:201::/32 null0
850~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
851
852
853