Advanced BGP - Attributes, Configuration & Troubleshooting

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi this is david voss ccie11372 and in this video we're going to be going over bgp concepts so here's what you're going to learn first we're going to do a bgp quick overview learn some of the basics of bgp then we're going to talk about bgp path attributes which are key in decision making in bgp specifically the as path attribute we'll focus in on that then we'll talk about ebgp versus ibgp and private versus public autonomous system numbers and then we'll also discuss bgp updates how routers share information what information they share and how they advertise those routes to one another so let's go ahead and start with bgp basics bgp is an exterior gateway protocol that uses autonomous system numbers uses tcp 179 to communicate between neighbors and it really is a protocol that requires manual configuration for almost everything it doesn't really do anything unless you tell it to do it which i really like about the protocol now it uses path attributes which are key in decision making on choosing best route so path attributes define information about a path but also this information can be used to help decide upon the best path and we will draw that out in a minute here so you can understand that better now regarding bgp path attributes there are some that you absolutely have to know and memorize for your ccnp route exam the first is weight weight influences a best route for the local router and obviously it's manually configured local preference influences the best route for all routers in an autonomous system so this is a shared attribute a s path lists the number of autonomous system numbers in the path and this can be manipulated origin is a value implying if the route is from an igp or an egp and then finally the med which can influence the best route for routers in another as so you can influence traffic flows into your as by sending out the med to other other routers so here you can see we have two routers that are in autonomous system 700 and then upstream we have another router in autonomous system 140 and autonomous system 87. so here you see there are four hops but as far as bgp is concerned it's just counting ases so it counts one two three asses the as path is 700 140 and 87. why is this important to know because here's another flow that has two routers in as700 and then one router in as87 now according to this path there's just two as's that would be the preferred path it's critical to understand that bgp is concerned about as path and not so much about hop count as path is a key attribute to understand now internal versus external bgp ibgp is something you would run basically interior to your company it's bgp connectivity within the same autonomous system in this routers do not update as path normally they should never have to because you're running the same autonomous system and in ibgp things should always be meshed routers should always be fully meshed and there are ways you can get around this and we'll talk about that in a little bit now ebgp is external connectivity to other asses and routers do update the as path in those cases so let's say we have an autonomous system 200 and in our company we're running ibgp full mesh between all routers and let's say we have connectivity to two upstream providers one is autonomous system 301 and the other provider is autonomous system 450. now between ourselves and our providers we are running ebgp because it's two different as's and internally we are running ibgp because we are communicating between the same as now configuration between ibgp and ebgp is quite similar the main difference is you're choosing to communicate with the same as or a different as now let's say we want to communicate to a web server over the internet and we have a certain amount of hops now let's say one of those paths through as450 takes us through quite a few more hops but it takes us through fewer as's so let's just say for example we go through as900 and then as100 so that's 450 900 and 100 those are the three as we traverse in order to reach that route now let's see on this flow through autonomous system 301 we go through fewer hops but more as's now even though there's fewer hops because there are more as's we're not going to prefer this route there are five as's in this path that is not going to be preferred to the other path which has only three as's so we're going to choose that path we'll choose the 3as path now let's say we're running a web server inside of our company and we're running ibgpu between these three routers and we're connecting to two upstream providers using ebgp and let's say we have users on the internet who are trying to get to this web server we can manipulate the as path attribute in bgp to make them prefer one path over the other and the way we do that well let's say our autonomous system is 50 we can manipulate the aspath attribute by adding to the as path on one of our links so for example the users know that they can reach the web server via 1as well we're going to increase that on the top router and we're going to manipulate it manually and add our as over and over again to the aspath attribute and the users as far as bgp is concerned that now is a longer path and therefore the user will prefer the bottom path because it's only one hop 1as hop now if that router were to fail users would then prefer the other path so you see you can manipulate traffic flows that way now you need to understand the concept of public and private asn's and this shouldn't be foreign to you because you understand public and private ip addressing so autonomous system numbers are chosen from this pool and you can use them for private use or public use as need be but you should be aware of that chart now regarding bgp updates that we receive from neighbors you can receive from your provider a default route only which many people do or you can receive a full bgp routing table that is literally every route that's available on the internet or you can receive just partial updates and that is maybe the provider knows about certain routes via a better path than most other providers you can just receive a partial update from your provider so you should know that you can receive those three different types of updates that should be known for your ccmp route exam now regarding advertising routes advertising bgp routes can be done four ways either through the manual network command redistribution of bgp and igp or propagation of existing bgp routes or again manually using the aggregate address command maybe the best way to explain these is to simply draw it out now imagine we have a router with an i bgp connection and an ebgp connection to an upstream provider so there's our ebgp connection here's our ibgp connection and we're autonomous system let's say 400. so on a router we can advertise in four different ways we can manually specify the network we want to advertise by literally typing it in network 10.10.10.0. or network 198110 and we can forward that via ibgp and or ebgp the other way is we can learn routes via bgp and redistribute that route into let's say an interior routing protocol let's say if we're running ospf we can take the the routes we learned from our ebgp neighbor and redistribute them the other way is to simply pass the routes we're learning from our ebgp neighbor via bgp internally to our ibgp neighbor so that's just forwarding the the information on and finally we can again manually set an aggregate address on the router and that's a manual configuration to aggregate some of the routes and again that can be advertised out either way so the rule of synchronization in bgp you should simply know this that bgp will not advertise a route unless it knows about that route via an igp that's what you really need to know for the exam now you can disable this by typing no synchronization on your router and then it will simply forward routes that are not in the igp so here's what you've learned you've learned about the bgp basics path attributes the as path ebgp versus ibgp public versus private asn how bgp updates work and you got an idea of how you advertise routes within bgp this is a good foundation for you as you move into the more detailed videos coming forth thanks [Music] hi this is david voss ccie11372 and in this video we're going to be going over bgp configuration so here's specifically what you're going to learn you're going to learn how to enable bgp on a router and then also how to bring up bgp neighbor relationships then you're going to learn about advertising networks to those neighbors and then taking a look at the bgp table itself as well as some best practices on implementing bgp in your environment or simply to be able to answer the appropriate test questions so there's certain requirements that you need to know about when you enable bgp and that is you need an autonomous system number you type in router bgp and that autonomous system number that normally is a is a number that is given to you or assigned to you and then you need to know the ip address of each and every neighbor that you would like to communicate with you would type in neighbor their the ip address of the neighbor and whatever their the remote ais so you need to enter in whatever their remote as is that's that's required so here we see for example router bgp one our neighbor is 10.1.1.2 remote as is two so for bgp neighbors uh there's certain requirements ras must match our neighbors as they point to us so when they say i need to communicate with this neighbor they need to make sure they get the as right the bgp router ids of the two routers must not be the same if there's configuration obviously that needs to be configured correctly and then each router must establish a tcp connection with its neighbors note the remote router ip address must match what the local router configures in a bgp neighbor remote as command so instead of talking about this because that could get confusing let's actually do it let's jump into the lab and today we'll be working on the point-to-point between router 2 and router 4. so here we want to enable bgp on router 4 and we simply do that by typing router bgp and let's say our autonomous system number is 10. now we want to establish a neighbor relationship with router 2 to their serial interface so then we type in neighbor the ip address of our neighbor and then the remote as and we'll say their remote as is 10 as well so this is an ibgp connection which we will talk about later but basically we're connecting two routers in the same as and there you see our neighbor is not up we see it in our bgp table but it's not up and active because we have not enabled it on router 2. so on router 2 we type router bgp 10 the neighbor the ip address for router 4 and now we should see this neighbor relationship come up and it may take a second here there we go so now then the bgp neighbor relationship has come up between router 2 and router 4 simply by entering two commands on each router we now have a valid bgp configuration now when i show ipbgp which shows the bgp table or show ip route we don't see any bgp routes being shared because we're not inserting anything to bgp just yet so how do you advertise networks you can do it many ways you can do it through propagation of received bgp routes that you're already receiving from someone else you can redistribute routes into bgp you can source the routes from your actual router and you can do that by using the network command which would specify the exact network you would like to insert into bgp and there needs to be a match for that in the local routing table or you can use the aggregate address command which does what it says it aggregates multiple routes into one larger route so here's an example of the network command router bgp autonomous system and then the network 192.168.1.0.24 we want to advertise that route and that would do it now what is the bgp table at a high level the bgp table contains all learned bgp prefixes so it takes all the learn learned prefixes from all neighbors and then from there it chooses the best path from those options and that is the route that it advertises to its neighbors so let's take a look at some of these concepts we're on router 4 now and let's say we have got a route here that we were learning 10.10.30.0 we're learning that via eigrp but we want to advertise that into bgp and we do that via the network command so you can see 10.10.30 with a mask now we're going to insert that into bgp that route we've learned via eigrp is now going to be advertised via bgp from router 4 over to router 2. and we show ipbgp neighbor the route the neighbor ip address in the advertised route and you can see that we are advertising this route and router 2 will certainly show that they are receiving this route now on router 4 let's go ahead and redistribute connected routes there's another way we can advertise routes so let's go ahead and take a look at the routes we are now advertising over to router 2 and now you can see we are also now advertising connected routes so those are just two ways you can advertise routes from a router via bgp and as you can see router 2 is now receiving all of those routes and on router 2's routing table you can see the bgp route marked by a b is now in the routing table all the bgp routes are marked by the letter b so let's go ahead and do a quick review of ebgp versus ibgp now let's say we have an autonomous system 200 and we own four routers and we connect them all via bgp being that they're all in the same autonomous system we need a full mesh that's a rule within ibgp and these are again all ibgp connections because they're all connecting to the same autonomous system but let's say we have two different providers internet service providers one is as301 the other is as450 these connections are each ebgp connections because we are connecting to autonomous systems that are not our own so in as200 we have full administrative control that's ibgp between them and then ebgp connections to our upstream providers where we do not have administrative control now let's take this concept and actually implement it in the lab so router 3 and router 4 are what we're going to work on now now remember we have an ibgp connection already between router 4 and router 2. so now what we want to do is we're going to create an ebgp connection to router 3. so we're going to we're going to do a neighbor statement over to router 3's interface serial interface and that remote as is going to be 9.99 that's going to be our ebgp session over to router 3. we're treating them like for example an internet service provider and now on router 3 they need to do the same otherwise the neighborship's not going to come up so they do router bgp 999 they point back to us on the other side of the link and they put in our remote as and they create their ebgp programming and then this neighbor relationship will come up and the neighbor relationship has come up between router 3 and router 4. and now you see on router 4 we have an ibgp session to router 2 and an ebgp session to router 3 as10 and as999 respectively pretty straightforward concept but now you know so a few best practices in rolling out bgp you should use a loopback address for neighborships we've not been doing that yet we've been using interfaces and when you use loopbacks you should manually set the router id and then you should also use ebgp multi-hop and update source loopback bgp by default will not communicate to loopback addresses you need to allow for multi-hop communications time to live with bgp is usually one you need to increase it to higher than that so i want to talk about some of these concepts so let's go ahead and do let's go ahead and enable bgp in a typical way that you would do it on router 3 we're going to start from scratch here again and enable bgp on router 3 and we're going to use loopback 99 on both router 3 and router 4 to set up our bgp neighbor session why loop x loopbacks are stable they don't flap they can be learned via multiple interfaces interfaces flap but loopbacks do not so ideally you're going to want to establish bgp between loopback addresses so and so we have the loopback addresses uh with ip addresses then you also need to make sure you have a static route in place to make sure that you can reach the loopback on the other router since we're not advertising it via an igp we're just going to use static routes for that and then we type in router bgp 10. we're going to manually set the bgp router id to the loopback address 10.30.30.1 and then our neighbor is going to be the loopback of router 4 10.40.40.1 and then we are going to set uh ebgp multihop to increase the time to live from one and let's increase it to three if it stays at one this neighborship would never come up we need to increase ebgp multihop to three so the loop x can communicate and then we're going to make our update source loopback 99. so all of these are really required to properly roll out bgp between loopbacks and we'll do the same thing on router 4. and we will soon see this neighbor relationship come up and there we see that the neighbor relationship has now come up between the loopbacks so we have a valid and stable neighbor relationship between router 3 and router 4. now let's go ahead and redistribute connected on router 3 and make sure that router 4 can actually see those routes and we'll look at the bgp table we don't see them yet often clearing bgp clear ipbgp starsoft is something that will reset the neighbor relationship and will allow for any changes you make to be implemented and in that case we now see that we've received the routes from router 3. finally let's just do a quick review on bgp attributes so let's say we have a web server and we are hosting it within our autonomous system we have three routers connected via ibgp and then we're connected to two different service providers using ebgp and let's say we have users on the internet who are trying to get to our web server and they see this as pretty much an often equal equal distance so half of our traffic's coming over one link half of our traffic's coming over the other link um they're both you know we're as50 and the way the users see it right now is that we're just a couple asses away um so we want to make one path preferred let's say there's one circuit that we want to use more often than the other we can add our as over and over again and prepend it to what we advertise out to our provider let's say on the top here and then the provider on the top would see these multiple and implement these multiple as additions to the attribute of the routes we send them users would no longer prefer that path they would prefer the the other path that had just one as listed but if that router went down then the users would choose the less preferred path now that's a that's a high level example of how you can manipulate uh as path but let's do it let's do a route map as path and then and we're on router 3 here by the way and what we want to do is we're going to say in this route map we're just going to set the as path and we're going to prepend as the proper word we're going to prepend and we're going to keep adding ras over and over again and we're going to prepend it to our advertisements out to router 4 and then router 4 as you can see right now the path is just one instance of an as well we're going to change that with this prepending we're going to apply this route map to our neighbor relationship to router 4 and we're going to place it outbound so any outbound advertisement we give router for we'll have a prepend of these as numbers we're going to clear the bgp session and then now look at router 4 all of these additional as numbers which makes the path less preferred that's just one of many ways you can manipulate bgp attributes to affect routing so here's what you've learned you've learned basic bgp configuration you've learned how to enable it and turn up neighborships in bgp you've learned how to advertise networks in bgp and how to take a look at the bgp table at a high level you've learned best practices with bgp using loopbacks and then you've also looked at the bgp attributes and how to manipulate those as well good luck in your studies [Music] hi this is david voss ccie 11372 and in this video we're going to be going over bgp verification so what i'm going to do is cover all of the concepts first and then after we've covered all the concepts we'll go into the lab so first bgp verification you want to make sure your bbgp implementation is up and running correctly so you need to use show commands and i'll show you four that you need to know you need to understand bgp neighbor states and then there are many clear commands you need to run as well and you need to understand those in order to make not only your management happy but to do well on your exam so here are four show commands that you absolutely must know show ipbgp displays the bgp routing table show ip bgp neighbor advertise routes displays the routes that you're advertising to a specific neighbor show ipbgp neighbor routes shows the routes that you are receiving and accepting from a specific neighbor and then probably the most popular command they're going to run the most is show ipbgp summary which displays the status of all of your bgp connections as an administrator you're going to be running that all the time for the test you need to know all four now there are many different bgp neighbor states that you need to know for the exam but i want to focus you on the bgp active state normally the connotation of active state means that's a good thing active means good but in bgp that's not the case active means that there is an issue even though the tcp connection has been completed there's no bgp messages being sent so you'll see in the lab that that's an issue active is not a good thing now when it comes to bgp clear commands there are many you should know but specifically i want to focus you on the difference between hard and soft clear commands a hard command will actually tear down the neighbor relationship and rebuild it and that'll cause problems if you're if you're trying to get routing working or if you have production traffic routing over the network so you need to focus in on the soft commands normally you're going to be using bgp clear commands in a soft mode in order to ensure that the bgp neighborly ship does not get torn down and that the neighborly chip is reset but not torn down or not broken you're going to see the difference a key difference this makes in our lab and if you're going to use bgp in the enterprise believe me you're going to need to know the difference if you want to keep your job so soft clears are generally what we're going to want to do we're not going to want to tear down the neighbor relationships using the hard clearing commands so here's how you're going to want to have your lab set up you're going to have an ibgp session between router 2 3 and 4 in as300 and then an ebgp session over to as1 on router 1. based on earlier studies and videos you should know how to get that ready so let's go ahead and jump onto our lab the first thing we do is let's take a look at the bgp table so how do you do that you do show ipbgp and this is our bgp table you'll see here there's multiple ways you can reach 192.168.10.0 bgp chooses from the bgp table the best path and inserts it into the routing table so in the routing table you will see just one path to 192 168 10.0 so the bgp table contains all the updates we've we've received via bgp and it takes the best route route the successor route and puts it into the routing table now on router 2 let's go ahead and advertise outbound some routes over to our neighbor so on router 2 we're going to redistribute our connected routes and you will see via show ipbgp neighbor advertise routes the routes that we are advertising over to our bgp neighbor and those are the four connected routes that we are now advertising over to our neighbor and now when we jump on router one let's take a look at the routes that we're receiving and sure enough those are the four routes that have been advertised so the show commands on show ip bgp neighbor advertised or received routes will show you exactly what routes have are being advertised out or being received inbound and there they are in our bgp table we can see that via show ipbgp show ipbgp summary will show you not only who your neighbors are but what their status is so here are two bgp neighbors they're both up and running now let's go ahead and shut one of these neighbors down so on router 2 we're going to manually shut down our neighbor relationship over to router 1. and let's see the impact it has when we do show ipbgp summary on router 1 it is now in an active state so remember active is not a good thing we have an issue here router 2 is now down and on router 2 we can see that we're in idle state we this router knows that it's been admin down now in router 2 let's create a fictional neighbor let's say we're turning up a new neighbor let's say you're an isp or a customer trying to connect to an isp and you program bgp to connect to your neighbor and you may not know if they've programmed their side yet or maybe they say they have but let's go ahead and you program your side and let's say that you've programmed your side we show ipbgp summary it's in an idle state you know there's a problem and this is the time where you pick up the phone and say hey you know what you've got to configure your side and let's go ahead and bring up our neighbor relationship now on router 2 let's go ahead and bring up the navy relationship with router 1 again so we're going to move it from an admin down state and we're going to bring it back up so we use the no in front of the neighbor shutdown command and we will see this neighbor relationship come up on router 1 and there it is you see the counter has started to increment and the neighborhood ship is now up and if we look on router 2 we can see on this side as well that the name relationship is up and running now let's jump on router one and you can see here two bgp neighbors by the ip address it's bgp version 4 the as connectivity is as300 and then skip over to the up down status which you've seen already that's the amount of time the neighbor has been up or down then look at state and prefix received that's the number of uh prefixes that the neighbor has received from its neighbor so as you will see here we will go ahead and display this let's show the routes we're receiving from router two there will be four of them and from router three we see we should be receiving nine of them so that's a quick and easy way to see if you are in fact receiving prefixes from a neighbor and how many if you need to get in detail then again you can do the show ipbgp neighbor command to show the received routes now let's talk about the bgp clear commands remember when we said that there's a big difference between a hard clear and a soft clear if you just type in clear ipbgp and then a neighbor so this is our neighborship to router 3. without putting soft it's going to be a hard clear and watch what happens it actually tears down the neighbor relationship and then builds it back up again this would result in lost packets and it would be seen as an outage in your enterprise notice the counter has restarted now that being said you can reset a neighbor relationship by using the soft command and this will do it without tearing down the bgp neighbor relationship but if you have an update say as you're advertising new routes this would allow for that to happen but much more gracefully as you can see we don't tear down the neighbor relationship so actually the difference between hard and soft can often be the difference between keeping a job and not keeping a job if you're tearing down neighbor relationships with business customers it's going to have a huge impact on your enterprise so the clear commands let's put it in practice because that's how we'll really appreciate why the difference between a soft and hard clear let's say we're advertising routes and you can see here we're advertising routes from router 2 over to router 4. we're advertising five routes so let's go ahead and filter this let's just advertise one route so let's first put the filter in place we can do that so we're just going to permit 192.168.10.0624. next we'll place an outbound distribute list between router 2 to router 4. now you would think that router 4 at this point would only begin to learn the one route from us but as you will see he's still learning five we're still advertising five even though the distribute list is in place and we can wait as long as we want that's not going to change what we need to do is we actually need to do a soft clear on the bgp neighbor relationship now again if you do a hard clear it's going to tear down the relationship we don't want that we just want to make sure the updated routes the updated distribute list takes effect and there it does so as you can see in bgp the clear commands play a big role in properly administering bgp so here's what you've learned about bgp verification you've learned about the bgp stroke commands and then also bgp neighbor states and finally the importance of clear commands and actually how to use them all this you'll need to know for your exam but also to be a great engineer in your enterprise thank you very much and good luck in your studies [Music] hi this is david voss ccie 11372 and in this video we're going to be discussing and labbing up a bgp path control specifically focusing on bgp attributes so here's what you're going to learn you're going to learn the bgp best path decision process and then we're going to talk about bgp attributes and also lab them up so we're going to configure them we're going to focus in on four critical attributes you you need to know and that's weight local preference aspath and med so here are the bgp attributes that you really need to know for your exam specifically focusing on weight which influences the route locally on the router local preference folk influences a route throughout an as the ais path is the number of as's in the as path and med which impacts the bgp decision of routers and the other as we're going to go into these four on this video in detail so you can fully understand them so that before we jump into that you need to understand the bgp path decision process there is a hierarchy in place that when bgp receives two routes it makes a decision on which is the best path by going through this process is the next hop reachable which has the larger weight which has the higher local preference all things being equal it will continue to go down this process until it finds the best path now i've i've bolded the ones that you really need to know that you can count on you're going to be asked about not only when you're an engineer but specifically when you're being tested weight local preference aspect origin and med and you can make up your own device to memorize that but wlaom in that order you need to know that which is preferred and which ones to focus on w-l-a-o-m weight local preference a.s path origin and med now let's focus in on weight for now weight is cisco unique it's cisco defined attribute and it is used to select a best path it is assigned locally to the router and that is it only makes sense to the local router it is not propagated throughout the as so let's go ahead and jump into our lab our lab setup basically is we have router 1 which is an as1 it has an ebgp session over a router 2 which is an as200 and an ebgp session over at a router 3 which is an as300 and on router 1 what we want to do is we're going to assign a specific weight so that we learn any routes from router 3 we prefer those routes if we learn any routes from router 2 we do not prefer those routes so we want to give preference over to router 3. so you do that by neighbor ip address reporter 3 weight and let's assign 333 remember a higher weight wins so over to router 2 let's assign it 222 so any routes we learn from router 3 will have a weight of 333 any routes we receive from router 2 will have a weight of 222. so should we ever receive the same route from router 3 and router 2 we will prefer the path over router 3. so the path to router 2 is still functional but it's only our second choice now let's hop on router 4. router 4 has eigrp enabled between itself and router 2 and router 3. we're going to redistribute connected on router 4 so that router 3 and router 2 learn the loopback addresses of router 4 and there you can see we can see the loopback addresses of router 4 on router 3 and we're going to redistribute eigrp on router 3 into bgp so that the loopback addresses from router 4 can be learned via bgp by router 1. and we're going to redistribute eigrp on router 2 as well so that router 1 is learning the loud the router 4 loopbacks via two sources and now if we're on router 1 let's take a look at the bgp table and we will see these loopbacks advertised to us from router 3 and router 2 they're both in our bgp table but as you can see the weight for the router 3 routes are 333 those will be preferred and that will be the route or the path that shows up in the ip routing table and as you can see here this router prefers the path to router 3. so weight is not propagated it's only local to the router you program it on but it's obviously can have greatly influence which will be the best path the next attribute we're going to discuss is the local preference attribute and again this gives an indication about which path should be taken again higher is better so a higher local preference is preferred and the default value is 100 and it's important to note that this is not just local to the router but this value is propagated throughout the autonomous system let's say we have our own as here with four routers in it and let's say our as is 100 and we have two ebgp connections to separate providers one is as300 one is as400 and let's say they both know of a route um we're just making this up so 192.168.1 24. so they both know of a path and they both advertise that path to us now we may prefer router 3 or router 4 but let's say we want to prefer the path through router 4. so what we do is set the local preference on our edge router on router 4 and we would just say let's set the local preference for 192.168.1.0 to 300 higher than the default that would then propagate to the other routers in the as and then the other routers would use would use this edge router as the path so any end users that went through any of our routing systems those routers would forward the end user through this specific edge router over to that website or whatever it was they were connecting to now that being said if the router or the circuit failed between ourselves and as400 then instead of using that path they would use the backup path which has the lower local preference and they would go out to autonomous system 300. the next attribute that is important to understand is med now med gives guidance to external neighbors external to our autonomous system about the path preference into our autonomous system so we can dynamically influence how our neighbors you know route traffic to us we can we can influence traffic flows and this information is exchanged between our asses so and it's also important to note that although we pass this information on to an as they do not forward it so we have a lab here with rudder two three and four have an ibgp session of as300 router one is as1 ebgp session connects as300 and as1 and let's go ahead and log on to router 4 and you can see our bgp sessions over to router 2 and router 3. and on router 1 what we're going to do is we're going to redistribute we're going to redistribute our loopback addresses 192.168.10.00 24. and we'll just do that one for now we're just going to redistribute loopback one you can see we are now advertising it and we are advertising its router 3 as well so now router 4 is eventually going to learn this via ibgp and we should see the route showing up 192.16810.net and now you see it's starting from two and three and the metric is 0 for both right now the best path is via router 2. while we want to influence that we want to influence it on our end from router 1. so we're gonna adjust the metrics or we're gonna adjust the med on that path so let's log on we're on router one and we're going to create a route map called a dv metric to r2 and we're going to adjust the metric over to router 2. and let's actually set it to 1000 and now under router bgp we're going to apply this route map to our neighbor to under neighbor ip address route map and now any routes we advertise out to router 2 will be influenced by this route map and we will see that the metric changes on router 4 and there you can see it now router 4 prefers router 3 instead now if router 3 fails we can always use the path to router 2. but again we've we've influenced how router 4 is going to forward traffic as you can see we're going through router 3. we've influenced how router 4 is going to handle traffic simply by what we're programming on router 1. and there's the metric value one thousand and zero finally let's talk about aspath so whenever a route passes through an as the as number is prepended to that update so with really long routes let's say you're routing from us to australia you're going to see a longer as path for the most part you'll see more as in the as path let's take a look at this route 192.168.10.0 and you can see the as path is just simply 1. 1as now we can influence this the longer as is not going to be preferred so if there's more as in a path that will not be a preferred path and we can manually edit that so on router 1 we're going to create another route map as path prepend aspen to r2 or excuse me to r3 because right now router 4 is preferring router 3 in order to get to router 1 for that route let's go ahead and set an as path prepend and let's just add the as over and over again this will actually be enough to influence how router 4 sees what is a better path so over to router 3 we type a route map we apply this new route map that we created outbound so any routes that router 3 receives will have this longer as path and any route that router 3 passes the information on will also see that longer as path so you see the old is right there and just one and now you're going to see what we've done here and now router 4 prefers router 2. as you can see router 4 now prefers router 2 to get to that path so there's another way there's another important attribute to understand and another way we can manipulate downstream what path to take so here's what you've learned you've learned quite a bit about the bgp best path decision process and bgp attributes configuration of those attributes specifically we focus in on weight local preference a.s path and med good luck in your studies [Music] hi this is david voss ccie11372 and in this video we're going to be troubleshooting bgp specifically you're going to learn bgp data structures and troubleshooting commands and then we'll do a bgp troubleshooting challenges we'll give you a couple scenarios for you to see if you can figure out what's going on so so the bgp data structure is unique now you have your incoming router information your outgoing router information but here's what's actually happening this information is being inserted into the bgp table as well as any routes that are being redistributed the bgp table then is providing the best path route based on the bgp best path decision matrix which you'll learn a little bit more about in this video but if you'd like to know more about that in detail please see how to networks ccnp routing videos for specific details on how bgp chooses best path and here's a reminder that bgp neighbors do not need to be directly connected so this is why they're not always just called neighbors they're called peers they can be multiple hops away but still share routing updates as you saw in the earlier diagram bgp maintains two data structures the neighbor table which contains status information about bgp neighbors and then there's the bgp table that contains all of the network prefixes learned from all of the bgp neighbors now note a bgp table is not the routing table it is a bgp table which contains all the prefixes learned only select routes are inserted into the routing table routes are inserted into the bgp table via advertisements received from bgp neighbors or they could be locally injected routes but the thing is these routes must be present in the ip routing table so you can inject routes learned locally or known locally and inject those into the bgp table for advertisement now bgp selects what is considered the best route using the best path decision matrix which we'll go over on a high level in this video but then that best route chosen by bgp from the bgp table that best route is inserted into the ip routing table and that best route is the route which is shared with bgp peers and bgp offers just like ospf or eigrp features that will allow you to filter routes advertised to bgp two bgp peers or received from them and this is often used because the bgp table can be so large bgp filtering is very important for any environment but especially when you're troubleshooting you'll want to understand filtering in case you're filtering out certain networks you don't want to be or allowing certain networks that you do not want to have advertised so again here's the here's the data structure and the key to here is to understand that bgp has a bgp table which contains all prefixes and only the best path is inserted into the ip routing table and then there's the neighbor table which has the status of all bgp neighbors how does bgp choose the best path well here it is uh specifically you can go through this list and here's what takes preference the highest weight which is cisco specific if you program a weight to be higher than for one prefix then another it will choose that path then local preference and then if it's originated by bgp on the local router the shortest as path lowest origin type lowest med and then ebgp is preferred over ibgp the lowest igp network to the bgp next top and the lowest bgp router id most decisions for bgp writing are going to be made in the first five steps five or six steps um you need to memorize this for sure on your test you will be you will be tested on this um if you want to know more about bgp please see the videos in the ip routing videos and we go into bgp in detail now let's get back to troubleshooting so here's some typical reasons why bgp neighborships fail specifically as the as numbers must match between what you have programmed for a neighbor and what they actually are or what you actually are what they have program for you so when you program a bgp neighbor and let's say that neighbor is as200 you have to program that neighbor as as200 if you program that neighbor as as30 or 201 that neighborship is not going to come up another major reason why bgp neighborships fails is the fact that bgp uses port tcp port 179 now why is this important well often bgp is run through a firewall and if you run bgp through a firewall you need to make sure that tcp port 179 is in fact allowed finally routers may send bgp messages sourced from ip address that does not match the ip address configured for the router on the pier when a neighbor programs a neighbor relationship to you it needs to point to a specific ip address and the ip address needs to be the source of your updates to that router the the point with bullet point one and three is that bgp is a protocol that is specifically manually that is manually configured and actually personally this is what i like about bgp bgp rarely does anything for you without you specifically telling it what to do if you want a neighbor relationship to come up you need to specifically tell it what neighbor you want to come up what as they are what ip address they are and that way you know exactly what kind of environment you're rolling out the disadvantage to that is that you can make a lot of typos and a simple typo can cause a lot of headaches and trying to get your neighbor relationships up and trying to troubleshoot so a good rule of thumb in troubleshooting bgp often is just to make sure you've programmed it correctly or if you're working with an isp and you can't see what they've programmed be sure to talk over the phone about what you have programmed for one another i think you'll find that many cases just simple programming errors are what cause bgp problems let's take a look at some of the bgp troubleshooting commands the first is probably the most popular command you're going to run and that's the show i show ipbgp summary it's going to show you the neighbor table a quick summary of it your your local router router id and as number for your neighbors as well also their current state any prefixes they're sending or receiving or the number of them it's a very good view of the neighborhood how neighborships are functioning next show ipbgp neighbors which then displays detailed information about bgp neighbors of a router specifically you should start with show ipbgp some if you need to get more granular then you can do show ip bgp neighbors i think you'll find in 90 of the cases show ipbgp summary will provide you enough information for you to really get started in isolating the issue then there's show ipbgp and you'll remember what the bgp table is well this displays that table all the network prefixes that have been learned are via bgp are in this table there's debug ip routing which as you know is not specific to bgp but it will display updates that will occur in the router's ip routing table and it gives you understand of what's going into the routing table from the bgp table and then there's show iproutbgp which can save you a lot of time and digging through interior gateway protocol other routing protocol routes and then depog there's debug ip bgp updates where you can actually view the bgp exchanges to and from your bgp neighbors if you want and need real-time information about these updates sent and received so let's jump into the lab so let's start off nice and simple and let's just take a look at a simple bgp problem that we can face there is a complaint that a bgp neighbor relationship we are no longer receiving routes from a specific bgp neighbor specifically the users in the hub site router 4 are saying that they're not receiving bgp routes from router 2. so let's go ahead and take a look and see what's going on let's take a look at our routes our bgp routes and on router 4 sure enough we're not receiving any routes from router 2 we're just getting bgp routes from router 1. we want to see the loopback from router 2 advertised to us so show ipbgp sum which i told you was a very popular command we can see that our neighbor relationship to router 2 is in fact down knowing this let's jump on router 2 and just take a look at what we see here and show ipbgp sum we see the one neighbor it's programmed correctly but the neighbor relationship is in fact down so that we have neighbors program for router 2 in router 4 they're pointing to each other but the neighbor relationship is not coming up we see our serial interface 17216 1.2 and on router 4 do you see what the problem is sure enough we are pointing to 172 16 2.2 we need to change that to 1.2 and once we do that the neighbor relationship will come up now this seems like a real simple problem it is but the fact is that one of the reasons we're doing this is that this isn't often a problem you will see when you're initially configuring bgp for the first time with a neighbor there there are the ip addresses to isps are often not as straightforward obviously as a 17216 address and all it takes is one simple typo of uh of one octet and the neighbor relationship does not come up and here we we've fixed the problem and now the neighborly ship is up between router 1 or between router 4 and router 2. and here we can see on router 4 the neighbor relationship is working fine and here's our bgp table show ipbgp and then we look at our show ip route bgp for the routing table and there is the route so everything's working fine now the neighbor relationship is up it's since the route is inserted into the bgp table and then also inserted into the routing table let's move on to our next troubleshooting scenario we have an administrator an engineer who actually works on router 2 and he's saying he sees something very odd that when he looks at routes on router 2 these bgp routes show that they're coming directly from router 1 which doesn't make sense to him because these router 2 and router 1 are both spoke routers not hub routers and our only bgp neighbor is actually 172 16 1.4 which is the hub router so he can't figure out why these routes from router 1 are showing up in his routing table as being advertised via router 1 because he has no direct connection so we are to investigate what's going on here and we can see on router 2 that the network 10.10.10.0 the next hop is actually router 1 17216 1.1 that is router 1's frame relay interface and he wants and we need to figure out why that is or what's going on and if that's if it's wrong we need to fix it and if it's right we need to explain it so let's jump onto router 4. this is the hub router let's just take a look and here is the route we are in fact learning it from router 1 17216 1.1 and that would be our next hop from router 4 because we are on the frame relay network and we are the hub and they are the spoke and if we took a look at our bgp neighbors show ip bgp sum we see that we have neighbor relationship to 172 16 1.1 and 1.2 which is router 1 and router 2. so it seems to look okay on router 4 we're receiving this route just fine the next top is just fine because that neighbor is in fact 1.1 so that's not so much of an issue the question is why is this showing up on router 2 let's hop over to router 1 and we see in fact that routers 1 router 1's only bgp neighbor is the hub router router 4. it's important to note that within bgp the next top value of a bgp network advertisement that leaves an as is the ip address of the router at the exit point from the as that advertisement is sent through ibgp to neighbors but the next hop attribute remains the same usually a router inside an as does not have a route to external ip address from the next step so if you would like this to change you need to program within bgp the next top self command next top self will force all updates from one router to show itself as the next top instead of the originating advertiser this is unique to bgp but important for troubleshooting purposes to understand why a certain route is showing with a next top that might be multiple hops away and now that we've programmed next top cell phone router 4 you can see on router 2 that the next hop is in fact now the hub router so there wasn't necessarily a problem as long as the next hop is reachable but you may get a call saying why is something working this way and ideally in a network rollout you're going to want your hub router to be your next top now for our final bgp lab what we'll be doing is logging into router 4 and we see on router 4 that the neighbor relationship to a neighbor 10.20.20 is not coming up so we need to investigate why this neighbor relationship is is not working now this is a new neighbor to us we're creating a neighbor relationship to the loopback of router2 and what we'll do first is we'll debug ipbgp and then the ip address of the neighbor we want to view updates on and then we'll debug ipbgp and this time we'll just type in debug ipbgp so we're clearing ipbgp and as you can see here there is no communication to the neighbor the 10. neighbor we don't see any updates coming to or from that neighbor so obviously something is very wrong here not only is a relationship not up but there's not even an attempt to try to establish this neighbor relationship so there's some sort of limitation in place if we look under the router bgp configuration let's see if you can spot what the problem is you see here on router four the neighbor 10.20.20.1 and update starts loopback 100 so that appears to be correct and if you haven't noticed anything yet just a reminder that in bgp when you're going loop back to loopback on ebgp sessions you need to enable ebgp multi-hop and we'll set it to three if you do not enable ebgp multi-hop it will only attempt to communicate with the next hop if the if a peer address is more than one hop away that ebgp session will not establish and it's not enough just to enable ebgp multi-hop on one side of the link you need to log into the other side as well and add ebgp multi-hop if you're communicating to the loopback of the other router and now that we have e bgp multi-hop enabled the neighbor relationship will come up between these two and this is definitely something you'll be tested on and you can count on it being something that you will see on your troubleshooting exam so here's what you've learned you've learned about bgp data structures bgb troubleshooting commands and we've given you a few bgp troubleshooting challenges but again the best thing you can do is configure bgp in your lab have someone come in and make a few changes break your lab and see if you can figure out how to fix it good luck in your studies
Info
Channel: Paul Browning
Views: 4,654
Rating: undefined out of 5
Keywords: BGP routing, BGP attributes, bgp routes
Id: MPe6e9jkq8A
Channel Id: undefined
Length: 75min 48sec (4548 seconds)
Published: Wed Sep 29 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.