BGP Best path selection: 1· Prefer highest weight (local to router) 2· Highest local preference (Global within same AS) 3· Prefer routes that the router originated (using network/redistribute/aggregate/default-information originate commands) 4· AS Path (AS length; this step will be skipped if bgp bestpath as-path ignore is configured.) 5· Lowest Origin Code (IGP <EGP <Incomplete) 6· MED (Lowest MED will be preferred, applicable to very next AS) 7· Prefer EBGP (AD of 20) over IBGP (AD of 200) 8· For IBGP Paths: Prefer path through closest IGP neighbor (lowest metric path to the BGP next-hop) 9· For EBGP Paths: Prefer oldest path.(most stable path) 10· Prefer path with lower BGP router-ID. 11· BGP prefer path coming from lowest neighbor address, this is IP address used in neighbor configuration command. 1. OPEN: Establish the TCP session between TCP speakers. 2. I/O: It does BGP packet processing. 3. Scanner: It scan or walk through the BGP table. (Default scan time is 60 seconds) 4. Router: Take care of BGP session establishment and maintenance. handle the BGP path selection process. Process the new routes and advertisement to peers. BGP MED: If you are going to use MED as best path selection attributes, use following two commands. (Cisco Document)
BGP Capability: BGP negotiate all capability using OPEN message. Capabilities: · Multiporotcol · Route Refresh · Graceful Restart · Outbound Route Filter. BGP AFI and SAFI: SAFI for IPv4 addresses family: · Unicast, SAFI 1 · Multicast SAFI 2 · IPv6 Label SAFI 4 · Label for VPNv4 prefix SAFI 128
Advertise Prefix in BGP · “network” command advertises route in BGP if it has route in IP Routing table · “aggregate-address” command advertises aggregate only if it have component or subnet of aggregate in BGP table. BGP Stages:
Attribute Class: · ORIGIN Well-known mandatory · AS_PATH Well-known mandatory · NEXT_HOP Well-known mandatory · LOCAL_PREF Well-known discretionary · ATOMIC_AGGREGATE Well-known discretionary · AGGREGATOR Optional transitive · COMMUNITY Optional transitive · MULTI_EXIT_DISC (MED) Optional non-transitive · ORIGINATOR_ID Optional non-transitive · CLUSTER_LIST Optional non-transitive
Attributes Nature: · Well-known attributes are either mandatory, meaning that they must be included in all BGP Update messages, or they are discretionary, meaning that they may or may not be sent in a specific Update message. · If an optional attribute is transitive, a BGP process should accept the path in which it is included, even if it doesn't support the attribute, and it should pass the path on to its peers. · If an optional attribute is non-transitive, a BGP process that does not recognize the attribute can quietly ignore the Update in which it is included and not advertise the path to its other peers.
BGP Convergence: · Path MTU: Discover the largest MTU in path so it can adjust TCP MSS (default MSS 536bytes), Large MTU can support large update packet (Configuration is on TCP side not on BGP configuration mode) · Hold queue variation · Fast external failover: This trigger the BGP session to tear-down as soon as link fails instead of waiting for 180 sec. · Timers · Suppress inactive routes: by default BGP sends all the routes including active and inactive both · BGP Scan interval (BGP Processes on router: Router/Scanner/IO) BGP Optimization: · BGP update delay · Path MTU · Don’t be a transit AS · Advertise specific as well as summarized routes as per your external scenarios (Multi-home) · TTL Security check (if you have multiple path to reach remote AS then make hop calculation and then configure this feature) · Use next-hop self · Keep track of bogons list
Community: · INTERNET: The Internet community does not have a value; all routes belong to this community by default. Received routes belonging to this community are advertised freely. · NO_EXPORT (4294967041, or 0xFFFFFF01): Routes received carrying this value cannot be advertised to EBGP peers or, if a confederation is configured, the routes cannot be advertised outside of the confederation. (Confederations are defined in a later section, "Managing Large-Scale BGP Peering.") · NO_ADVERTISE (4294967042, or 0xFFFFFF02): Routes received carrying this value cannot be advertised at all, to either EBGP or IBGP peers. · LOCAL_AS (4294967043, or 0xFFFFFF03): RFC 1997 calls this attribute NO_EXPORT_SUBCONFED: Routes received carrying this value cannot be advertised to EBGP peers, including peers in other autonomous systems within a confederation.
BGP unqueal-link bandwidth (link-bandwidth/DMZ-bandwidth): This feature can be useful in AS having multi-home connectivity, Here local AS having multiple connections to ISP and if you want to achieve unequal load-sharing then configure eBGP peering (Router A &B, use neighbor ebgp dmzlink-bw to ebgp neighbor) to ISP (Router C &D, no need to enable the dmz-bandwidth) with dmz-bandwidth feature and the same eBGP peer router (Router A&B) peer with their IBGP peer of the local AS and also enable the extended community between all IBGP peers and all IBGP peer should have enabled “neighbor dmzlink-bw” under bgp router configuration. Conditional Advertisement: Two ways to do that (conditionally advertise prefix to neighbor): neighbor advertise-map map1 non-exist-map map2; Advertise the prefix match by map1 only when prefix match by map2 is not in BGP table. neighbor advertise-map map1 exist-map map2; Advertise prefix match by map1 only when prefix match by map2 is in BGP table. “bgp inject-map” is also one kind of conditional route injection to local BGP RIB. BGP Route Reflector:
BGPLabs:
LAB Testing: Goal of this LAB is to merge two BGP AS and have very minimal amount of network outage.1. Merge AS2 into AS1 so finally there will be only one BGP AS, AS1. 2. Migrate OSPF in AS2 to ISIS. 3. As a additional step we can use different IP addressing in AS1 and AS2. AS1 IP addressing: 10.0.0.0/24 AS2 IP addressing: 20.0.0.0/24 After merging up both the AS to AS1, IP addressing should be 10.0.0.0/24 in AS1. |
