350-501 SPCOR Cisco CCNP Service Provider – Weight & Local Preference part 2

  1. Weight Using Route-maps – LAB

In this video, we’ll continue our lab relating to weight attribute. So if you remember, in our previous video, we have configured some of the basic IBGP and EBGP configurations. And then we change the next stop behavior on the router two molding towards router three by using next stop self command. And then we have verified that by default, router 20 dot network or 30 dot network is getting advertised on router one via one path with only one S hops. Whereas it is also advised from other path which is 600, 700 and I. And by default, it is going to use this as a best route because of least autonomous system paths. Now, and then what we did, we applied some weight on the router one, pointing towards router four, some weight of 40,000, which we applied.

And once we did that, now the router one is going to use this path via router four as the best route. So let me just quickly show you the configurations, because in this lab, anyway, we are going to continue with the weight, but we are going to use some loop bags also. So quickly, I’ll give you some idea what we did here. So I got all my configurations here. If I give shortance pipe symbol section BGP, and on the router one, I have applied a weight of 40,000 here. Now, once I applied that weight, this is something what I did in our previous lab, previous video. So it’s a continuation to that. And if I verify? Show IP BGP 20 dot network. And by default to reach this 20 dot network, it is learning the route from four dot one with two ashops, that is router four with one S hop.

And the default best route will be via four dot four one. And if I try to trace to a 21 one or 31 one, it’s going via router four, then going to router three and router one. Okay, but the thing is, if you remember in our previous lab, when we applied the weight on router one pointing towards router four, the weight is applied for each and every route. Now, each and every route coming from router four will be automatically applied the weight. That’s what happening here. All the routes learned from router four, all the routes will be applied a weight of 40,000. Now, you can come across a scenario where you have two multiple exit paths and by default, maybe this is your best route. But what we can do is we can apply some weight on this side to make this weight higher than the weight here, the default is zero.

Now, when you apply the weight of 1000, it’s going to prefer this route. But in some cases, you may want some of the traffic. Let’s say on the router two, you have some routes, let’s say ten dot network, you have 20 dot network and you have 30 dot network and 40 dot network. In some scenarios you may want your router to reach to reach the specific networks or the specific network should use the should exit via the route and all the remaining networks should use this route. So this is what we can do by using route maps in BGP attribute. Now this is something what we’ll be doing in this lab. What we’ll do is we’ll try to ensure we’ll create some loop backs here on the raptor two, I got a preconfigured loop backs.

So what I’m going to do is I’m going to continue with the same lab what I did. The only thing is I’m going to remove the weight whatever I have applied in my previous lab. If you just try to verify the weight which we applied, I’m going to remove that. So once I remove that weight automatically and if I use Show clear IPGP start soft command, it’s going to remove the weight and all the routes learns from both the sides with the default values and by default the best route will be via router two. This is the default best route and then I’m going to die my loopback interfaces here. So my requirement is here, the weight attribute using some rod maps. So what I’m going to do is I’m going to add some of the loop backs on router two.

Let’s say there are four loop bags which I am going to create and my requirements to ensure that by default to reach these specific loop bags here, like in our scenario, anything going to router two, this will be the best because of less autonomous system paths. Now, what I want to do is I want to ensure that to reach some specific routes, let’s say there are two low backs. To reach these two low backs it has to go via this route. This should be the pest route. And to reach all the remaining low backs, remaining low backs it should go via this route which means I’m going to share the load. To reach these specific destinations, I want to use this link or this link and for the remaining networks should use this link. So for only those two low backs I want to use this link.

So in that case we can also use weight but you need to apply the weight only for those two networks. That will be our requirement here. Now, to apply this weight only for those two networks, we need to create an ACL which is going to match those two networks and then we need to configure a route map. In that route map we have to define this ACL and then we had to say set weight, whatever the weight you want to apply. So when I say apply the weight of 40,000. Now the weight is going to apply only for the networks whatever we define in the ACL. And then finally we need to apply to router four towards router four. On the Router One, we need to say neighbor whatever the IP address of the router Four. And then we are going to say route map and the name of the route map.

Whatever I use, let’s say CCI and then we have to apply in so the direction anyway, I’ll explain so now, the weight attribute can also be used along with route maps. But if you want to match or apply a specific metric only to specific routes then it’s really required to you to match the networks in the ACL and use route maps and apply the weight under the route map. Now, in our previous lab, the previous video which we discussed, we didn’t use any. Route map we just applied on the route, which means it will automatically apply for all those routes. So that is something, that’s the basic difference, because in most of the cases, we don’t really want our metric to apply. For each and every network. So we want to apply only for specific routes.

So that’s what we are going to do here. So the first step in our lab so I’m going to continue with the same lap. Continue? With your previous lab without removing anything, just remove the weight attribute. So when you remove the weight attribute on the router one, it’s going to use the default paths and then I’m going to clear the BCP and then I’m going to utilize those four loopback interfaces, assuming that I have some couple of networks on the router. Two. And I want to ensure that to reach one of the two networks, any two networks, you should use route. Wire router four and for all the remaining networks, it should use wire router two so that anyway, we’ll see that next.

