DC Failover :: BGP - Local Pref & AS-Path

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome back to ospf packet i am so excited to dive back into networking uh at a high level today's video is going to be an awesome experience as we look at bgp and how we can use some attributes to affect outgoing traffic flows and incoming traffic flows with some very simple route maps i've got a lab set up it's going to be available in github for you to pull down and play with if you want to try and poke around and learn how to do some of this stuff it's super powerful and it can definitely come in handy if you're trying to fail over a network from one circuit provider to another in order to do maintenance or if you're experiencing slowness off of a specific circuit or something like that where you want to move traffic from one provider to another in order to have a downtime or the ability to generate a maintenance window for a specific device maybe in your network that's required so there's lots of different use cases for this but those are kind of the ideas that i wanted to touch on for today's today's video so let's check this out in the cli and i'm going to pull up a topology and show that to you as well so let's talk through it and see what we got all right so here here is our topology that i've got uh pulled up and draw the i o this is saved in the uh network scripts bgp lab uh that i have out there for you there will be a link in the description for this um this is essentially the topology that we're going to be looking at i've got a dc network with a loopback address of 10.10.10.1 it's uh i've got it in there as a slash 24 and then a dr or just a secondary data center at 10.10.20.1 um so this is the ips scheme that we've got going on here i put a loopback address on this general internet router of 8.8.8.8 to simulate google and uh att's as number is 70 18. that's uh easily easily found on the internet zayo there's another circuit provider in my area uh as pat their as number is 6461 that's easily found and then i just pull the i pulled this number out of thin air 25 25 1 for the as number of my local enterprise and this is going to be a design where we have an internet router and a transit router in each data center and uh i want out of the box my traffic is gonna go if i'm go ping from this device or from this network to google or 8.8.8.8 on this general internet router my path is going to go to the transit route this trend the dc transit the dc internet over to atnt and up this way you can think of these think of this as a straight path here and then we are going to use a route map with a s path prepend and local preference in order to push this traffic from here it's going to go up to his local gateway on the transit router here fire across whatever you might have dark fiber or maybe a ring or switched ethernet or metro ethernet they can you can fire that across here over to your other data center and out a different circuit if you so desire so let's take a look at this together here and i'm i'm going to pull my topology up and actually pull it over here so i'm on the other side of my screen so i've got this up to see so just to kind of demonstrate we'll see here which path it's going to take so first let's make sure that we can ping this from my loopback address i can and i can so cool and that's 10 10 21 here and 10 10 10 one here so i'm going to tracer out this now and traceroute takes a little bit on these virtual devices and um well i'm also going to show you on the general internet router i'm going to trace back to those ip addresses to show inbound traffic flows from to your network as well so um you can see we hit our local gateway and yeah we hit our local gateway and then we go to four and then to two and then to one and then over here we're gonna do the same thing from the dr side we're gonna go to our local gateway four two and one one is our uh is the general internet router and two is the att router four is the dc internet router and 11 is my local gateway dr transit for dr network and eight is my local gateway the dc transit for the dc network and then general internet on the way back into that network two is again at t four is the dc internet router uh eight is the dc transit which is the local gateway for the dc network which is what i trace routed to and then this is the router that that that network lives on and if we trace to dot 20 you'll see that it follows the same path back it does follow the same path back it just hits the local gateway for the dr transit to get to the dr network so you can see on the traceroute here that we went to two um four eleven and ten so that's the that's to get to the um att router the dc internet router and then the dr tran or yeah and these the r transit and the dr network for the dr where the host lives in dr so okay so this is the this is the script that we've got to show us to use the preferred path and the non-preferred path so i'm going to copy and paste these in to make this easy and simple easy and simple for us but i will show you how how we use these with the route map statements so let's check this out let me paste these in so i want my preferred path now to be dr so i'm going to go to the dr internet router and that's where i'm going to actually publish my route map so i have published my route map there for the preferred path i'm going to go ahead and publish my non-preferred path on the dc network now and i'll talk through what these do in just a second but i want to uh oh wait see i'm done messed up so i published that on the dc network that that won't do anything i've got to go to the dc internet router to do this so let me grab this again copy paste my route map in here and now um what we want to do is we want to clear ipvg star soft on each of these internet routers to uh just to send the updates across all the routers so that everything is in uh in sync with one another before we um kick off this uh trace route again so we're gonna go back to our go back to our dc and dr networks and i'm just going to trace route to the a dot here trace route to it there let's go to our general internet and we're going to trace route the dc network one here and we should see our route map work it's his local gateway should go to seven yep we go to seven now instead of um four we should go to three next three cool and then yep same over here and we should go to one bam there's one and one so that's our outro outbound traffic flow and our general internet is gonna go to three seven and then eight eight to nine and then just to show that the other one updated as well we'll trace her out to the dr network as well awesome so we see that um we are our inbound traffic flow from the internet is going to uh zeo our dr internet circuit and then to the local gateway in the network so we have now used route maps to push our traffic use route maps to push our traffic sorry we've used route maps to push our traffic up and over to the other data center and out this other circuit instead of this circuit and we can i can run that same script in the reverse pattern on these internet so on these internet routers i can run the preferred path script here and the non-preferred path script here and then re-run the traceroute and you'd see it go back the other way like it was to start with so how did these route maps work i do want to go to those internet routers and show you these route maps real quick okay so this is my this is my route map show route map i've got a route map called a s path that sets the as path prepend and it pre-pins my as number three times and then there's a local preference a route map local preference that is setting the local preference to 125 on the dc and remember we ran the preferred path script we ran the preferred path script on the dc internet router so if we go over to the the preferred path on the dr so if we go to the dr and run the same command here our route map is only pre-pending one time and we're setting our local preference at 200. so bgp local preference prefers the higher number i don't know what it goes up to but i typically stay around 200 and 125 for that and then as path prepend i typically have it one one prepend here on my non-preferred on my preferred path and i pre-pinned it three times on my non-preferred path local preference sets the preferred path for your outbound traffic so you set your you set your local preference for your outbound traffic so the higher number is the direction that you will go as you're going out towards the internet and then the asphalt prepend the shorter as path is going to win so if you pre-pinned your as path as number three times then in the path it's going to have this in the as three hops so it's going to be less preferred it's going to look like a longer path to the internet to get back to you so this is where you want to make sure that you've got these matched up your longer your higher local preference goes with your least number of prepended as numbers so that your traffic goes out one direction and comes back the same direction you don't want to create a an asymmetrical routing scenario where your traffic might go out one circuit and come back in another it may not be too big of a deal if you've got layers and it's all going to be the same hop to your perimeter firewall but if you have an issue where your perimeter firewall is the gateway or something where it's in the path and it needs the same path coming back you don't want to create asymmetrical routing it makes it difficult to troubleshoot things and have problems so make sure that you always i always like to match up my local preference higher number with my shortest as path prevent so that's why i keep these handy scripts to just have a preferred path script and a non-preferred path script to be able to just copy paste bam your internet's flipped over one way or the other i do want to look at the bgp section here so show actually run pipe section router and i want to show i want to talk about because it took me quite a while to figure out or to really kind of grasp how the route maps are applied so in this scenario this router is my dc internet he is um dot four so 155.1.24.4 and so my neighbor is the att circuit on this side and he is 24.2 um so i'm going to apply the route map to that neighbor to my upstream neighbor on both sides um but what i'm going to do is i'm going to take the routes that i receive in from the provider from the circuit provider and i want to apply this route map to all the routes that i learn from him and set my local preference to whatever 200 or 125 in this case um so that takes it sets the local preference and then when i when i am doing this default originate and next top self to my ibgp piers on the inside which are these three guys i am going to apply that local preference number to those routes when i redistribute them down so you can see um from a transit on the transit perspective show ipbgp you can see that 200 is what's applied what it sees and the hot next hops and what they are so it's gonna install it in the routing table for the next top of the highest local preference you can see the local preference for the routes that are learned and then so that means that then that the as path i want to i want to apply the route map to add the as numbers to the to the path outbound so when i every update that i send to this guy to my upstream neighbor my circuit provider in this case att or in this case xayo i am going to prepend my path on all the routes i send outbound so this is these are the two statements that attach those route maps to the neighbor of your upstream circuit provider so you can flip your traffic one way or the other so um that's what we've done it's really awesome it's really cool to see that we can push traffic one way or the other uh with just a quick script we can move traffic for our entire organization from one place to another it's a really neat uh idea and it can be very beneficial and helpful as well so guys i really hope that this has been helpful and beneficial to you that maybe it's something that you can put your hands to the keyboard practice a little bit and then when you're your company or the or a client or whoever it is you might be working for or what you're whatever it is you're doing if they need to move their internet from one circuit provider to another with two two as numbers on there are two different circuit providers this is a very easy way to move traffic from one place to another that can enable you to create a maintenance window where you can do code upgrades or things like that on your internet edge the transit uh so i've recently had some debates and discussions with uh some engineers and architects around the idea of having a internet layer and a transit layer and i really think that as companies are moving towards having a presence in the cloud especially pres companies that are going to have sas applications that are consumed over the internet not necessarily infrastructure as a service or or anything that might be in like azure aws that you have a direct connect to but things that are consumed over the internet having that transit layer can really enable you especially if you've got three or four circuits the different providers um you can you can actually take take bgp and get a route table from your provider that shows their directly connected next hops and you can publish that into the internet edge into the internet routers and then ibgp will push those routes down to the transit routers and those transit routers have the entire routing table on them so then regardless of where you're coming from on your enterprise you can get to that transit layer and then bgp can help you make an intelligent decision on which direction to send the traffic which circuit to send the traffic out of so that it's closest and you get the lowest latency for any of that kind of traffic so it's it's a really cool idea and uh it's it can be very beneficial i think to um companies like i said that are going to sas applications and are consuming lots of internet bandwidth and they just have a lot of applications that they consume over the internet it's extremely uh helpful to be able to use the shortest path to get to those applications over the internet so i hope this has been helpful i hope it's been beneficial i hope you get to play with it i'm going to publish this this is all published in a github repository uh link in the description you'll be able to pull that down maybe lab this up and eve like i've done and be able to flip your flip traffic back and forth and i hope that you're able to put it into practice in a production environment and that it is beneficial to you and your company so we will catch you next time it's been awesome hit the subscribe button hit the bell we'd love to chat with you drop a comment in let me know how this uh if working with bgp and sy has been helpful you and your job or or maybe it hasn't been and this is all dumb i don't know we'll catch you next time thanks guys you
Info
Channel: ospfpacket
Views: 1,304
Rating: undefined out of 5
Keywords: cisco, bgp, failover, datacenter, ccnp, ccnp training, cisco cli, as-path prepend, as-path bgp, route-map, local preference bgp, local preference bgp lab, network, network training
Id: FBkOzu_MaCM
Channel Id: undefined
Length: 22min 2sec (1322 seconds)
Published: Tue Aug 25 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.