{"id":266,"date":"2009-02-23T13:49:59","date_gmt":"2009-02-23T19:49:59","guid":{"rendered":"http:\/\/gregsowell.com\/?p=266"},"modified":"2009-02-23T13:52:35","modified_gmt":"2009-02-23T19:52:35","slug":"cisco-prepending-subset-of-your-bgp-addressing","status":"publish","type":"post","link":"https:\/\/gregsowell.com\/?p=266","title":{"rendered":"Cisco &#8211; Prepending Subset of Your BGP Addressing"},"content":{"rendered":"<p>Scenario: You have a production site in Dallas and a backup site in, say, College Station(CS).  You want the public subnet 1.2.3.0\/24 to failover to CS if the Dallas facility falls off of the earth.  What you want to do my friend is <a title=\"Cisco prepending docs\" href=\"http:\/\/www.cisco.com\/en\/US\/docs\/ios\/12_0\/np1\/command\/reference\/1rbgp.html#wp1020752\" target=\"_blank\">prepend<\/a>.<\/p>\n<p>Prepending is adding your own Autonomous System Number(AS) repeatedly to the beginning of your BGP advertisement to a neighbor.  Say if you were to have your addressing hop through three external BGP peers, they would all add their AS number to the as-path attribute.  If your AS number is 5 and it goes through AS 10, 20 and then 30 your path would look like &#8220;20 10 5&#8221; to the routers in AS 30.  If you were to prepend 3 times to your as before advertising it to 10, the path would appear as &#8220;20 10 5 5 5&#8221;.  This makes your path for this specific bit of traffic less desirable.  Remember that BGP is a path vector protocol, so it prefers the fewest number of AS hops.<\/p>\n<p>So what we will do is make your backup site look so far away with AS prepending that it won&#8217;t get used unless the main site is unavailable.<\/p>\n<p>Diagram also available as PDF => [download#5].<\/p>\n<figure id=\"attachment_267\" aria-describedby=\"caption-attachment-267\" style=\"width: 1024px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-267\" title=\"bgp-prepending\" src=\"http:\/\/gregsowell.com\/wp-content\/uploads\/2009\/02\/bgp-prepending-1024x790.jpg\" alt=\"bgp prepending\" width=\"1024\" height=\"790\" srcset=\"https:\/\/gregsowell.com\/wp-content\/uploads\/2009\/02\/bgp-prepending-1024x790.jpg 1024w, https:\/\/gregsowell.com\/wp-content\/uploads\/2009\/02\/bgp-prepending-300x231.jpg 300w, https:\/\/gregsowell.com\/wp-content\/uploads\/2009\/02\/bgp-prepending.jpg 1094w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption id=\"caption-attachment-267\" class=\"wp-caption-text\">bgp prepending<\/figcaption><\/figure>\n<p>You can see from the configurations that both routers are in AS 1.  subnet 1.2.3.0\/24 lives in the production location.  It is advertised from the DR site with it&#8217;s AS 1 prepended five times.  I used a prefix list to pick out the specific subnet 1.2.3.0\/24 subnet to prepend.  I would assume that the DR site would advertise some addressing that isn&#8217;t advertised from the production, and thus I don&#8217;t want to prepend that addressing.  I included the &#8220;route-map prepend permit 20&#8221; statement in there as a catch-all for the rest of the addressing to be advertised.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Scenario: You have a production site in Dallas and a backup site in, say, College Station(CS). You want the public subnet 1.2.3.0\/24 to failover\u2026<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,8],"tags":[],"class_list":["post-266","post","type-post","status-publish","format-standard","hentry","category-cisco","category-networking"],"_links":{"self":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=266"}],"version-history":[{"count":11,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/266\/revisions"}],"predecessor-version":[{"id":277,"href":"https:\/\/gregsowell.com\/index.php?rest_route=\/wp\/v2\/posts\/266\/revisions\/277"}],"wp:attachment":[{"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gregsowell.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}