First, let us quickly do this configuration. I’m going to use loopbacks on the router two, so just assuming that I got some networks. So as per our default topology, I have all my loopbacks pre configured here. Only the thing I need to do is I need to advertise them in my BGP. So twelve, zero, zero. Zero with a mask of 255-255-2550. I’m using the mask 24 subnet mass, so advertising all the interfaces. And I want to verify whether these routes are coming into my BGP table or not. You can verify in the logo. Router itself. And also you can verify them on the router one. If I give show IP BGP now, I should see the routes. Take some time. Okay, now we can see the routes are coming here now. Twelve dot. Network 120 low back, second low back, third low back and the fourth low back. And if you try to observe the best root the best root is wire outer two.

That is one. One, two. Now, this is our best root. So this is our diagram here. Now, as per our diagram, as per our default BGP policy, now, the root wire outer four is considered as a best root. This is the best root. Now why it is best root because of just one as op that is 601. Okay, now what is my requirement here? Now my requirement is to ensure that and you can see the same table here. By default, router one is going to prefer via one two to reach any of the twelve prefixes and even if you want you can verify your routing table as well. So I’m just taking any network just to understand how the things are going to work if I try to trace it’s going to use the same direct route. If you want, even you can verify your routing table. All are going via one two because of less as hops.

Now, I have a requirement here. The task here is let’s say your requirement is to ensure that make sure that only the loop back 120 zero should prefer wire out of four and whereas all the remaining networks should use the default route that is wire outer two. Now my requirement here is just to ensure that to reach from router one to reach only that first two low backs let’s say 120 low back and 120 10. So to reach these two low backs, it should go wire router four means router four should be my preferred path. And for all the remaining networks remaining, in the sense it includes the remaining two low backs, it also includes your 20 dot network, 30 dot network, anything going towards router two or wire outer two, all the remaining should use the default best route, whichever is wire auto two.

The default is wire auto two. As of now, everyone is going virtual two because of less as hops. Now we want to ensure that only to reach these two networks we should go wire out of four. Now in this case, we need to match these two networks in your ACL so that will be our first step. Now what I’m going to do is to make this possible. I’m going to create an access list which is going to match it can be any names so I’ll directly write the statements here in my program here I’ll go to router one and then I will say the first thing I need to match those to match these networks, either you can use ACLs or prefix list. Now if you remember we did these basic things how to use Routemaps in our route filtering videos so by this time you should be good with using this access list and routemap statements.

So I’m going to say permit. I’m not going to deny them. I’m simply defining the permit statement with 24 subject mask. So I’m going to say anything starting with twelve zero zero network and anything starting with 120 network or representing in the form of ACL twelveteen. And then I’m going to say routemap some name, let’s say CCI or CCNP, any name you can use, just permit ten and I’m going to say match IP address. What is our IP address, ACL number is twelve. I’m going to say match those two networks whatever I have defined in my ACL twelve and then I’m going to say set weight. When it says set weight it is going to be applied only to the networks.

Whatever we had defined in the ACL twelve and I’m going to give some 4000, 2000, any number you can give anything above zero and then you have to give a blank route. Now statement with permit 20 so ensuring that all the remaining routes should use the default values. So if I’m not defining anything which means all the remaining routes will be included in that and if I don’t use any set command means automatically it’s going to use the default values. Now the last step applying this so now I need to go to router one pointing to US router two because I want to prefer a wire router four so I need to apply on the router one. So router one should exit to these two low backs via router four. So I’m going to say router BGP 500.

I’m going to send neighbor four four one. And instead of applying the weight, we are not applying the weight here, we simply represent a route map. And whatever the route map we created here, if you remember the name, we created CCNP. And then we got two directions. But for the weight, we are going to use only one direction. That is in. When we say in, So if you try out so it will not work because by default weight for out direction is not supported, it only supports in. So I’m going to say in here, so I’ll explain you what is in, what is out. In short, before that, let me just quickly verify these things before I explain you again the directions as well so that you can use Clear IPGP or Clear IPGP star soft command.

If I verify my BGP table show Ipbgp and I want to just see only the two dot networks anyway you can see here this tool dot network zero zero the best path is via router four, that is, four dot, four dot, four dot one and the reason it’s preferring this route, because of the weight, what we have applied. And that weight is only applied for 120 zero network. But if you try to see the other loop backs, the weight is not applied. Which means if I verify my routing table now these two networks goes via folder four dot one, that is our router four. And all the remaining remaining means your remaining two loop backs and 30 dot network or 20 dot network all go via the default password. Now. This way we can manipulate the best path for only specific routes.

