Agenda: lab-bgp-policy.txt

File lab-bgp-policy.txt, 21.3 KB (added by cvicente, 6 years ago)
Line 
1% Advanced Routing Workshop
2% BGP Policy Lab
3
4![Multi-homed Topology](ex3-1.png)
5
6\pagebreak
7
8# Introduction
9
10The purpose of this exercise is to:
11
12* Apply the concepts of BGP policy learned in class
13  to achieve the desired traffic patterns, particularly
14  in an academic environment.
15* Learn how to use Local Preference, BGP Communities, AS Path
16  Prepending and related BGP operational commands.
17
18# Pre-requisites
19
20This exercise builds upon the configurations implemented in
21the basic BGP routing lab. You must:
22
23* Verify that all your BGP sessions are up
24* Be able to see every lab prefix in your routing table
25* Be able to ping and traceroute successfully to any other router
26  in the lab.
27
28**Remember, all the above applies to both IPv4 and IPv6.**
29
30# Routing Policy in academic networks
31
32Research and Education Networks (RENs) are designed for high throughput
33and low latency. In many cases their links are also subsidized by
34governments and other organizations. Therefore, it is common in academic
35environments to want to apply routing policies that prefer these paths
36over the "commodity" (commercial) ones.
37
38# Local Preference
39
40Our first goal is to configure our routers to prefer the paths
41via the NREN for outgoing traffic to ALL destinations.
42
431. Use the Local Preference attribute to prefer all routes learned
44   via the NREN:
45
46R11:
47
48~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49route-map set-lpref permit 10
50 set local-preference 150
51route-map set-lpref permit 20
52!
53router bgp 10
54 address-family ipv4
55  neighbor 10.101.254.1 route-map set-lpref in
56 address-family ipv6
57  neighbor fd00:101:fe:: route-map set-lpref in
58~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59
60
61R12:
62
63~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64route-map set-lpref permit 10
65 set local-preference 50
66route-map set-lpref permit 20
67!
68router bgp 10
69 address-family ipv4
70  neighbor 10.201.254.1 route-map set-lpref in
71 address-family ipv6
72  neighbor fd00:201:fe:: route-map set-lpref in
73~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74
75What is the default local preference in Cisco IOS?
76Notice that we are setting a higher preference on the NREN
77side, and a lower preference on the ISP side. Can you think
78of a reason why this could be useful?
79
80Check your BGP routes. The next hop should be the P2P
81address of your NREN's router (except for your own prefix).
82
83~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84show ip bgp
85show bgp ipv6 unicast
86~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
87
88All good now, right?
89
90Wait!... What about the prefixes of ASs with whom
91you are peering directly? Remember the path selection algorithm?
92What comes first, highest local preference or shortest AS path?
93
942. Modify the route map to apply a higher local preference
95   attribute to prefixes originated by your direct peers.
96
97*Here, AS10 peers with AS20, but also with the NREN (AS101)
98and the ISP (AS201). Notice the AS Path access list.*
99
100R11:
101
102~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103ip as-path access-list 1 permit _20$
104ip as-path access-list 1 permit _101$
105ip as-path access-list 1 permit _201$
106!
107no route-map set-lpref
108!
109route-map set-lpref permit 10
110 match as-path 1
111 set local-preference 200
112route-map set-lpref permit 20
113 set local-preference 150
114route-map set-lpref permit 30
115~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116
117R12:
118
119~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120ip as-path access-list 1 permit _20$
121ip as-path access-list 1 permit _101$
122ip as-path access-list 1 permit _201$
123!
124no route-map set-lpref
125!
126route-map set-lpref permit 10
127 match as-path 1
128 set local-preference 200
129route-map set-lpref permit 20
130 set local-preference 50
131route-map set-lpref permit 30
132~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133
134Use BGP refresh to make sure that the policies are applied:
135
136~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
137clear ip bgp * in
138clear ip bgp * out
139clear bgp ipv6 unicast * in
140clear bgp ipv6 unicast * out
141~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142
143Check your BGP routes again. What is the next hop towards your direct
144peers' prefixes? (Hint: the path should be direct!)
145
1463. STOP - Checkpoint
147
148All groups must finish this part before continuing. Do NOT continue
149until the instructor says so.
150
151# Path Prepending
152
153At this point we have influenced outbound traffic only. Now we want to
154influence the traffic *coming in* to our AS. We want traffic to come
155to us via the R&E networks as much as possible.
156
157In the case of this lab, every other group is already preferring the
158NREN link for their outgoing traffic. For groups connected to your
159same NREN, the traffic towards you will NOT go via the commodity
160(commercial) Internet. However, this is not the case for groups
161connected to other NRENs.
162
163To see this, check your paths towards groups NOT connected to your
164NREN. For example, from AS10:
165
166~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
167R11# show ip bgp 10.40.0.0
168R11# traceroute 10.40.255.1
169R11# show bgp ipv6 unicast fd00:40::/32
170R11# traceroute fd00:40:ff::1
171~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172
173Notice that the traffic leaves via the R&E networks, but then enters
174AS40 through their commercial ISP.
175
176The same happens with traffic coming back to you from other NRENs.
177How can you influence their path selection so that traffic towards
178you enters via your NREN?
179
180We will now use a technique called AS path prepending, which consists
181of adding extra "fake" hops to a path using our ASN multiple times.
182
1831. Prepend your AS number twice in the path announced to your ISP:
184
185R12:
186
187~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
188ip prefix-list AS10-prefix permit 10.10.0.0/16
189!
190route-map set-prepend permit 100
191 match ip address prefix-list AS10-prefix
192 set as-path prepend 10 10
193route-map set-prepend permit 200
194!
195ipv6 prefix-list ipv6-AS10-prefix permit fd00:10::/32
196!
197route-map ipv6-set-prepend permit 100
198 match ipv6 address prefix-list ipv6-AS10-prefix
199 set as-path prepend 10 10
200route-map ipv6-set-prepend permit 200
201!
202router bgp 10
203 address-family ipv4
204  neighbor 10.201.254.1 route-map set-prepend out
205 address-family ipv6
206  neighbor fd00:201:fe:: route-map ipv6-set-prepend out
207!
208~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
209
210Use BGP refresh to re-announce your prefix to the ISP:
211
212~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
213R12# clear ip bgp 10.201.254.1 out
214R12# clear bgp ipv6 unicast fd00:201:fe:: out
215~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216
217Ask remote groups (connected to the other NRENs), to verify that
218their paths towards you do not traverse the commercial ISPs.
219
2202. STOP - Checkpoint
221
222All groups must finish this part before continuing. Do NOT continue
223until the instructor says so.
224
225# BGP Communities
226
227Now let's reflect on our initial outbound policy. Since our NREN
228carries commodity Internet prefixes in addition to R&E prefixes,
229we decided to use the Local Preference attribute to send
230*everything* via the NREN.
231
232In reality this may not be optimal, because the NREN may not
233always have the best paths towards the rest of the Internet and also
234because we're not taking advantage of our dual connections
235to load-balance our outbound traffic.
236
237What we really need is a way to tell *which prefixes are originated
238from the R&E community*, so that we prefer the NREN link when sending
239to *those* prefixes only, and let the rest be decided by the regular
240BGP selection process. This is where BGP communities are useful.
241
2421. Remove the configurations from the Local Preference section.
243   Notice the correct order in which this should be done (hint:
244   do not remove something if it's still referenced by something
245   else):
246
247R11:
248
249~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
250router bgp 10
251 address-family ipv4
252  no neighbor 10.101.254.1 route-map set-lpref in
253 address-family ipv6
254  no neighbor fd00:101:fe:: route-map set-lpref in
255!
256no route-map set-lpref
257~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
258
259*Remember to do the equivalent thing on the other router.*
260
261RENs use BGP communities (basically tags) to mark groups of routes
262together as a unit, which makes it easier for their members to
263apply policies to those groups of routes.
264
265In this particular case, the NRENs carry research and education
266(R&E) routes, as well as commercial Internet routes. The R&E
267routes are marked with a special community (99) as they are
268received from each customer. Also, the NREN passes those communities
269on to other customers and to the RREN.
270
271Notice that the NRENs and the RREN also use the communities to
272set a higher local preference value, in order to prefer the R&E paths.
273This is because they also can learn those prefixes via the ISPs with
274whom they peer.
275
276NREN1:
277
278~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
279ip bgp-community new-format
280!
281route-map set-RE-comm permit 10
282 set community 101:99
283route-map set-RE-comm permit 20
284!
285ip community-list 1 permit 100:99
286!
287route-map set-RE-lpref permit 10
288 match community 1
289 set local-preference 150
290route-map set-RE-lpref permit 20
291!
292router bgp 101
293 address-family ipv4
294  neighbor 10.101.254.2 send-community
295  neighbor 10.101.254.2 route-map set-RE-comm in
296  neighbor 10.101.254.6 send-community
297  neighbor 10.101.254.6 route-map set-RE-comm in
298  neighbor 10.101.254.10 send-community
299  neighbor 10.101.254.10 route-map set-RE-comm in
300  neighbor 10.100.254.1 send-community
301  neighbor 10.100.254.1 route-map set-RE-lpref in
302 address-family ipv6
303  neighbor fd00:101:fe::1 send-community
304  neighbor fd00:101:fe::1 route-map set-RE-comm in
305  neighbor fd00:101:fe::3 send-community
306  neighbor fd00:101:fe::3 route-map set-RE-comm in
307  neighbor fd00:101:fe::5 send-community
308  neighbor fd00:101:fe::5 route-map set-RE-comm in
309  neighbor fd00:100:fe:: send-community
310  neighbor fd00:100:fe:: route-map set-RE-lpref in
311!
312~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
313
314NREN2:
315
316~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
317ip bgp-community new-format
318!
319route-map set-RE-comm permit 10
320 set community 102:99
321route-map set-RE-comm permit 20
322!
323ip community-list 1 permit 100:99
324!
325route-map set-RE-lpref permit 10
326 match community 1
327 set local-preference 150
328route-map set-RE-lpref permit 20
329!
330router bgp 102
331 address-family ipv4
332  neighbor 10.102.254.2 send-community
333  neighbor 10.102.254.2 route-map set-RE-comm in
334  neighbor 10.102.254.6 send-community
335  neighbor 10.102.254.6 route-map set-RE-comm in
336  neighbor 10.102.254.10 send-community
337  neighbor 10.102.254.10 route-map set-RE-comm in
338  neighbor 10.100.254.5 send-community
339  neighbor 10.100.254.5 route-map set-RE-lpref in
340 address-family ipv6
341  neighbor fd00:102:fe::1 send-community
342  neighbor fd00:102:fe::1 route-map set-RE-comm in
343  neighbor fd00:102:fe::3 send-community
344  neighbor fd00:102:fe::3 route-map set-RE-comm in
345  neighbor fd00:102:fe::5 send-community
346  neighbor fd00:102:fe::5 route-map set-RE-comm in
347  neighbor fd00:100:fe::2 send-community
348  neighbor fd00:100:fe::2 route-map set-RE-lpref in
349!
350~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
351
352The regional REN (RREN) connects multiple NRENs, so they
353replace communities in the R&E routes learned from NRENs
354with their own community:
355
356RREN:
357
358~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
359ip bgp-community new-format
360!
361ip community-list 1 permit 101:99
362ip community-list 1 permit 102:99
363!
364route-map set-RE-comm-in permit 10
365 match community 1
366 set community 100:99 additive
367 set local-preference 150
368route-map set-RE-comm-in permit 20
369!
370router bgp 100
371 address-family ipv4
372  neighbor 10.100.254.2 send-community
373  neighbor 10.100.254.2 route-map set-RE-comm-in in
374  neighbor 10.100.254.6 send-community
375  neighbor 10.100.254.6 route-map set-RE-comm-in in
376 address-family ipv6
377  neighbor fd00:100:fe::1 send-community
378  neighbor fd00:100:fe::1 route-map set-RE-comm-in in
379  neighbor fd00:100:fe::3 send-community
380  neighbor fd00:100:fe::3 route-map set-RE-comm-in in
381~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
382
383ISPs will originate additional prefixes to represent the
384rest of the commodity Internet:
385
386ISP1:
387
388~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
389router bgp 201
390 address-family ipv4
391  network 172.16.0.0 mask 255.255.0.0
392  network 172.17.0.0 mask 255.255.0.0
393  network 172.18.0.0 mask 255.255.0.0
394  network 172.19.0.0 mask 255.255.0.0
395 address-family ipv6
396  network 2001:db8::/32
397  network 2001:db9::/32
398  network 2001:dba::/32
399  network 2001:dbb::/32
400!
401ip route 172.16.0.0 255.255.0.0 null0
402ip route 172.17.0.0 255.255.0.0 null0
403ip route 172.18.0.0 255.255.0.0 null0
404ip route 172.19.0.0 255.255.0.0 null0
405!
406ipv6 route 2001:db8::/32 null0
407ipv6 route 2001:db9::/32 null0
408ipv6 route 2001:dba::/32 null0
409ipv6 route 2001:dbb::/32 null0
410~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
411
412ISP2:
413
414~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
415router bgp 202
416 address-family ipv4
417  network 172.20.0.0 mask 255.255.0.0
418  network 172.21.0.0 mask 255.255.0.0
419  network 172.22.0.0 mask 255.255.0.0
420  network 172.23.0.0 mask 255.255.0.0
421 address-family ipv6
422  network 2001:dbc::/32
423  network 2001:dbd::/32
424  network 2001:dbe::/32
425  network 2001:dbf::/32
426!
427ip route 172.20.0.0 255.255.0.0 null0
428ip route 172.21.0.0 255.255.0.0 null0
429ip route 172.22.0.0 255.255.0.0 null0
430ip route 172.23.0.0 255.255.0.0 null0
431!
432ipv6 route 2001:dbc::/32 null0
433ipv6 route 2001:dbd::/32 null0
434ipv6 route 2001:dbe::/32 null0
435ipv6 route 2001:dbf::/32 null0
436~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
437
4382. Set local preference ONLY on the R&E routes (marked with
439   the R&E community) learned from the NREN. Notice that
440   your NREN is also passing you the communities set by
441   the regional REN, so you need to match either one.
442
443   Also notice that we do not set the local preference on the
444   prefixes originated by our direct peers.
445
446R11:
447
448~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
449ip bgp-community new-format
450!
451ip as-path access-list 1 permit _20$
452ip as-path access-list 1 permit _101$
453ip as-path access-list 1 permit _201$
454!
455ip community-list 1 permit 100:99
456ip community-list 1 permit 101:99
457!
458route-map set-local-pref permit 10
459 match as-path 1
460 continue 30
461route-map set-local-pref permit 20
462 match community 1
463 set local-preference 150
464route-map set-local-pref permit 30
465!
466router bgp 10
467 address-family ipv4
468  neighbor 10.101.254.1 route-map set-local-pref in
469 address-family ipv6
470  neighbor fd00:101:fe:: route-map set-local-pref in
471!
472~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
473
474Refresh to/from your neighbors:
475
476~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
477clear ip bgp * in
478clear ip bgp * out
479clear bgp ipv6 unicast * in
480clear bgp ipv6 unicast * out
481~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
482
483Verify that communities are being set and transmitted:
484
485~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
486R11#show ip bgp 10.20.0.0
487R11#show ip bgp 10.40.0.0
488~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
489
490Check your BGP routes again.
491
492~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
493show ip bgp
494show ip route
495show bgp ipv6 unicast
496show ipv6 route
497~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
498
499The result should be that you now prefer the NREN path for any
500prefix originated by an R&E member. For all other prefixes,
501including the ones from the commercial Internet, your routers
502will choose based on BGP defaults.
503
504# Multihoming with Partial Routes and Defaults
505
506Another way to load-balance outbound traffic in our multihoming setup
507is to play with partial routing tables and default routes.
508The idea is that our routers will prefer the more specific R&E routes
509coming from the NREN, and the rest of the outgoing traffic will use the
510ISP. Only if the ISP fails, our non-R&E traffic will leave through the NREN.
511Similarly, if the NREN link fails, the ISP will route all our
512outbound traffic.
513
514This has the advantage of reducing our routing table size, and
515therefore memory requirements and convergence time. The disadvantage
516is that we may not always follow the best paths, but it might be a good
517compromise.
518
519We are going to ask the NREN to only send us R&E routes, plus
520the default route:
521
522NREN1:
523
524~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
525ip community-list 1 permit 100:99
526ip community-list 1 permit 101:99
527!
528route-map send-RE-only permit 10
529 match community 1
530!
531router bgp 101
532 address-family ipv4
533  no neighbor 10.101.254.2 send-community
534  no neighbor 10.101.254.6 send-community
535  no neighbor 10.101.254.10 send-community
536  neighbor 10.101.254.2 route-map send-RE-only out
537  neighbor 10.101.254.2 default-originate
538  neighbor 10.101.254.6 route-map send-RE-only out
539  neighbor 10.101.254.6 default-originate
540  neighbor 10.101.254.10 route-map send-RE-only out
541  neighbor 10.101.254.10 default-originate
542 address-family ipv6
543  no neighbor fd00:101:fe::1 send-community
544  no neighbor fd00:101:fe::3 send-community
545  no neighbor fd00:101:fe::5 send-community
546  neighbor fd00:101:fe::1 route-map send-RE-only out
547  neighbor fd00:101:fe::1 default-originate
548  neighbor fd00:101:fe::3 route-map send-RE-only out
549  neighbor fd00:101:fe::3 default-originate
550  neighbor fd00:101:fe::5 route-map send-RE-only out
551  neighbor fd00:101:fe::5 default-originate
552!
553~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
554
555NREN2:
556
557~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
558ip community-list 1 permit 100:99
559ip community-list 1 permit 102:99
560!
561route-map send-RE-only permit 10
562 match community 1
563!
564router bgp 102
565 address-family ipv4
566  no neighbor 10.102.254.2 send-community
567  no neighbor 10.102.254.6 send-community
568  no neighbor 10.102.254.10 send-community
569  neighbor 10.102.254.2 route-map send-RE-only out
570  neighbor 10.102.254.2 default-originate
571  neighbor 10.102.254.6 route-map send-RE-only out
572  neighbor 10.102.254.6 default-originate
573  neighbor 10.102.254.10 route-map send-RE-only out
574  neighbor 10.102.254.10 default-originate
575 address-family ipv6
576  no neighbor fd00:102:fe::1 send-community
577  no neighbor fd00:102:fe::3 send-community
578  no neighbor fd00:102:fe::5 send-community
579  neighbor fd00:102:fe::1 route-map send-RE-only out
580  neighbor fd00:102:fe::1 default-originate
581  neighbor fd00:102:fe::3 route-map send-RE-only out
582  neighbor fd00:102:fe::3 default-originate
583  neighbor fd00:102:fe::5 route-map send-RE-only out
584  neighbor fd00:102:fe::5 default-originate
585!
586~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
587
588
589Similarly, we will ask the ISP to only send us a default
590route:
591
592
593ISP1:
594
595~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
596ip prefix-list default permit 0.0.0.0/0
597ipv6 prefix-list ipv6-default permit ::/0
598!
599router bgp 201
600 address-family ipv4
601  neighbor 10.201.254.2 default-originate
602  neighbor 10.201.254.2 prefix-list default out
603  neighbor 10.201.254.6 default-originate
604  neighbor 10.201.254.6 prefix-list default out
605  neighbor 10.201.254.10 default-originate
606  neighbor 10.201.254.10 prefix-list default out
607 address-family ipv6
608  neighbor FD00:201:FE::1 default-originate
609  neighbor FD00:201:FE::1 prefix-list ipv6-default out
610  neighbor FD00:201:FE::3 default-originate
611  neighbor FD00:201:FE::3 prefix-list ipv6-default out
612  neighbor FD00:201:FE::5 default-originate
613  neighbor FD00:201:FE::5 prefix-list ipv6-default out
614!
615~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
616
617ISP2:
618
619~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
620ip prefix-list default permit 0.0.0.0/0
621ipv6 prefix-list ipv6-default permit ::/0
622!
623router bgp 202
624 address-family ipv4
625  neighbor 10.202.254.2 default-originate
626  neighbor 10.202.254.2 prefix-list default out
627  neighbor 10.202.254.6 default-originate
628  neighbor 10.202.254.6 prefix-list default out
629  neighbor 10.202.254.10 default-originate
630  neighbor 10.202.254.10 prefix-list default out
631 address-family ipv6
632  neighbor FD00:202:FE::1 default-originate
633  neighbor FD00:202:FE::1 prefix-list ipv6-default out
634  neighbor FD00:202:FE::3 default-originate
635  neighbor FD00:202:FE::3 prefix-list ipv6-default out
636  neighbor FD00:202:FE::5 default-originate
637  neighbor FD00:202:FE::5 prefix-list ipv6-default out
638!
639~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
640
641Check what you are now receiving from your NREN and
642your ISP:
643
644~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
645R11#show ip bgp neighbors 10.101.254.1 routes
646R11#show bgp ipv6 uni neighbors fd00:101:fe:: routes
647R11#show ip route 0.0.0.0 0.0.0.0
648R11#show ipv6 route ::/0
649
650R12#show ip bgp neighbors 10.201.254.1 routes
651R12#show bgp ipv6 uni neighbors fd00:201:fe:: routes
652R12#show ip route 0.0.0.0 0.0.0.0
653R12#show ipv6 route ::/0
654~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
655
656At this point you should see that each of your routers
657has a default route pointing to its upstream peer. This
658is an OK situation. But let's say that we want the ISP
659to handle all the non-R&E outbound traffic.
660
661Configure your RX2 router to assign a higher local preference
662to the default announced by the ISP:
663
664R12:
665
666~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
667ip prefix-list default permit 0.0.0.0/0
668ipv6 prefix-list ipv6-default permit ::/0
669!
670route-map set-lpref-default permit 10
671 match ip address prefix-list default
672 set local-preference 150
673!
674route-map set-lpref-ipv6-default permit 10
675 match ip address prefix-list ipv6-default
676 set local-preference 150
677!
678router bgp 10
679 address-family ipv4
680  neighbor 10.201.254.1 route-map set-lpref-default in
681 address-family ipv6
682  neighbor fd00:201:fe:: route-map set-lpref-ipv6-default in
683!
684~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
685
686Check your default route on both routers:
687
688~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
689show ip bgp 0.0.0.0 0.0.0.0
690show ip route 0.0.0.0 0.0.0.0
691
692show bgp ipv6 uni ::/0
693show ipv6 route ::/0
694~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
695
696
697Also, check your BGP routing table. Has it shrinked?
698
699~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
700show ip bgp
701show bgp ipv6 unicast
702~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703