9/24/2015

BGP Prefix List filtering:

Prefix List filtering and Local Pref at bottom:
    - Route matching system better than ACLs.  Improved processor utilization., Better subnet mask matching.
    - a TWO stage matching:  Match network first,  then match mask.

example:   
    ip prefix-list NEWLIST permit 172.30.0.0/16  le 20
                                                    (Network)      (mask)

    ip prefix-list NEWLIST permit 172.30.0.0/16  ge 24 le 24 == exactly 24.
    ip prefix-list NEWLIST permit 172.30.0.0/16  ge 24 le 30 == between 24-30 subnet mask.

    ip prefix-list NEWLIST permit 0.0.0.0/0  === This does NOT match everything.  ONLY match exactly that route.  The default route.
   
    ip prefix-list NEWLIST permit 0.0.0.0/0 le 32 ===This match all.  Permit any.

    ip prefix-list NEWLIST permit 0.0.0.0/0 ge 32  ===This match only Host routes. all hosts /32.

    ip prefix-list NEWLIST permit 0.0.0.0/1    ge 24 le 24 === Any class A address, and subnet mask is a /24.  The first octet is 0000000.------- in the network section.

            class A: 0-127         (bit 0----)
            class B: 128-192     (bit 10---)
            class C: 192-223     (bit 110--)
   
    ip prefix-list NEWLIST-PF permit 128.0.0.0/2 ge 16 === Any class B network with mask of /16.
        128 = 1000000 = class B.




Example:

 conf t
    router bgp 500
        neighbor 1.1.1.1 prefix-list NEWLIST in 
===routes coming in filtered.

    show ip prefix-list
    clear ip bgp 1.1.1.1

example 2:
    route-map SET-LP
        match ip add prefix-list NEWLIST-PF
            st local-pre 9000
    route-map SET-LP 20
==== THIS NEEDS TO BE IN to do permit all at end. else routes not match for this route-map will be filtered.

    neighbor 1.1.1.1 route-map SET-LP in  ==as route come in from neighbor, change Localpref.


No comments:

Post a Comment