Thursday, October 13, 2011

notes: BGP originating Prefixes and Filtering

1.  Network Statement

- Allows the advertising/originating of major networks into BGP
- If no mask option, a classful subnet would be assumed
- If Auto-Summary is ENABLED: At least one subnet of the major network is required in the RIB before the route is originated in BGP
- If Auto-Summary is DISABLED: A exact route match is required in the RIB before the route is originated in BGP
- Route-Map option - Allows network parameters to be modified before they are entered into the BGP table
- BGP routes originated through "network" command have a origin code of 'i-igp'

network {major-network} [mask {net}] [route-map {name}]

2.  Redistribution

- BGP routes originated through redistribution have a origin code of '?-incomplete'

access-list {number} permit {network}
redistribute {igp} [pid] [metric] [route-map]
 
- Redistributes local static or connected routes into BGP table

redistribute {static|connected} [route-map] [metric]

3.  Aggregation

- Specifies a aggregation range in BGP routing process.
- Default = more specific routes are sent
- The aggregate will be announced only if there is at least one network in the specified range in the BGP table (not the IGP table)
- Summary-only: Advertises only the aggregate and not the individual networks
- Routes originated with aggregate command has origin code of "i"

aggregate-address {aggregate} [mask] [summary-only]

- Specifies a suppress map to be referenced
- The prefixes within the aggregate, permitted/matched by the route-map will be suppressed from being advertised to neighbors

aggregate-address {aggregate} {mask} suppress-map {route-map} [summary-only]

- Specifies what routes to unsuppress on a per neighbor basis

neighbor {ip} unsuppress-map {route-map} 


 - Displays the configured filter lists

sh ip as-path-access-list [filter-list]

- Displays all routes permitted by the specified AS-path access-list

sh ip bgp filter-list {access-list-number}  

- Displays all routes matching regular-expression in one or all filter-lists

sh ip bgp regexp {expression}

 - Displays the prefix-list and the sequence numbers

sh ip prefix-list {list}[det|sum][longer] 

 - Displays all routes in the BGP table matching prefix-list

sh ip bgp prefix-list {list-name} 

- Configures an AS-path filter list

ip as-path access-list {1-199} [permit/deny] {regex}

- Configures a prefix-list, if [ge/le] is not defined, prefix is matched exactly
- [ge] Means greater than AND equals to
- [le] Means less than AND equals to

ip prefix-list {name} [seq] [permit|deny] {prefix} [ge] [le]

- Configures inbound/outbound AS-path filter for specific BGP neighbor

router bgp {asn}
neighbor {ip} filter-list {as-path-list} [in|out]

- Applies filters for inbound/outbound BGP routing updates for a neighbor

neighbor {ip | peer-group} prefix-list list [in|out]
- Filters routes redistributed from specified routing process (into|outof) BGP 

distribute-list prefix-list {prefix-list} {in|out} {routing-process}

1.  >> Matches all hosts routes
ip prefix-list A permit 0.0.0.0/0 ge 32

2.  >> Any subnets in class A address space. (/1: 1st bit(0) can’t change)
ip prefix-list B permit 0.0.0.0/1 ge 9

3.  >> Any subnets in class B address space. (/2: 1st 2 bits(10) can’t change)
ip prefix-list C permit 128.0.0.0/2 ge 17

4.   >> Any subnets in class C address space. (/3: 1st 3 bits(110) can’t change)
ip prefix-list D permit 192.0.0.0/3 ge 24

5.  >> Match any/all routes
ip prefix-list E permit 0.0.0.0/0 le 32

 6.  >> Match just the default route
 ip prefix-list F permit 0.0.0.0/0

7. >> Matches any prefix in class A address space with more than 256 addresses
ip prefix-list G permit 0.0.0.0/1 le 24

8.  >> Matches only a 10.0.0.0/8 route (no more, no less)
ip prefix-list H permit 10.0.0.0/8

 9.  >> Matches any route in the RFC-1918 pvt 10/8 range, (including 10.1.2.0/24)
ip prefix-list I permit 10.0.0.0/8 le 32

10.  >> Matches any route in the RFC-1918 pvt 172.16/12 range
ip prefix-list J permit 172.16.0.0/12 le 32

11.  >> Matches any route in the RFC-1918 pvt 192.168.0.0/16 range
ip prefix-list K permit 192.168.0.0/16 le 32

No comments:

Post a Comment