[AUDIO LOGO]
So now that we've explored soft reconfiguration and route
refresh, now let's actually start
implementing some of our BGP path selection features.
In this video, we'll start with weight.
Weight, of course, as we mentioned,
is local just to this router.
So let's take a look at configuring this on IOS XE
as well as IOS RE.
We'll start by bringing up our topology
and putting together a game plan.
And then we'll jump into the command line
and see weight in action.
So we'll go ahead and start on IOS XE.
So for that, let's go ahead and work on router 7.
And what we're going to be looking for is on router 7
right now there should be a default route,
which is currently pointing to router 1.
And we're going to override that, of course,
using the weight attribute, and instead
let's get that traffic to go and use the default
route from router 6.
Now, ultimately, router 6 will still forward that traffic
to router 1.
But we're not too worried about the data plane right now.
We're not worried about the overall path.
So let's jump into the command line and implement this.
We'll start off by looking at the current default on router
7.
So we'll do a sh ip bgp to begin with.
And the first thing we want to note
is that we are, in fact, learning the default route
across three different paths.
Currently the best is selected as the 50.0.167.1, which
is, of course, router 1 being the next hop going directly
to AS 100 and ultimately to AS 300.
We, of course, are going to change
this to prefer the path through 50.0.167.6, going through AS
1000 and then 100 and then 300.
So to do this, let's go ahead and go into configuration mode.
We will need a prefix list.
We'll call it PL_FROM_R6.
And we'll simply permit the default route.
Then we'll match on that with a route map.
We'll call it RM_FROM_R6.
In our first statement we'll simply
say to match on the IP address using the prefix list
that we created earlier.
Then we're going to set the weight attribute.
We can see here, based on the context sensitive help,
that this is in fact a 16-bit value.
And we can put in anything 0 through 65535.
Given that the default for this path
is currently 0 and highest weight wins,
we can pretty much put in any weight we want.
So let's just put in like 100.
Now let's go into router bgp 65001.
And on our neighbor 50.0.167.6, note that if we wanted to,
we could, in fact, set the weight right here.
We don't need to use the prefix list and the route map.
Personally, I usually go right to setting attributes
with a route map.
In this particular case, it might be easier
to put the weight directly on the neighbor statement.
However, things generally never stay simple.
They usually get more complicated.
And this way we would already have a route map built.
And if we did need to manipulate other things coming
from router 6, we already have that structure in place.
So, yes, we could have done it right here on the neighbor
statement, but instead we're going to apply that route map.
So our route map was RM_FROM_R6.
And, of course, you have to choose which direction you're
going to apply that route map.
We're going to want to apply this to updates coming in
from router 6.
We'll go ahead and exit configuration mode.
And note if we do a sh ip bgp, notice
that nothing's happened yet.
All the weights are still 0.
This, again, is because we need to trigger a route refresh.
So we'll just do a clear ip bgp for router 6's neighborship
inbound.
Then we'll do our show ip bgp again.
Here we see that the wait is now set properly
to 100 on the prefix coming from router 6.
And, in fact, that is the path that we are now using.
So we can see that weight has manipulated our path selection.
We are now going through router 6 and AS 1000, which
was our stated design goal.
So next let's look at IOS XR.
But before we do, we need to see what
router 3-- which is the router we're
going to be manipulating-- we need
to see what it's already doing before we can decide
what choice we're going to make as far as changing its path.
So let's look at router 3.
Let's do a show bgp.
What we see here is that the default route is currently
going through router 1.
So let's go back over to our diagram
and come up with a game plan of what we're going to change.
So we're going to be doing something similar here
to what we did on router 7.
However, for IOS XR, we're going to look at router 3.
Currently as we just saw, router 3
is following a default to router 1.
That's the one we're not going to want it to use.
We're going to instead want it to choose
the default going to router 2.
So that's the change that we're going to make on router 3,
again, of course, using weight.
So here on router 3 we're going to need a prefix set.
We'll just call it PS_DEFAULT.
We'll set this to match on the default route.
And we'll end the set.
And then we're going to need a route policy.
So we'll create a route policy, we'll call it RP_FROM_R2.
And then we'll start writing our policy.
We'll say if destination is in the PS_DEFAULT,
then what we're going to do to this prefix,
we're going to go ahead and set the weight.
We'll just use 100 again, but we can
see it's, of course, the same range.
And then go ahead and pass the route through.
Then we'll say, else.
So, of course, for anything not matching our prefix set,
we'll just pass those routes through unchanged
because our goal here is not to filter routes,
it's just to manipulate the one route.
We'll end our if statement.
We'll end our policy.
And then we'll go into router bgp 100.
We're going to say for the nei 10.2.2.2,
which is an already preconfigured neighbor,
for the address family IPv4 unicast.
Now, once again, just like iOS XE,
there is a choice here where we can, again, set the weight
directly on the neighborship.
We didn't have to use a prefix set and a route policy,
it's just more flexible moving forward.
But we do still have to apply that route policy.
So we'll say route-policy RP_FROM_R2.
Once again, it's going to need a direction.
So we'll say in.
We'll commit those changes, and we'll exit configuration.
Once again, if we do a sh bgp, we
can see that in this particular case,
it already changed the weight.
If it hadn't, we could, of course,
clear this session again.
But in this case, it's already done so
and we can see that the weight is now set to 100.
And we are now using the path through 10.2.2.2,
which was our goal.
In this video, we looked at how to use the bgp weight
property to influence our path selection on both IOS XR
and IOS XE.
Now as we saw, you can do this directly under the neighborship
properties as an attribute, or you
can do it either through RPL or a route map.
But, again, using RPL with the route map
is generally more flexible moving forward
since things don't always stay quite so simple.
I hope this has been informative for you,
and I'd like to thank you for viewing.