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

  1. Local Preference – BGP Attribute

Local preference. In this video we’ll see how to implement and verify the local preference values. So before we implement and verify the local preference, let us quickly revise what we have learned in our previous videos. We have seen local preference is a BGP attribute which is a well known and discretionary attribute which is going to define how you should exit the autonomous system number. And by default highest value is preferred and the default local preference value will be 100 and it is going to be arguised for all the internal PGP neighbors. Now we also discussed that it is going to affect all the routers within the same autonomous system number. Like an example here, let’s say this is my destination network which I want to reach here. So I got my local A S, this is my A’s and in this as I got two exit paths.

One exit path is going where after A and we got another exit path going where after B. Now, in this my requirement will be I want to ensure that all the routers inside my S now all the routers in my as, whatever they is, the as is 64520, which means if you have as many routers, whatever the router, what is the size of the network? Now, all the routers we need to ensure that it should prefer via this route. What we can do is we can apply some local preference value, something higher than what is default here. The default, it will be 100 or you can apply something called 150 also. So it all depends upon what you’re applying or even we can say that to reach, let’s say if you have multiple networks, I go to eleven dot network and I got twelve dot network. Now, even using route maps, just like we did with Weight in our previous videos.

I can match eleven dot network and I can set the local preference of 200 for this network so that it prefers via this route. And I can match this network and I can set the local preference value of 200 for this twelve dot network. So even we can do something like this path manipulations where we can differentiate and we can define some of the traffic or traffic for some specific routes should exit via router A and traffic for some other networks should exit via B. So let’s try to implement and verify in our lab here. So I’m going to use the same diagram which we have been using in our previous videos. If you try to see here we got all the four routers, the same diagram which we have used in your weight lab also. And this router one is in the as 500, router two, router three in the as 600 and router four is in the as 700.

And the first step will be configuring the IBGP and BBGP configurations. Like in case if you are going to continue with your previous lab, let’s say if you remember the previous lab, what we did is we applied a weight attribute in our previous labs. If you are going to continue with the previous lab then the first thing we need to do is we need to remove that weight.  So we need to ensure that whatever the networks advertise like, apart from this, we also have this tool network here which is also advertised. In my initial configurations. I’m going to remove the weight whatever I have applied in my previous lab. Or if you are going to start this lab from the beginning and you don’t have any of the BGP configurations, then the first step will be you have to configure the basic IBGP and EBGP like the same way we did in our previous labs as per the diagram. And then verify the membership and ensure that it uses the default path selection process without any attributes applied.

And then finally changing the next stop. So if you remember, we have changed the next top on Router Two pointing to Router Three and then on the Router Three pointing to Router Two. So these are all the same configurations, I already have them in my notepad. So I’ll quickly copy paste these configurations here like the same configurations as per my diagram. So you are good with these configurations by this time. So I’ll just simply go and configure all these configurations. This is something what we did in our previous labs, I’m not going to use wait and then you can just simply say no access list Twelve if you are going to continue with your previous lab configurations, as of now, I’m not continuing with the previous lab configurations. So I’ll simply go and remove all the things and I will just copy paste the convicts as per my diagram.

Now, on the Router One, advertising the three networks and then two enable commands as per the diagram. So I’ll copy paste these configurations on my Router One here. You can see on my Router One, I don’t have any PGP running and I don’t have any protocol running here. So I’m going to do the configuration from the basic with the basic IBGP and EPGP configurations and the same thing on the Router Two. Also on the Router Two, I’m going to change the next top address and then two neighbor commands advertising the networks and also advertising the loop back interfaces on the Router Two. As for my documentation in my lab manual I’m using twelve dot network also, which is the continuation of a previous lab. So I’m going to stick to the same advertisements, the same thing I’m going to do on the Router Three as well.

And on the Router Four, these are the basic configurations we are doing and then we’ll try to verify our IBGP and EBGP neighborship. So I’ll start from the router one. On the Router One I should see two neighbors show IP BGP summary one of the neighbors up, the second will be up. If our confirmations are perfect, you can see the neighborship is up and similarly I’ll go and check on the router three show Ipbgp summary the neighborship is up. Once the neighborship is up, you should be able to see some of the routes coming from all the networks. So it’s taking time for converging. So let us give some time for converging the networks. So meantime, we’ll discuss our task here. Okay, so what I did, I just removed the neighbor or whatever the weight applied in my previous lab.

In case if you are going to continue the same what we did in our previous class, previous video, or you can just do all the basic configurations the same way, which I documented and the same configurations what we did in our weight lab, also not for that. When you verify, the neighborhood should come up and then we have changed the next hope. This is also what we did just now. Our task is something like this. So now in this lab, we are going to verify how the local preference is going to work. Now in that I’m going to take a simple scenario here where all the routers from a 7600 going to 700. By default, it’s going to prefer router three. So if I try to verify my diagram here so now to verify local preference, I’m going to use an autonomous system number which is having at least two routers.

Because we learned that when you apply local preference it’s going to affect all the routers inside the AIS. So for testing purpose, we need to have at least two routers in our as. If you have more than two, it will be good enough. So anyway, two is also okay. So as per this lab, what I want is now from as 600 to reach as 700 from 600 means we are going to start from here. Now, after two or we can say simply this 40 dot network, I’m going to consider this 40 dot network or you can take ten dot network, it’s up to you, any network you can check. So I’m going to consider this 400 network is getting advertised into a 600 via this route and also getting advertised via this route. Now the router two is going to receive 40 or network from this side with as hops will be it’s coming from 700, that is your router four and then going to 500 and finally reaching to my autonomous system number.

