{"id":1497,"date":"2017-01-07T02:30:26","date_gmt":"2017-01-07T02:30:26","guid":{"rendered":"http:\/\/www.mtin.net\/blog\/?p=1497"},"modified":"2017-01-07T02:30:26","modified_gmt":"2017-01-07T02:30:26","slug":"bgp-local-pref-and-you","status":"publish","type":"post","link":"http:\/\/www.mtin.net\/blog\/bgp-local-pref-and-you\/","title":{"rendered":"BGP local Pref and you"},"content":{"rendered":"<p>One of the bgp topics that comes up from time to time is what does &#8220;bgp local-pref&#8221; do for me? The short answer is it allows you to prefer which direction a traffic will flow to a given destination.  How can this help you? Well before we start, remember the high number wins in local-pref.<br \/>\nLet&#8217;s assume you are an ISP.  You have the following connections:<br \/>\n-You supply a BGP connection to a downstream client.<br \/>\n-You have a private peer setup with the local college<br \/>\n-You are hooked into a local internet exchange<br \/>\n-You have transport to another internet exchange in the next state over<br \/>\n-and you have some transit connections where you buy internet. <\/p>\n<p>So how do we use BGP preference to help us out? We might apply the following rules to routes received from our various peers<br \/>\nOur downstream client we might set their local pref to 150<br \/>\nThe college we may set them to 140<br \/>\nPreferred internet exchange peering: 130<br \/>\nNext state IX: 120<br \/>\nTransit ISPs: 100<\/p>\n<p>Now these don&#8217;t make much sense by themselves, but they do when you take into account how BGP would make a decision if it has to choose between multiple paths.  If it only has one path to a certain route then local-pref is not relevant.<\/p>\n<p>Let&#8217;s say you have a customer on your ISP that is sending traffic to a server at a local college.  Maybe they are a professor who is remoting into a server at the college to run experiments.  There are probably multiple ways for that traffic to go.  If the college is on the local Internet exchange you are a member of, that is one route, the next route would be your transit ISPs, and obviously your private peer with the college.  So, in our example above the college, with a local pref of 140 wins out over the local exchange, wins out over the next state IX, and wins out over the Transit ISPs.  We want it to go direct over the direct peer with the college.  Mission accomplished.<\/p>\n<p>local-pref is just one way to engineer your traffic to go out certain links. Keep in mind two things:<br \/>\n1.Higher number wins<br \/>\n2.local-pref only matters if there are multiple paths to the same destination.<br \/>\n3.Local-pref has to do with outbound path selection<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the bgp topics that comes up from time to time is what does &#8220;bgp local-pref&#8221; do for me? The short answer is it allows you to prefer which direction a traffic will flow to a given destination. How can this help you? Well before we start, remember the high number wins in local-pref. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[212,17],"tags":[13,410,103,409,334],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6VLMf-o9","jetpack-related-posts":[{"id":1832,"url":"http:\/\/www.mtin.net\/blog\/the-problem-with-peering-from-a-logistics-standpoint\/","url_meta":{"origin":1497,"position":0},"title":"The problem with peering from a logistics standpoint","author":"j2sw","date":"September 29, 2017","format":false,"excerpt":"Many ISPs run into this problem as part of their growing pains.\u00a0 This scenario usually starts happening with their third or 4th peer. Scenario.\u00a0 ISP grows beyond the single connection they have.\u00a0 This can be 10 meg, 100 meg, gig or whatever.\u00a0 They start out looking for redundancy. The ISP\u2026","rel":"","context":"In &quot;BGP&quot;","block_context":{"text":"BGP","link":"http:\/\/www.mtin.net\/blog\/category\/networking\/bgp\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.mtin.net\/blog\/wp-content\/uploads\/2017\/09\/dreamstime_xs_87568893.jpg?fit=480%2C320&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":183,"url":"http:\/\/www.mtin.net\/blog\/bgp-lockdown-hints\/","url_meta":{"origin":1497,"position":1},"title":"BGP lockdown hints","author":"j2sw","date":"September 29, 2014","format":false,"excerpt":"As I am preparing talks for the upcoming WISPAPALOOZA 2014 in Las Vegas I am making some notes on advanced BGP. \u00a0If you are running BGP, and want to lock it down a little here are some general hints. \u00a0If you want more attend my session in Vegas or look\u2026","rel":"","context":"In &quot;Mikrotik&quot;","block_context":{"text":"Mikrotik","link":"http:\/\/www.mtin.net\/blog\/category\/mikrotik\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":452,"url":"http:\/\/www.mtin.net\/blog\/rfcs-you-need-to-know-rfc-2796-bgp-route-reflection\/","url_meta":{"origin":1497,"position":2},"title":"RFC&#8217;s you need to know: RFC 2796 BGP Route Reflection","author":"j2sw","date":"November 29, 2015","format":false,"excerpt":"https:\/\/tools.ietf.org\/html\/rfc2796 Currently in the Internet, BGP deployments are configured such that all BGP speakers within a single AS must be fully meshed and any external routing information must be re-distributed to all other routers within that AS. For n BGP speakers within an AS that requires to maintain n*(n-1)\/2 unique\u2026","rel":"","context":"In &quot;BGP&quot;","block_context":{"text":"BGP","link":"http:\/\/www.mtin.net\/blog\/category\/networking\/bgp\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":19,"url":"http:\/\/www.mtin.net\/blog\/bgp-looking-glass\/","url_meta":{"origin":1497,"position":3},"title":"BGP Looking Glass","author":"j2sw","date":"March 10, 2014","format":false,"excerpt":"One of the things we have been doing more of here at MTIN is BGP setups. \u00a0I am starting a series of posts on BGP troubleshooting and tidbits Looking Glass http:\/\/www.bgp4.as\/looking-glasses A looking glass can help you see how certain parts of the Internet view your advertisements. \u00a0This can be\u2026","rel":"","context":"In &quot;xISP&quot;","block_context":{"text":"xISP","link":"http:\/\/www.mtin.net\/blog\/category\/xisp\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":365,"url":"http:\/\/www.mtin.net\/blog\/basic-mikrotik-bgp-filter-rules\/","url_meta":{"origin":1497,"position":4},"title":"Basic Mikrotik BGP filter rules","author":"j2sw","date":"October 29, 2015","format":false,"excerpt":"Below are some basic Filter Rules for Mikrotik BGP filtering. \u00a0These are not complex and can be very easily implemented on your BGP peers. Before we get to the code there are a few assumptions 1.Your own IP space in this example is 1.1.1.0\/22 2.These filters are not fancy and\u2026","rel":"","context":"In &quot;Mikrotik&quot;","block_context":{"text":"Mikrotik","link":"http:\/\/www.mtin.net\/blog\/category\/mikrotik\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":434,"url":"http:\/\/www.mtin.net\/blog\/simple-bgp-by-qrator\/","url_meta":{"origin":1497,"position":5},"title":"Simple BGP by Qrator","author":"j2sw","date":"November 17, 2015","format":false,"excerpt":"so the folks over at Qrator have proposed some additions to BGP. At the heart of this is the addition of roles in a BGP session. You would have four possible roles: customer, provider,peer, and internal. You can learn some more about this at https:\/\/radar.qrator.net\/tools\/simple-bgp","rel":"","context":"In &quot;Networking&quot;","block_context":{"text":"Networking","link":"http:\/\/www.mtin.net\/blog\/category\/networking\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.mtin.net\/blog\/wp-json\/wp\/v2\/posts\/1497"}],"collection":[{"href":"http:\/\/www.mtin.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.mtin.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.mtin.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.mtin.net\/blog\/wp-json\/wp\/v2\/comments?post=1497"}],"version-history":[{"count":1,"href":"http:\/\/www.mtin.net\/blog\/wp-json\/wp\/v2\/posts\/1497\/revisions"}],"predecessor-version":[{"id":1498,"href":"http:\/\/www.mtin.net\/blog\/wp-json\/wp\/v2\/posts\/1497\/revisions\/1498"}],"wp:attachment":[{"href":"http:\/\/www.mtin.net\/blog\/wp-json\/wp\/v2\/media?parent=1497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.mtin.net\/blog\/wp-json\/wp\/v2\/categories?post=1497"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.mtin.net\/blog\/wp-json\/wp\/v2\/tags?post=1497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}