Cisco CCNP  BSCI Exam Tutorial:  Filtering BGP Updates With Prefix Lists
Cisco CCNP BSCI Exam Tutorial: Filtering BGP Updates With Prefix Lists

A Major Part Of Your BSCI And CCNP Exam Success Is Mastering BGP, And That Includes Filtering BGP Routing Updates. In This Tutorial, We'll Take A Look At How To Filter BGP Updates With Prefix Lists.R4 Is Advertising Three Networks Via BGP. The Downstream Router R3 Sees These Routes And Places Them Into Its BGP Table As Shown Below. R3 Has Two Downstream BGP Peers, R1 And R2, And Is Advertising Itself As The Next-hop IP Address For All BGP Routes Sent To Those Two Routers.R4(config)router Bgp 4R4(config-router)network 21.0.0.0 Mask 255.0.0.0R4(config-router)network 22.0.0.0 Mask 255.0.0.0R4(config-router)network 23.0.0.0 Mask 255.0.0.0 R3show Ip BgpBGP Table Version Is 4, Local Router ID Is 3.3.3.3Status Codes: S Suppressed, D Damped, H History, Valid, Best, I InternalOrigin Codes: I - IGP, E - EGP, ? Incomplete Network Next Hop Metric LocPrf Weight Path 21.0.0.0 10.2.2.4 0 0 4 I 22.0.0.0 10.2.2.4 0 0 4 I 23.0.0.0 10.2.2.4 0 0 4 IR3(config)router Bgp 123R3(config-router)neighbor 172.12.123.1 Next-hop-selfR3(config-router)neighbor 172.12.123.2 Next-hop-selfIn Turn, Both R1 And R2 Have These Three Routes In Their Respective BGP Tables.R2show Ip BgpBGP Table Version Is 4, Local Router ID Is 2.2.2.2Status Codes: S Suppressed, D Damped, H History, Valid, Best, I InternalOrigin Codes: I - IGP, E - EGP, ? Incomplete Network Next Hop Metric LocPrf Weight Pathi21.0.0.0 172.12.123.3 0 100 0 4 Ii22.0.0.0 172.12.123.3 0 100 0 4 Ii23.0.0.0 172.12.123.3 0 100 0 4 I R1show Ip BgpBGP Table Version Is 4, Local Router ID Is 19.1.1.1Status Codes: S Suppressed, D Damped, H History, Valid, Best, I InternalOrigin Codes: I - IGP, E - EGP, ? Incomplete Network Next Hop Metric LocPrf Weight Pathi21.0.0.0 172.12.123.3 0 100 0 4 Ii22.0.0.0 172.12.123.3 0 100 0 4 Ii23.0.0.0 172.12.123.3 0 100 0 4 IIf We Wanted R3 To Receive All Three Of These Routes From R4 But Not Advertise All Of Them To R2 And R1, We've Got A Couple Of Options On How To Block These Routes. Cisco's Recommendation Is The Use Of Prefix-lists, And Once You Get Used To The Syntax (which You Should Do Before Taking And Passing The BSCI), You'll See They Are Actually Easier To Use Than Access-lists.In This Case, We're Going To Configure R3 To Send Only The Route To 21.0.0.0 To R1 And 23.0.0.0 To R2. However, We Do Want These Two Routers To Get Any Future Routes That R4 Advertises Into BGP.Since R1 And R2 Will Learn About These Routes From An IBGP Neighbor, They Will Not Advertise The Routes To Each Other.On R3, We'll Write A Prefix-list That Denies 22.0.0.08 And 23.0.0.08, But Permits All Other Routes. After Applying The Prefix List As Shown, R1 Sees Only The 21.0.0.0 8 Route.R3(config)ip Prefix-list FILTERR1 Deny 22.0.0.08R3(config)ip Prefix-list FILTERR1 Deny 23.0.0.08R3(config)ip Prefix-list FILTERR1 Permit 0.0.0.00 Le 32R3(config)router Bgp 123R3(config-router)neighbor 172.12.123.1 Prefix-list FILTERR1 OutR3clear Ip Bgp SoftR1show Ip BgpBGP Table Version Is 6, Local Router ID Is 19.1.1.1Status Codes: S Suppressed, D Damped, H History, Valid, Best, I InternalOrigin Codes: I - IGP, E - EGP, ? Incomplete Network Next Hop Metric LocPrf Weight Pathi21.0.0.0 172.12.123.3 0 100 0 4 IThe Paths To 22.0.0.08 And 23.0.0.08 Have Been Successfully Filtered.We'll Do The Same For R2, Except The Route Not Being Expressly Blocked Is 23.0.0.08. The Line "ip Prefix-list Permit 0.0.0.00 Le 32" Is The Prefix List Equivalent Of A "permit Any" Statement In An ACL.R3(config)ip Prefix-list FILTERR2 Deny 21.0.0.08R3(config)ip Prefix-list FILTERR2 Deny 22.0.0.08R3(config)ip Prefix-list FILTERR2 Permit 0.0.0.00 Le 32R3(config)router Bgp 123R3(config-router)neighbor 172.12.123.2 Prefix-list FILTERR2 OutR3clear Ip Bgp Soft R2show Ip BgpBGP Table Version Is 6, Local Router ID Is 2.2.2.2Status Codes: S Suppressed, D Damped, H History, Valid, Best, I InternalOrigin Codes: I - IGP, E - EGP, ? Incomplete Network Next Hop Metric LocPrf Weight Pathi23.0.0.0 172.12.123.3 0 100 0 4 IThe Paths To 21.0.0.08 And 22.0.0.08 Have Been Successfully Filtered.To See The Prefix Lists Configured On A Route As Well As The Order Of The Statements In Each List, Run Show Ip Prefix-list.R3show Ip Prefix-listip Prefix-list FILTERR1: 3 Entries Seq 5 Deny 22.0.0.08 Seq 10 Deny 23.0.0.08 Seq 15 Permit 0.0.0.00 Le 32ip Prefix-list FILTERR2: 3 Entries Seq 5 Deny 21.0.0.08 Seq 10 Deny 22.0.0.08 Seq 15 Permit 0.0.0.00 Le 32Get Some Hands-on Practice With Prefix Lists And You'll Quickly Master Them. Prefix Lists Are An Important Part Of Working With BGP In The Exam Room And Production Networks, So It's Vital That You Are Comfortable Working With Them.