So the network is 40 dot network. Now the same 40 dot network is getting a dice from this side. So we are going to receive from this side the same 40 dot network and I am receiving with only one as that is 700. And I I means this network origin code, this network is originated through PCP Network command, not of these two. Now in router two or router three. So if you take any one of the router. In my example, if I take any one of the router, router Two or router three, so it’s going to prefer which route. So by default this route will be considered as the best route to reach 40 dot network. Why? Because the reason is it is having less number of as path when we compare with the alternate route. So what exactly we want? Is that’s what the first point here says? All the routers, all the routes going from as 600 and reaching the 700.

So in my example, I’m going to consider as 40 dot network which is belonging to as 700. So by default it all prefers exit via router three means this is our exit router and which means router three is our preferred best route, preferred exit path. So that is the default exit path we can say. Now our task is now in this task we are going to apply the local preference. And my requirement is make sure that router Two and router Three, that is all the routers in our as 600, everyone should go via router two, router Four, using the local preference. Which means I want to manipulate our routers, I want to change the local preference such that exit should be preferred over. So I want to change, this should be the best route.

Okay, this is our best route means as 600, all the routers in the as 600 should prefer this route and it should not go via this route. Now in this case, if you see here in the previous lab we applied weight, but weight will not apply in this scenario because if you apply weight only this local router will have an impact to the routes. But if you want to impact all the routers inside the as, then we need to apply local preference value. Now in our scenario, the default local preference value on this side is 100 and this side is also 100. So the default will be the same local preference value. So we want to prefer this exit path. So what I’m going to do is I’m going to apply the local preference value something more than 100. Let’s say we are going to apply 200 on router two because router two is our exit path. This is preferred exit path.

So you need to figure out which is your preferred exit router and you have to go to that router. So this is our preferred exit router. So I had to go to this router and I had to change the local preference value on router two to something higher than 100. So I’m going to apply as 200. So that is what we need to do.  Now, if you verify the same thing in BGP outputs as well on the router two, by default, 40 dot network is coming from both sides and the default path is this because of less as hops. And even if you want you can verify the routing table and you can try trace also. So in order to ensure that all the routers should prefer via exit 100, so in this case, we need to change the local preference value of the router to higher than the default.

That’s what we are going to do. And to apply the local preference, we need to simply go to Router mode and then we need to say simply PGP default, local preference and something more than 100. So in my example, I’m going to use 400 here, so it can be 400, 200, it doesn’t make difference. So let me just go with 400, exactly the same value which I’m using in my workbook. So I’ll go to my Router Two, which is my preferred exit path. I’m going to say router BGP 600. And before you apply, if you just want to verify how it is going shy Ppgp, you can say or you can try trace to 41 one, it’s going via Two two, that is Router Three and then Router Four. So we want to ensure that we should go via alternate route. So for that, I’m going to Router Two and simply say even if you want you can check on the Router Three also.

So I’ll show on the Router Three as well. If I use Show IPGP to reach 40 dot network, it’s preferring via three three two, which is directly out of form. Now in our scenario, once you apply the local preference on the Router Two, our Router Two should go via Router One and also Router Three also should go via this route.  So that is our final requirement. So simply go to the border router, we need to say router BGP 600 and then the local preference will be applied by using this command. So BGP default local preference and we can apply whatever the number I want, I can simply do this and then whenever you manipulate any changes, it’s recommended to clear the BGP process.

Now, once I clear the BGP and apply this, and if I verify Show IP BGP summary, I can see 40 dot network, it’s going via one one, and if I verify my routing table to reach 40 dot network, it’s preferring via one, that is Router One. And if I try to trace 41 one, you can see it’s going wire Router One and then reaching the A’s, then reaching Four one. Similar way if I check the same thing on the Router Three as well, if you try to see here from the Router Two. Now all the routes receiving from Router Two here, router Two is going via this route and when Router Three, that’s what we learned. If you remember, the local preference value will be advertised to all the routers. All the IBGP is nothing, but it is going to be advertised with all the routers to its internal BGP neighbors.

Which means when you apply the local preference of 400 on Router Four, it’s going to rise to its internal router. You can see here. So now whatever the routes learned from router two will be applied a local preference value of 400 automatically. Because here we did not match any routes. So we did not use any match statements or route maps to match. So we are not going to match anything, any route, which means it’s going to apply for all the routes. All the routes from router two will be automatically applied local preference value of 400. Now you can ask me why we are not able to see local preference value on the router two here. Because now these routes here, the best routes which are installed here. So these routes are coming from your external BGP neighbor and anything towards the external BGP neighbor.

You will not see the local preference value mentioned here. So it will be only mentioned for all your internal Bgpps you can see here. So it’s only for your internal Bgpps, not for external BGP. Now, if I check on the router three as well to verify my routing table to reach 40 dot network, not only 40, you can see for to reach every network, it’s going via two one all the networks, because we did not match any network here. So if I try to trace, you can see it’s going via two two one, which is my router two, and then goes to router one and then finally reaches my router four. So all the AIS, not only two routers, even if you have more than two routers, let’s say in this as, you have two more routers. Now all the routers, every router inside your as is going to prefer this route.

So that is a major difference between the weight and the local preference. So when you apply weight, the weight will be applied only local to the router, whereas local preference will be analyzed to all the routers inside the as. This way, with this simple basic lab, we can verify how your local preference is going to work. And then you can possibly verify with Shaip GP commands. And even you can use this command like Shui Ppgp. Or you can simply say shy PBG specific network like 40 dot network. When you define like this here, also you can see what local preference value is applied and it is considered as your best route. And the reason is, it is having higher local preference than whatever they’re out coming from the other end.