How to setup conditional advertisements in BGP

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys one of my favorite features in BGP is this feature called conditional advertisements now I personally think that this is really really cool so let me illustrate how we're gonna essentially set up our network and in doing that I will go ahead and explain how this feature works and how we can use it to our advantage so let's say that this guy here router 2 is gonna be our ISP 1 and let's say that our 3 is gonna be our ISP - ok now our 1 is going to be sitting over at the edge of our network and we are gonna form an e bgp relationship between our service providers ok we will be an autonomous system let's say 65,000 and 1 and these guys will be 65,000 and two and 65,000 and 3 okay so that's how we're gonna set this up now in the real world you might have a perfectly good adjacency with your service provider right you may say hey these guys are perfectly functional we have an adjacency we're good to go however your service provider may have a problem on the backend so what happens if we if we say look I don't want if my service provider has a problem I want to stop advertising my prefixes to my service provider that's having a problem so in other words it's it's this dynamic advertisement or as we call it conditional advertisement to your ISP you're saying look if you have a problem I want to stop advertising my prefixes to you you can also do the other way around you can say look if you have a problem I want to start advertising my prefixes somewhere else so let's bring this to the next level let's say R 2 as a 1 gig link and maybe R 3 as a hundred Meg link and maybe you don't ever really want to use your backup link you're not really interested in multipathing you're not really interested in ever sending production traffic over R 3 unless of course R 2 or you know ISP one has a problem so you say to yourself look I want to normally on a regular basis I want to advertise my prefixes out to is P 1 and I want ISP one to be used for all of my traffic no matter what however if for some reason on my service provider back-end if he should lose a link if you should lose an adjacency if a router should go down if for some reason my service provider has a problem I want to be able to auto magically detect that I want to stop advertising my prefixes to my service provider and I want to start advertising my prefixes out to my secondary service provider so you can build in this dynamic advertisement by using the conditional advertisement so basically what we're gonna do is we're going to look for this prefix inside of r1 so basically what we're gonna do is what I just said so we're gonna build what we call an advertise map okay so let me just jot this down here so that you guys don't forget so we're gonna build this advertise map and what that really is is just a route map that basically says advertise this that's all it does all it is is a route map that says advertise these prefixes okay and of course it's based on a prefix list or an ACL or whatever makes you happy we'll probably just use a simple ACL because we're just laughing but you can use again whatever your requirement is and in whatever you're doing now the Enver ties map is going to look for two sets of other conditions and those conditions are called exist or non exist now what's the difference between these well it's very very simple the exists is basically does this exist and does this route exists okay if this route exists we are going to perform this particular action so so basically what we're gonna do is we're gonna say ok we're gonna say neighbor - da - da - da - advertised map this and it's gonna be you know maybe some loopback addresses that we have hanging over here on the end of our three and it's going to say advertise these prefixes as long as this route or prefix exists okay now then what we'll do is we'll say neighbor 3.33 non exists and so what that's going to do is that's again gonna look for the same ten for zero prefix and say look and vert eyes whatever's in our advertise map to our three but only when these prefixes do not exist in our routing table so it's a very very cool feature to be able to set up this dynamic advertisement inside of BGP and be able to tell BGP who and when and why you want to advertise specific prefixes to a neighbor based on the existence of another prefix now just to bring this into the real world this address might be something like Google you know or or Facebook or something that you know is not ever going to go away and something you know that your service provider is always going to advertise to you and so if that advertisement goes away from your neighbor then you start advertising your prefixes somewhere else altogether okay so let's go ahead let's clear the screen and let me bring up will bring up our CLI and we'll go ahead and get this configured what we're going to do is we're just going to use our we're not going to mess around with loopback zeros what we're gonna do is just basically form without directly connected interfaces so we'll say router bgp 65,000 and one bgp router ID 1.1.1 we'll say neighbor 10.1 2.2 and his remote autonomous system is going to be sixty-five thousand and two we'll go ahead and say redistribute connected we'll say neighbor 10.1 3.3 and his remote AAS is going to be sixty five thousand and three do shall run section router bgp so at this point we should be able to form a pretty simple adjacency here between our one two and three let's wake up our two config t router bgp 65,000 - oops bgp 65,000 and two bgp router ID 2.2 - neighbor 10.1 2.1 remote 65 thousand and one and what we'll do is go ahead and say redistribute connected so do shall run section router bgp and that should do it so a neighbor ship comes up may take a couple 30 seconds here for us to advertise our our prefixes router bgp sixty-five thousand and three i believe is what we said bgp router ID 3.33 redistribute connected neighbor 10.1 3.1 and we're going to say remote 65,000 and one let's control see out all right so we should have a Jason sees that come up in theory let's see here this doesn't look to be there we go sometimes I just don't have patience so let's say you IP BGP summary let's see what we get we have not gotten any any advertisements yet from our neighbors and we know that BGP again is not the fastest routing protocol on the face of planet Earth and so just to recap again while we wait of course I have to find something to say in the meantime is what we're going to do is we're gonna basically look for this prefix here and we're going to go ahead and you know what while we wait we can go ahead and build it anyway and we're gonna say look when this exists so if exist okay then advertise okay so let's go ahead and let's actually build that first so on our one first thing we're gonna do is we're gonna build an access list that matches the network that we're looking for again you can build a prefix list you can do essentially whatever you want okay so I'm gonna say access let's permit and I'm gonna say 10.2 4.0 0.0 0.2 55 because I'm looking for a slash 24 okay next thing I'm gonna do is I'm gonna create a route map so I'm gonna say route map and I'm gonna call it advertise okay actually no that's not true it's gonna be exist permit 10 now this exists map all its gonna do is say match IP address and it's going to go ahead and say 1 ok we're not going to apply any we're not going to apply any other prefixes to it we're not going to do I'm sorry yeah we're not gonna play any other prefixes to it we're not going to go ahead and and apply attributes to it this is all we're gonna do do show a run section route - map so all we're doing is we're saying look I'm looking for this particular prefix ok now what I'm going to do is I'm going to go ahead and I'm going to create a route map that says advertise now that advertise route map is basically going to say or list the prefixes that I want to advertise so if I say do show IP interface brief e assigned you can see here that I have my three loopback addresses that I'm that I can play with and what I'm gonna do is I'm just gonna pick on one okay so we'll pick on loopback one so all I'm gonna do is say look if for whatever reason if as long as I have a route to this prefix to this network I want to advertise this network out to r2 so if we say do show IP BGP summary right now we should be receiving prefixes if we head over to r2 and say show IP route BGP you can see that we have a network 192 168 1 show IP BGP and you can see here 192 168 1 dot 1 so so we have that this route in our routing table okay and don't forget do shell run section router bgp we've gone ahead and said redistribute connected so all of our connected interfaces should be pumped into BGP okay so now let's create our route map and I'm going to say advertise and we'll say permit 10 again we don't have to do that it should be automatic and I'm gonna say match IP address and I'm gonna say 2 now we have to create this ACL so access list to permit will say host 192 dot 168 at 1.1 because don't forget we're just going to advertise that one network that one prefix okay now the last thing we're gonna do do you show run section router bgp is i'm going to go into my bgp process and i have to apply this per neighbor so what I'm gonna do is I'm gonna go in and I'm going to say neighbor 10 1 2 2 that's my neighbor of router 2 and I'm gonna use this keyword that says advertise now after this advertise I have a few options what I'm looking for is the map because I need to do an advertise map and I'm just going to use the name of my rap map so I'm going to say advertise now after this I have 2 options I have either exist or not exist so in other words for this particular neighbor I want you to advertise whatever's in my advertise map only if this prefix exists or doesn't exist and so obviously I'm matching the exist map at the moment okay so I'll go ahead and say exist do show run section router bgp so very cool feature what I'm going to do is I'm going to go ahead and I'm going to advertise my 192 168 1.1 that's it that's in this route map only if I have a route to the network that exists in this exist map which is 10240 so let's say do show IP BGP and we should see 10240 and the next hop as r2 so let's say do show IP route BGP so do we have a route to it 10240 yes we do so what we're gonna do here is I'm gonna go on r2 now remember that this has nothing to do with the adjacency between R 1 and R 2 so this adjacency here let me just pick a color here this adjacency right here is functioning perfectly well we don't have any problems in fact all we're gonna do is we're gonna remove this prefix here essentially our route to Google ok so what we'll do is we'll say a config T whoops config T I'm gonna say interface 0 1 and all I'm gonna do is shut it down we'll wait for the console message to come up letting us know that we've shut down the interface I'm gonna say do clear IP bgp star soft out I'm gonna head over to r1 and I'm just doing this to clear the to clear the process faster because I don't want to wait you know the advertised interval here for bgp to clear out and of course you know you and your production network you may want to change those intervals let's say do show a PPP and let's see if the 10240 still exists it no longer exists let's say do show IP route bgp we no longer see the 10240 let's go over to r2 and what i want to do here at this moment if we scroll up here let me scroll up we had the 192 168 1 1 in our routing table our I'm sorry in our BGP table let's see if it's there now show IP BGP and we no longer see it so the 192 168 1 1 disappeared the rest of them did not because we did not add them to our advertised map right if we go in and I say do shall run section route map this was an advertised map right so if I say do shall run section access list and I look at the two ACLs that I created this was the exists map right so access list 1 I was looking for this particular network to exist it didn't exist and so what did we do we stopped advertising whatever matched ACL to which was that individual network again if I wanted to add all of them I could have done so now what we want to do here let's say show IP BGP on our three we are seeing the 192 168 1 1 so what we want to do here is we only want this prefix to show up in the BGP table or the routing table of our 3 if and when this disappears so we don't want it to show up on our 3 all the time only when the route to that network disappears so let's go back into interface e 0 1 we'll go ahead and say no shut because we want it to come back up we'll say clear IP BGP star soft out we'll go on to our 1 will say do clear IP BGP star soft so so now let's go ahead and let's build the opposite of this because if I go over to our R 3 you can see that I am getting a router I am getting a prefix in my BGP table for 192 168 1 1 so what we're going to do is again we're gonna build the opposite of this ok now I am gonna build an exist map that essentially matches the same one that I've already built it's going to be the same ACL the only reason that I personally and I'm gonna build another one is because of the name I like to name my route Maps very very specific to what they're doing you know in the production world if I had dozens of route maps I would obviously clean this up a little bit and make it more you know make something that I could use you know in both scenarios and I could still use this it's just giving you guys more clarification I just want you to know that I could use the same route map because essentially I'm looking for the same exact condition okay so do shall run section router bgp the difference is not the route map the distance is in the command here whether it's exist or not exist ok I like to have my route Maps very specific so if I have an exist map I like exist if I have not exist I like non exist even if that's looking for the same prefix again not to beat a dead horse you could certainly use the same route map if you wanted to in fact you could use this same exact command simply setting this to non so for example if you really wanted to you could go in and do the and all you'd have to do is basically do non exists and and this would work just fine because you're advertising the prefix is using the same round map I just don't like it okay so I just want to make that clear for you guys it might be saying why are you doing all this so let's say do show run section route map okay this is my personal preference I'm going to say route map and say non exist permit ten and all I'm gonna do is basically use the same exact ACL exit do show run section round map okay there we go so I have to route maps exactly the same only difference is the actual name okay view show run sanction router bgp let's go now our BGP instance and I'm just gonna basically copy this I'm gonna copy this up to this point and then what I'm going to use is the non exist and then what I'm going to do is simply take this name of this route map which again is looking for the same exact prefix they're both matching ACL one which if we scroll up should be up here somewhere where it was yes so if we look at ACL one it's saying look if this does not exist then I want you to advertise this prefix to this neighbor okay so let's say clear IP BGP star soft outlets clear what we're advertising let's go ahead and lastly let's just we'll say soft and let's go to r2 and let's say soft let's go to our three clear IP BGP star soft let's give it a minute let's say show IP BGP and we see you know basically what we expected the 192 168 1 one has now disappeared but the 1 2 and 1/3 still exist let's go over to 2 and say show IP BGP and you can see here that we have the 1 1 ok let's go to r1 and say show IP VGP let's see what we have and here's our two four zero right 10240 so now what we want to do is we're gonna go over to our two we're gonna shut down this interface to stop this prefix from advertising and simulating that's somewhere in our service provider network we have a problem again don't forget that Jason C is fine we might still be getting other routes to you know other production websites out there on George Bush's Internet's but you know for Google or for something that's production that we really care about that we really need for some reason our service provider has stopped advertising that prefix to us okay so let's go ahead let's go to our to will say config t interface easier one whoops interface easy row one and we'll go ahead and say shutdown we'll wait for the console message to come up clear IP bgp star soft out let's go over to our one clear IP bgp star soft give it just a second do show IP BGP show IP BGP type the red command I'll go ahead and there we go so no two four zero let's check to show IP BGP we're gonna have to clear this again clear IP BGP star soft let's say show IP BGP and there we go so the one one has disappeared right now this would automatically time out guys so you know don't don't think you know the question in your mind right now yeah but our service providers not gonna clear and what I have to call my service provider no no you wouldn't this this would this would time out on its own I just don't want to sit here and make you guys wait watching the video and I'm Way too lazy to do video editing and fast forward so let's say show IP BGP and now we see the one one so when we when we were up here we did not see the one one in our BGP table but down here we do because it's based on our conditional advertisement it's based on the condition that we've met that this prefix here has now disappeared from our BGP table and so since it's disappeared we no longer can get to it we no longer have a route to it and what's going to happen is r1 is now going to advertise the our prefix that we've selected over to r3 once this comes back we will stop advertising it from r3 and go ahead and riad ver ties it out to our production service provider so again one of the very very cool features to me anyway in BGP the conditional advertisement make sure that you guys practice this a lot because it's something that I personally love to see being used
Info
Channel: XtremeIE
Views: 6,772
Rating: 5 out of 5
Keywords: BGP Conditional Advertisements, Conditional Advertisements, BGP, BGP CCIE, CCIE R&S, CCIE, CCIE RS, CCIE v5, CCIE version 5, JP Cedeno, J.P. Cedeno, xie, xtremeie, cisco, cisco ccna, cisco ccnp, cisco ccie
Id: Me85086UhtY
Channel Id: undefined
Length: 19min 57sec (1197 seconds)
Published: Wed Jul 27 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.