And when you think about adding only for specific destinations, then you need to add those statements in a specific ACL. And then you have to use Rotmaps and then you can apply some weight or local preference anything inside the rod map and we can apply to that specific neighbor. Now, this is the way we generally configure if you want the weight to apply for specific routes. Okay, so next thing I just missed this part a little bit attribute. The weight attribute is local to the router which we already discussed and it’s not going to exchange weight information between the routers. So therefore it is going to only affect you on inbound route map. So it’s going to work only on the inbound. Now there are a few things we need to understand regarding understanding the in and out. So let me quickly explain you regarding this.

  1. Understand IN – OUT Directions

Now if you remember in our previous video we have seen when we are applying some rot maps to any specific neighbor, we will get two directions whether we can apply in or we can apply out. Now in this video we are trying to understand what happens if I apply inbound direction any rotmap to any specific neighbor and what happens if I apply to outbound direction. Basic difference between in and out is when you apply a route map pointing towards any neighbor, towards the end, let’s say I got a router and then I’m going to apply towards this dot map on indirection. Now when you say in inbound route maps changes the local route path selection process which means when you say apply in, if I’m going to confirm on this router, it is going to apply my local router.

But if you say apply out direction, which means it’s going to apply for the routes going out of this interface which means it is going to apply on the neighbor router. So one thing you need to remember if you want to impact the route or path selection process or any changes if you want to effect on the local router we need to go with indirection. If you want the changes we are going to confirm on one router and if you want the changes to happen on the remote router then we go with outbound direction. So this is one of the basic thing you need to remember. So inbound route maps changes the local path route selection process whereas outbound route maps are going to influence the other router decisions, the other router means whichever the router you are going to point.

So that is one thing we need to remember. And then I got some couple of points here inbound maps applied the changes to the BGP updates receiving from that neighbor. Which means when I say in it’s going to apply my local router at the same time it is going to impact whatever the routes receiving from that neighbor. So it is going to impact my local router and for all the routes which I’m receiving from that specific neighbor to which neighbor I’m applying. Like if you remember in our previous video we have configured a route map from R one pointing towards R four, we have applied some weight, a route map called Weight or route map called CCI. And then we have seen in which means whatever the route is coming from router four, it’s going to apply for those routes and whatever the routes means.

And again if you are using route map, whatever the networks you had defined in the ISL only for that route. If I just jump to my diagram here, we can see here, like in our previous case, what we did, we have matched our twelve zero zero network and 120 network in my route map or ACL. And then we have configured route map and then we applied to this neighbor and that to be applied indirection. Which means these two networks, whatever is defined in the ACL when they come from this neighbor. So you can see the second point I said it’s going to apply my local router which means router one is going to do the path manipulation for the routes receiving from that specific neighbor.

So when you say in, it’s going to apply to my local router for all the routes receiving from that neighbor to which neighbor I’m applying the route map. So this is one thing we need to remember, when you’re applying the indirection and when you apply outbound directions, it’s going to apply for the routes which you are advertising to that specific neighbor. So let’s say I’m going to apply. So this might be we’ll be using in our next scenarios. Let’s say I’m going to say outbound to this neighbor and I’m applying on the router one. So the first thing when you say out, which means it is going to impact the neighbor router, which means this router is going to do the route path selection process even though you are playing on this router and for all the routes getting advertised.

So whatever the routes are advertising from this site or whatever the route map you have created with ACLs, whatever the networks you have matched in that, it’s going to match those networks which are dizzy and it’s going to impact on the remote rafter. So that is the next point we need to know. And simple one more point we can say applying inbound is going to influence your outbound traffic, which means now if you remember, we have applied a weight on this router pointing towards router four on router one. On in it’s going to affect when you apply inbound it’s mostly influence your outbound traffic which means it will decide how your traffic should leave the Ace, which means it’s going to impact the local router and the local router is going to decide how this route should go outside the ice.

And when you apply out direction, probably it’s going to impact your inbound traffic which means when you say out, it’s going to decide how your route should enter. So there is one more thing you can need to remember. So these three points will give a very good understanding. So don’t try to mix up and get confused here. So all these three points are different points. Where the first point here it’s going to say which router will decide the path selection process. Inbound always applies on the local router, whichever router you apply. And when you say outbound, it’s going to impact the neighbor routers. And when you apply inbound policy, it’s going to apply for all the routes receiving from that neighbor and when you apply outbound it’s going to impact the routes whatever defined in the route maps and it is getting advertised to that neighbor and on that router. And then finally, when you apply inbound traffic, it’s going to impact your outbound traffic.

Which means when you say inbound, it’s going to affect how your traffic should exit the router. When you say outbound, it tells how your traffic should enter the router. And when we talk about weight, one thing we need to remember weight as is local to the router. If you remember we learned that Weight is an attribute which is local to the router. It’s not going to advertise to any other routers. That’s the reason whenever we use weight we need to ensure that the path selection process should happen only on the local router. So that’s the reason we say always in. So whenever we use weight attribute, it’s always in. But when you use local preference or any other attributes depending upon the router you are selecting, depending upon the past selection process, it can be in or out depending upon the different scenarios. So that we’ll see when we get into our other laps.

img