{"id":335,"date":"2017-09-26T09:51:29","date_gmt":"2017-09-26T07:51:29","guid":{"rendered":"http:\/\/www.quisted.net\/?p=335"},"modified":"2017-09-26T09:51:29","modified_gmt":"2017-09-26T07:51:29","slug":"bgp-path-attributes","status":"publish","type":"post","link":"https:\/\/www.quisted.net\/index.php\/2017\/09\/26\/bgp-path-attributes\/","title":{"rendered":"BGP Path Attributes"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quisted.net\/index.php\/2017\/09\/26\/bgp-path-attributes\/#BGP_Path_Attributes\" >BGP Path Attributes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quisted.net\/index.php\/2017\/09\/26\/bgp-path-attributes\/#Weight\" >Weight<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quisted.net\/index.php\/2017\/09\/26\/bgp-path-attributes\/#Local_Pref\" >Local_Pref<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quisted.net\/index.php\/2017\/09\/26\/bgp-path-attributes\/#Multi_Exit_Distriminator\" >Multi Exit Distriminator<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"BGP_Path_Attributes\"><\/span>BGP Path Attributes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/vps.quisted.net\/wp-content\/uploads\/2017\/09\/bgp2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-340 size-full\" src=\"http:\/\/vps.quisted.net\/wp-content\/uploads\/2017\/09\/bgp2.png\" alt=\"\" width=\"812\" height=\"400\" srcset=\"https:\/\/www.quisted.net\/wp-content\/uploads\/2017\/09\/bgp2.png 812w, https:\/\/www.quisted.net\/wp-content\/uploads\/2017\/09\/bgp2-300x148.png 300w, https:\/\/www.quisted.net\/wp-content\/uploads\/2017\/09\/bgp2-768x378.png 768w\" sizes=\"auto, (max-width: 812px) 100vw, 812px\" \/><\/a><\/p>\n<p><span style=\"color: #ff6600;\"><b>\u201cWe Love Oranges AS Oranges Mean Pure Refreshment\u201d<\/b><\/span><\/p>\n\n<table id=\"tablepress-3\" class=\"tablepress tablepress-id-3\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Path<\/th><th class=\"column-2\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\"><span style=\"color: #ff6600;\">W<\/span><\/td><td class=\"column-2\">Weight (highest)<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\"><span style=\"color: #ff6600;\">L<\/span><\/td><td class=\"column-2\">Local_pref (higest)<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\"><span style=\"color: #ff6600;\">O<\/span><\/td><td class=\"column-2\">Originate (Local)<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\"><span style=\"color: #ff6600;\">AS<\/span><\/td><td class=\"column-2\">AS_PATH (shortest)<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\"><span style=\"color: #ff6600;\">O<\/span><\/td><td class=\"column-2\">ORIGIN code ( igp > egp > incomplete)<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\"><span style=\"color: #ff6600;\">M<\/span><\/td><td class=\"column-2\">MED (lowest)<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-1\"><span style=\"color: #ff6600;\">P<\/span><\/td><td class=\"column-2\">Paths ( External > Internal)<\/td>\n<\/tr>\n<tr class=\"row-9\">\n\t<td class=\"column-1\"><span style=\"color: #ff6600;\">R<\/span><\/td><td class=\"column-2\">RID (Lowest)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-3 from cache -->\n<pre><span style=\"color: #3366ff;\"><strong>R1#sh ip bgp 40.40.40.0<\/strong><\/span>\n*Mar  1 00:17:21.323: %SYS-5-CONFIG_I: Configured from console by console\nR1#sh ip bgp 40.40.40.0\nBGP routing table entry for 40.40.40.0\/24, version 4\nPaths: (2 available, best #1, table Default-IP-Routing-Table)\n  Advertised to update-groups:\n     1\n  30\n    3.3.3.2 from 3.3.3.2 (3.3.3.2)\n      Origin IGP, metric 0, localpref 100, valid, external, best\n  20\n    2.2.2.2 from 2.2.2.2 (20.20.20.1)\n      Origin IGP, metric 0, localpref 100, valid, external\n\n<strong><span style=\"color: #3366ff;\">R1#sh ip bgp<\/span><\/strong>\nBGP table version is 4, local router ID is 3.3.3.1\nStatus codes: s suppressed, d damped, h history, * valid, &gt; best, i - internal,\n              r RIB-failure, S Stale\nOrigin codes: i - IGP, e - EGP, ? - incomplete\n\n   Network          Next Hop            Metric LocPrf Weight Path\n*&gt; 20.20.20.0\/24    2.2.2.2                  0             0 20 i\n*&gt; 30.30.30.0\/24    3.3.3.2                  0             0 30 i\n<strong><span style=\"color: #3366ff;\">*&gt; 40.40.40.0\/24    3.3.3.2                  0             0 30 i<\/span><\/strong>\n*                   2.2.2.2                  0             0 20 i<\/pre>\n<p><!--more--><\/p>\n<ul>\n<li>BGP uses different <em>path attributes<\/em> to calculate the best path for a route.<\/li>\n<li>Each path attribute defines something different about the path.<\/li>\n<li>The most common BGP path attributes are:\n<ul>\n<li><span style=\"color: #3366ff;\"><em>Weight<\/em><\/span><\/li>\n<li><span style=\"color: #3366ff;\"><em>Local Preference<\/em><\/span><\/li>\n<li><span style=\"color: #3366ff;\"><em>AS_PATH<\/em><\/span><\/li>\n<li><span style=\"color: #3366ff;\"><em>Origin<\/em><\/span><\/li>\n<li><span style=\"color: #3366ff;\"><em>Multi Exit Discriminator<\/em><\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr \/>\n<h3><span class=\"ez-toc-section\" id=\"Weight\"><\/span>Weight<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><span style=\"color: #3366ff;\">Higher<\/span> is preferred.<\/li>\n<li>Can be used to influcence <span style=\"color: #3366ff;\"><em>outbound traffic<\/em><\/span>.<\/li>\n<li>Cisco proprietary feature (not exactly a path attribute).<\/li>\n<li><span style=\"color: #3366ff;\">Locally significant<\/span> to a single router not advertised to any other BGP neighbors.<\/li>\n<li>Default weight is <span style=\"color: #3366ff;\">0<\/span>.<\/li>\n<li>Range from <span style=\"color: #3366ff;\">0 to 65535<\/span> ( 2^16-1 )<\/li>\n<li>With a route-map use the <span style=\"color: #3366ff;\">set weight<\/span><\/li>\n<\/ul>\n<pre>R1(config)#router bgp 10\nR1(config-router)#neighbor 2.2.2.2 weight <strong><span style=\"color: #3366ff;\">100<\/span><\/strong>\n\nR1#sh ip bgp\nBGP table version is 4, local router ID is 3.3.3.1\nStatus codes: s suppressed, d damped, h history, * valid, &gt; best, i - internal,\n              r RIB-failure, S Stale\nOrigin codes: i - IGP, e - EGP, ? - incomplete\n\n   Network          Next Hop            Metric LocPrf Weight Path\n*&gt; 20.20.20.0\/24    2.2.2.2                  0           100 20 i\n*&gt; 30.30.30.0\/24    3.3.3.2                  0             0 30 i\n*  40.40.40.0\/24    3.3.3.2                  0             0 30 i\n<strong><span style=\"color: #3366ff;\">*&gt;                  2.2.2.2                  0           100 20 i\n<\/span><\/strong><\/pre>\n<pre>ip prefix-list 20 seq 5 permit <strong><span style=\"color: #3366ff;\">40.40.40.0\/24 le 32<\/span><\/strong>\nroute-map 30 permit 10\n match ip address prefix-list 20\n<strong><span style=\"color: #3366ff;\"> set weight 150<\/span><\/strong>\n!\nroute-map 30 permit 20\n\nR1#sh ip bgp\nBGP table version is 4, local router ID is 3.3.3.1\nStatus codes: s suppressed, d damped, h history, * valid, &gt; best, i - internal,\n              r RIB-failure, S Stale\nOrigin codes: i - IGP, e - EGP, ? - incomplete\n\n   Network          Next Hop            Metric LocPrf Weight Path\n*&gt; 20.20.20.0\/24    2.2.2.2                  0           100 20 i\n*&gt; 30.30.30.0\/24    3.3.3.2                  0             0 30 i\n<strong><span style=\"color: #3366ff;\">*&gt; 40.40.40.0\/24    3.3.3.2                  0           150 30 i<\/span><\/strong>\n*                   2.2.2.2                  0           100 20 i\n\n<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Local_Pref\"><\/span><strong>Local_Pref<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li>Can be used to influcence <span style=\"color: #3366ff;\"><em>outbound traffic<\/em><\/span>.<\/li>\n<li>This is a BGP path attribute.<\/li>\n<li>Defines the best exitpoint from the AS to a prefix.<\/li>\n<li>local_pref is advertised to all iBGP neighbors, but not to eBGP neighbors ( non transitive ).<\/li>\n<li>Higher value is preferred<\/li>\n<li>Range is 0 &#8211; 4,294,967, 295 ( 2^32-1)<\/li>\n<li>Default value is 100<\/li>\n<li>Use a route-map with set local-preference<\/li>\n<\/ul>\n<pre id=\"\"><strong><span style=\"color: #3366ff;\">access-list 1 permit 30.30.30.0 0.0.0.255<\/span><\/strong>\n\nroute-map 30 permit 10\n match ip address prefix-list 20\n set weight 150\n!\nroute-map 30 permit 20\n<strong><span style=\"color: #3366ff;\"> match ip address 1<\/span><\/strong>\n<strong><span style=\"color: #3366ff;\"> set local-preference 120<\/span><\/strong>\n\nR1# sh ip bgp\nbest, i - internal,\n              r RIB-failure, S Stale\nOrigin codes: i - IGP, e - EGP, ? - incomplete\n\n   Network          Next Hop            Metric LocPrf Weight Path\n*&gt; 20.20.20.0\/24    2.2.2.2                  0           100 20 i\n<strong><span style=\"color: #3366ff;\">*&gt; 30.30.30.0\/24    3.3.3.2                  0    120      0 30 i<\/span><\/strong>\n*&gt; 40.40.40.0\/24    3.3.3.2                  0           150 30 i\n*                   2.2.2.2                  0           100 20 i\n\n<\/pre>\n<p><strong>AS_Path Length<\/strong><\/p>\n<ul>\n<li>Can be used to influcence<span style=\"color: #3366ff;\"><em> inbound and outbound traffic<\/em><\/span><\/li>\n<li>AS_PATH is a BGP attribute<\/li>\n<li>Default PA to determine best path when no other PAs are modified<\/li>\n<li>Shortest AS_PATH is preferred<\/li>\n<li>With AS prepending you can create a longer path.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Multi_Exit_Distriminator\"><\/span><strong>Multi Exit Distriminator<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li>Med is a BGP Path attribute.<\/li>\n<li>It can be modified to influence the inbound traffic.<\/li>\n<li>With dual links the incoming traffic can be influenced.<\/li>\n<li>It&#8217;s not advertised beyond the neighboring AS<\/li>\n<li>Range is 0 &#8211; 4,294,967, 295 ( 2^32-1)<\/li>\n<li>Default zero<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>BGP Path Attributes &nbsp; \u201cWe Love Oranges AS Oranges Mean Pure Refreshment\u201d R1#sh ip bgp 40.40.40.0 *Mar 1 00:17:21.323: %SYS-5-CONFIG_I: Configured from console by console R1#sh ip bgp 40.40.40.0 BGP routing table entry for 40.40.40.0\/24, version 4 Paths: (2 available, best #1, table Default-IP-Routing-Table) Advertised to update-groups: 1 30 3.3.3.2 from 3.3.3.2 (3.3.3.2) Origin IGP, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[12,8],"tags":[],"class_list":["post-335","post","type-post","status-publish","format-standard","hentry","category-bgp","category-route"],"_links":{"self":[{"href":"https:\/\/www.quisted.net\/index.php\/wp-json\/wp\/v2\/posts\/335","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quisted.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quisted.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quisted.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quisted.net\/index.php\/wp-json\/wp\/v2\/comments?post=335"}],"version-history":[{"count":0,"href":"https:\/\/www.quisted.net\/index.php\/wp-json\/wp\/v2\/posts\/335\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.quisted.net\/index.php\/wp-json\/wp\/v2\/media?parent=335"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quisted.net\/index.php\/wp-json\/wp\/v2\/categories?post=335"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quisted.net\/index.php\/wp-json\/wp\/v2\/tags?post=335"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}