- [Instructor] In this video we're building
on the configuration we did in our prior video.
In our prior video, we took a look at this topology
and we setup router R3 to form neighborships with R2,
with both of our ISPs,
and we noticed some interesting characteristics
within an Autonomous System.
For example, when R3 advertised a network
to R2 it didn't change the next hop address.
So we still have to overcome that.
And we saw that within an Autonomous System,
if a router receives a route advertisement
from a router in that Autonomous System,
we're not going to re-advertise that
to anybody else in the Autonomous System.
And as a result, R1 was not learning routes from R2,
because R2 learned those routes from R3
and it wasn't re-advertising them,
and we fixed that with a route reflector.
We also took look at BGP Peer groups,
how we could treat several neighbors identically
without having to configure those neighbors individually.
Now let's continue with this same topology
in the same configuration by trying
to optimize our traffic flow.
We saw in our previous video
that we were using the 10 Megalink
to get out to the internet, instead of the 100 Megalink.
We would like to change that.
And by the way the reason that we are using ISP1 instead
of ISP2 is the router ID,
that's acting as the tiebreaker here.
The Autonomous System path length is the same,
we've got the same local preference,
the same weight, the same multi exit discriminator,
all those things are ties,
so the tiebreaker in our case is the router ID.
And the router ID of ISP1, 4.4.4.4,
is lower than the router ID of ISP2 which is 6.6.6.6
and let's confirm that we really are preferring ISP1
to go out to the internet,
we're going to see how to get to the 5.5.5.0 network.
Let's do a show IP route.
How do we prefer to get there?
Well it says we're going to go to a next top of
198.51.100.2 that's ISP1.
Now BGP knows about both paths.
If we do a show IP BGP command,
it knows about these two different ways
to get to 5.5.5.0/24 but notice the greater than sign,
we're preferring to go via ISP1 instead of ISP2.
And again the reason is the router ID.
And by the same token when we're coming back into,
our enterprise network Autonomous System
65,001 from the internet,
I suggest that we are using ISP1, let's confirm that.
If I go to my internet router and do a show IP BGP command,
let's see how we get to one of those inside networks,
like the 10.1.1.0/24 network.
I've got two ways of getting there,
but the greater than sign says I'm going to
203.0.113.1 and if you look at that topology, that's ISP1.
So what we want to do is influence both inbound
and outbound path selection.
And we can do that in some different ways.
And this is a very real world thing that we're doing here.
I had to do this when I was working at a University
and we were peering with two different
Internet Service Providers
and one was a lot faster than the other,
but the one that was slower
was closer to the internet backbone.
It was a fewer number of Autonomous System hops.
So most of our incoming traffic,
was coming in through that slower link.
So we had to fix that.
Now here in our example,
first I want to focus on the
outbound path selection as we go out to the internet.
And the way I personally like to do this is
to use the local preference path attribute.
Keep in mind here, we're assuming that
we are the Enterprise Network Administrator.
We can configure router R3,
we are not allowed to go out
and configure anything on the ISP routers,
they wouldn't like that.
So we need to keep our configuration on our device.
So let's go back over to router R3
and let's configure a route map,
to set the local preference value,
when routes are coming in from each of our ISP's.
First I'll say route hyphen map
and I'll say local pref hyphen ISP1
and we'll apply this route map to our ISP1 neighbor
and I don't need to set a sequence number
for this route map because,
I'm only going to have one command in it
and it's to set the local preference.
I'll say set local hyphen preference
and I'll set this one to 100.
And let's create a route map going out to ISP2.
We'll say route hyphen map,
in fact I'll just use the up arrow
so I don't have to type that in again
and we'll create a route map called local pref ISP2.
And we'll set this local preference to 200.
Now that I've got my route maps configured,
let's apply those to our neighbors.
Let's go back into router configuration mode
for BGP Autonomous System 65,001,
and we'll say neighbor 198.51.102 that's ISP1,
I'll say I want to apply to the route map,
called local pref hyphen ISP1 in the inbound direction.
For our other neighbor which is ISP2, it ends in a dot six.
I want to apply the route map of local pref ISP2,
in the inbound direction.
Now that approach will not work
for the inbound pass selection,
meaning the path that devices on the internet
are using to come into our network,
we're not influencing that,
we're just influencing our outbound of path selection,
by manipulating the local preference values.
And as a reminder remember it's the highest
local preference that wins.
And we've set the highest local preference for ISP2.
Routes that were coming in from ISP2.
And that's the a hundred Megalink.
That's the faster link.
But now let's see how we can
influence the inbound path selection.
My preferred way of doing that,
and I'll say preferred way because
there are different ways of accomplishing this.
But personal preference, I like to use the AS path.
I want to make this path coming in through ISP1,
to look less attractive to internet devices.
And I can do that by pre-pending
multiple instances of my own Autonomous System.
That way when somebody on the internet is trying to
come into my Enterprise Network,
they look at the path via ISP1
and it looks like more Autonomous System hops.
It's surely not more Autonomous System hops.
I've just given multiple instances
of my own Autonomous System,
so if the tiebreaker comes down to
number of Autonomous System hops,
it might find a different way to go,
it might go through ISP2.
Here's how we can do that.
Let's create another route map.
I'll say route hyphen map,
and I'll call this AS path for Autonomous System path
and I'll set the AS path pre-pend value
to two extra instances of my own Autonomous System.
I'll say 65,001 and 65,001.
Now let's apply this to our neighbor.
We'll go back into router configuration mode,
for BGP Autonomous System 65,001
and I'll say for the neighbor,
and I only need to point to ISP1 here
because that's the only one that I want to pre-pend
these instances of my Autonomous System to,
I'll say neighbor 198.51.100.2,
route hyphen map AS path.
And I want to this in the outbound direction
as I'm sending routes out to ISP1.
Alright, let's reset our BGP neighborships
and relearn the routes
now that we've made these adjustments,
I'll do it clear IP BGP star,
and we need to wait a couple of minutes
for everything to settle down.
And when that happens, we'll come back and resume the video
and see if our path selection has improved a little bit.
Alright, it's been a couple of minutes.
Let's see if things look different now.
On our three let's do a show IP BGP.
Remember before, the preferred path
was to go via ISP1. 198.51.100.2
we hope it's now 198.51.100.6.
let's press Enter and see what it looks like.
Look at this.
You see the dot six and the greater than sign,
that's now the preferred way to go out.
And the reason that's the preferred way
is the local preferences are different.
For my ISP2 neighbor my preferred neighbor,
the local preference is 200.
For ISP1 it's 100
and we prefer a higher local preference value.
So that worked.
Now let's go out to the internet router
and see how things look as we come back in
to our Enterprise Network.
Remember before to get to for example,
the 10.1.1.0 size 24 network,
the preferred path was via ISP1.
Let's see if that's changed now.
let's do a show IP BGP
and now it says we're going to go to dot six
that is the preferred path.
So we've now been able to manipulate
both inbound and outbound path selection.
And this was a look at how to configure
BGP for IP version four.
In our next video we'll take a look at
configuring BGP to support the
routing of IP version six networks.