|
0:00:13
|
The fourth way that we have an option to originate prefixes in the BGP
|
|
0:00:18
|
is with the feature known as BGP conditioanl route injection.
|
|
0:00:22
|
Now, this is much less of a common design as compared to using just a network statement
|
|
0:00:28
|
or using the aggregate address command.
|
|
0:00:30
|
Where this is generally for the purpose of traffic engineering.
|
|
0:00:33
|
We are taking an aggregate
|
|
0:00:36
|
and from the aggregate, we are genertaing subnets.
|
|
0:00:40
|
So, it's the opposite of the aggregate address command,
|
|
0:00:43
|
where would aggregation we're taking the subnets
|
|
0:00:45
|
and then generating a less specific match from it.
|
|
0:00:48
|
With conditional route injection, we're taking a less specific match
|
|
0:00:51
|
and then generating subnets from it.
|
|
0:00:55
|
Now, the reason that we would want to do this
|
|
0:00:58
|
is that we have a shorter match to a particular destination,
|
|
0:01:03
|
then we want a particular peer
|
|
0:01:05
|
to send traffic for just a subset of that aggregate.
|
|
0:01:11
|
So, let's say here in AS 100,
|
|
0:01:14
|
we have four or three subnets that we're aggregating.
|
|
0:01:18
|
We have 150.28.1.0/24
|
|
0:01:23
|
150.28.4.0
|
|
0:01:27
|
150.28.6.0
|
|
0:01:31
|
All three of these prefixes, they're being aggregated together as 150.28.0.0/20
|
|
0:01:40
|
Router 1 is advertising this to 6.
|
|
0:01:42
|
It's advertising it to 4.
|
|
0:01:45
|
4 and 6 respectively are gonna be advertising this to AS 54.
|
|
0:01:50
|
If we look at the result of this and go to BB1 or BB3,
|
|
0:01:57
|
On BB1, let's look at the Show...
|
|
0:02:04
|
Show IP BGP.
|
|
0:02:08
|
Right now, we have the...
|
|
0:02:12
|
/20 aggregate.
|
|
0:02:13
|
Plus we have the more specific routes.
|
|
0:02:19
|
So, the first thing I'm gonna do is change this...
|
|
0:02:23
|
aggregation.
|
|
0:02:25
|
So that AS 54 is only receiving...
|
|
0:02:28
|
the /20.
|
|
0:02:30
|
They're not gonna be receiving the individual subnets.
|
|
0:02:35
|
So, to do this on router 6,
|
|
0:02:39
|
I'm going to filter inbound
|
|
0:02:42
|
as the prefixes are coming from switch 1.
|
|
0:02:48
|
I'm not going to accept the subnets in that direction.
|
|
0:02:52
|
Then likewise, on router 4, I'm not gonna accept these from router 5.
|
|
0:02:56
|
So, the only possible way that I can reach the subnets is gonna be in from router 1.
|
|
0:03:04
|
So, first, let's go to router 6.
|
|
0:03:10
|
And to ... Actually, to simplify this, let's look at the Show IP BGP Summary.
|
|
0:03:14
|
One thing I could do real quick
|
|
0:03:16
|
is going to the BGP process.
|
|
0:03:19
|
Then simply say, "For this neighbor, 155.28.67.7,"
|
|
0:03:24
|
"I wanna shut them down."
|
|
0:03:25
|
So, this is used to administartively disable a particular peering.
|
|
0:03:32
|
Which is different than simply removing the config.
|
|
0:03:36
|
Because now, whatever policy that I have applied on to the neighbor,
|
|
0:03:39
|
it's gonna stay in the running config.
|
|
0:03:41
|
When I want to reactivate them, the only thing I need to do is say,
|
|
0:03:44
|
"No neighbor shutdown."
|
|
0:03:47
|
So, now, I'll do the same thing on router 4.
|
|
0:03:51
|
If we Show IP BGP Summary,
|
|
0:03:54
|
I'll say under BGP 100, for the neighbor 155.28.0.5,
|
|
0:04:01
|
I want to shut them down.
|
|
0:04:07
|
Now, if we look at the Show IP BGP,
|
|
0:04:10
|
on either router 4 or router 6,
|
|
0:04:13
|
we should see just the /20.
|
|
0:04:17
|
So, router 1 is originating the aggregate.
|
|
0:04:20
|
It's going to both of its internal peers, router 4 and 6.
|
|
0:04:24
|
4 and 6 are then sending it to the external peers who are BB1 and BB3.
|
|
0:04:33
|
BB1 says, "I have two possible ways to get there."
|
|
0:04:36
|
One of them is directly from router 6.
|
|
0:04:39
|
One of them is indirectly through BB3.
|
|
0:04:43
|
If we look at the details of the prefix, we'll say Show IP BGP 150.28.0.0/20,
|
|
0:04:52
|
the vast majority of the attributes are the same here.
|
|
0:04:57
|
However, one of the routes is learned from an external peer.
|
|
0:05:01
|
One of them is coming from an internal peer.
|
|
0:05:04
|
So, BGP is part of the path selction, it will choose an EBGP route
|
|
0:05:09
|
over an iBGP route.
|
|
0:05:13
|
Assuming that the weight, the local preference and the AS path information is the same.
|
|
0:05:20
|
Now, this is separate from the administrative distance
|
|
0:05:23
|
because this decision happens in the BGP state machine.
|
|
0:05:27
|
Not one is getting installed into the routing table.
|
|
0:05:31
|
So, in the routing table, we still would prefer external BGP over internal BGP.
|
|
0:05:35
|
Because we have a distance of 20 for external versus 200 for internal.
|
|
0:05:41
|
But as part of the path selection,
|
|
0:05:43
|
we're gonna choose the external routes over the internal routes.
|
|
0:05:47
|
So, this then means from BB1's perspective, if we were to trace,
|
|
0:05:51
|
let's say router 1's loopback.
|
|
0:05:54
|
Trace 150.28.1.1
|
|
0:05:57
|
This is gonna go to the EBGP peer.
|
|
0:06:01
|
If I were to go to BB3,
|
|
0:06:04
|
and do the same thing, trace 150.28.1.1,
|
|
0:06:09
|
from their perspective, they're going to their EBGP peer, which is router 4.
|
|
0:06:16
|
So, this means that the inbound traffic from BB1 is going that way.
|
|
0:06:21
|
The inbound traffic rom BB3 is going that way.
|
|
0:06:26
|
Both of the routes that they're using
|
|
0:06:28
|
are the same longest match. BB1 is learning the /20,
|
|
0:06:33
|
as is BB3.
|
|
0:06:37
|
If I now wanted to change the path selection,
|
|
0:06:41
|
my options are limited because if I change the /20 on one exit point,
|
|
0:06:46
|
it's going to affect traffic for all of the individual subnets.
|
|
0:06:50
|
It's going to affect router 1, 4 and 6.
|
|
0:06:53
|
But then also any of the other destination. Router 3, router 2, router 5, etc.
|
|
0:07:01
|
So, now, with the BGP conditional route injection,
|
|
0:07:05
|
I could tell one of the exit points,
|
|
0:07:07
|
either router 4 or router 6,
|
|
0:07:09
|
that in addition to the aggregate,
|
|
0:07:12
|
I want to advertise selectively one of the individual subnets.
|
|
0:07:18
|
So, now, on router 6,
|
|
0:07:20
|
I'll say that when I'm sending the advertisement out to BB1,
|
|
0:07:24
|
not only will I send
|
|
0:07:27
|
the 150.28.0.0/20
|
|
0:07:32
|
but I also wanna advertise 150.28.1.0/24
|
|
0:07:44
|
Now, the key to this feature similar to the aggregation,
|
|
0:07:48
|
where aggregation says that the subnet needs to be in the BGP table before we can generate the summary.
|
|
0:07:54
|
Conditional route injection says that the summary needs to be in the BGP table
|
|
0:07:59
|
before we can generate the subnet.
|
|
0:08:04
|
Implementation wise, there's two different route maps that we're gonna for this.
|
|
0:08:08
|
The inject map is going to specify what's the actual route we wanna advertise.
|
|
0:08:14
|
So, in this case, that's gonna be router 1's loopback.
|
|
0:08:17
|
The exist map is going to match the aggregate.
|
|
0:08:20
|
And the neighbor that it is being learned from.
|
|
0:08:24
|
On router 6, this means that we're gonna match the /20.
|
|
0:08:28
|
And we're also gonna match router 1's address.
|
|
0:08:31
|
because that's where the prefix is being learned from.
|
|
0:08:36
|
This is similar to in IGP when we were changing the administrative distance on a per neighbor basis.
|
|
0:08:43
|
When we look at the routing table,
|
|
0:08:45
|
and on router 6, say, Show IP Route 150.28.0.0,
|
|
0:08:53
|
and look at the specific match for...
|
|
0:08:58
|
the 255.255.240.0
|
|
0:09:03
|
The routing table says that the route source is 150.28.1.1
|
|
0:09:14
|
So, when we look at the routing table, whatever value shows up after the from,
|
|
0:09:19
|
that's the source of the update.
|
|
0:09:23
|
So, in the exist map,
|
|
0:09:25
|
I need to match 150.28.0.0/20
|
|
0:09:29
|
and 150.28.1.1/32
|
|
0:09:36
|
So, on router 6, I actually need three separate prefix list.
|
|
0:09:40
|
One of them is gonn be for...
|
|
0:09:43
|
router 1's route source, which is 150.28.1.1/32
|
|
0:09:51
|
Another one that is for the aggregate.
|
|
0:09:57
|
The aggregate is 150.28.0.0/20
|
|
0:10:03
|
Then the third one is gonna be the subnet
|
|
0:10:07
|
that we're trying to generate.
|
|
0:10:09
|
In this case, I want to generate 150.28.1.0/24
|
|
0:10:17
|
Now, I could generate whatever I wanted to.
|
|
0:10:19
|
I could generate a /25 or some longer match
|
|
0:10:22
|
as long as it is encompass by the /20,
|
|
0:10:28
|
that's what our prerequisite is.
|
|
0:10:30
|
So, I can't generate 1.2.3.4/32
|
|
0:10:34
|
because that's not part of the summary, 150.28.0.0/20
|
|
0:10:41
|
So, I'm gonna advertise the /24
|
|
0:10:45
|
Next step is that I need two separate route-maps.
|
|
0:10:48
|
One of them is gonna match the route source and the aggregate.
|
|
0:10:51
|
That's the exist map.
|
|
0:10:54
|
Then the route-map that is matching the subnet is the inject map.
|
|
0:10:57
|
So, that's actually what I want to advertise.
|
|
0:11:02
|
First one is gonna match the aggregate
|
|
0:11:05
|
and the source.
|
|
0:11:08
|
This says, Match IP Address Prefix List
|
|
0:11:13
|
The Aggregate.
|
|
0:11:16
|
Then Match the IP Route Source.
|
|
0:11:19
|
This likewise is a prefix list that is router 1's route source.
|
|
0:11:26
|
Then I have the route-map that is to generate the subnet.
|
|
0:11:34
|
That is going to set IP address prefix list.
|
|
0:11:39
|
So, up to this point, we've only been doing matching with the route-maps for BGP.
|
|
0:11:45
|
In this case, we are actually setting the prefix because we are originating it.
|
|
0:11:56
|
So, the prefix list we are setting is the subnet.
|
|
0:11:59
|
That's gonna be what we are injecting.
|
|
0:12:01
|
Then under the BGP process, we'll say BGP Inject Map.
|
|
0:12:06
|
We're injecting what's matched in generate subnet.
|
|
0:12:12
|
But only if the aggregate is in the BGP table.
|
|
0:12:16
|
So, that is match the aggregate and the source.
|
|
0:12:22
|
On router 6, if we look at the Debug IP BGP,
|
|
0:12:26
|
we should see that the BGP process is now gonna look for the aggregate.
|
|
0:12:31
|
And if it finds it, it's then going to generate the...
|
|
0:12:36
|
/24
|
|
0:12:40
|
So, let's try sending a triggered update,
|
|
0:12:42
|
we'll say Clear IP BGP.
|
|
0:12:44
|
Star (*) Out.
|
|
0:12:58
|
And what I should have said here was Debug IP BGP Update, not Debug IP BGP.
|
|
0:13:04
|
So, let's try this again. Clear IP BGP Star (*) Out.
|
|
0:13:28
|
So, now, let's look at the...
|
|
0:13:31
|
Let's just look at the Show IP BGP.
|
|
0:13:33
|
If this worked, we should the /24 is now on the tabe.
|
|
0:13:38
|
But it says the originator is actually still router 1.
|
|
0:13:42
|
So, somewhere in this debug output, it should have said that we're actually doing the origination.
|
|
0:13:51
|
And we may not see it because I did the wrong debug before.
|
|
0:13:58
|
before the process started.
|
|
0:14:00
|
So, if we now look at the Show IP BGP 150.28.1.0/24,
|
|
0:14:09
|
it says that this was generated by
|
|
0:14:13
|
conditional route injection.
|
|
0:14:14
|
It was injected based on that particular path, the /24.
|
|
0:14:21
|
It says, this is coming from an aggregate
|
|
0:14:25
|
that was really originated by router 1.
|
|
0:14:27
|
The BGP prefix right now has RIB failure,
|
|
0:14:33
|
which means that it's not actually getting installed in the routing table.
|
|
0:14:36
|
So, this is considered an inactive prefix in the BGP table.
|
|
0:14:42
|
What RIB failure essentially means is that when we look at the Show IP Route,
|
|
0:14:46
|
and match that particular prefix,
|
|
0:14:50
|
there something else in the table
|
|
0:14:53
|
as opposed to the BGP route.
|
|
0:14:56
|
Now, specifically in this case, the reason why that BGP route is not installed,
|
|
0:15:02
|
is that we have an iBGP learned route with a distance of 200
|
|
0:15:07
|
versus the OSPF route with a distance of 110.
|
|
0:15:12
|
Although remember what we talked about the update rules
|
|
0:15:15
|
and the advertisement rules that are differnt in RIP and EIGRP
|
|
0:15:20
|
versus OSPF and BGP.
|
|
0:15:23
|
In BGP, as long as the prefix is a best route,
|
|
0:15:27
|
we can advertise it to the neighbors.
|
|
0:15:29
|
We don't necessarily need to install in the routing table
|
|
0:15:32
|
as long as it's installed in the BGP table.
|
|
0:15:37
|
So, now, if I were to go to BB1,
|
|
0:15:43
|
and look at the Show IP BGP,
|
|
0:15:47
|
we should see that now we have the /20 aggregate
|
|
0:15:52
|
but also the /24 subnet.
|
|
0:15:56
|
So, if we were now to do a trace route to router 1's loopback,
|
|
0:16:00
|
either from BB1 or BB3,
|
|
0:16:05
|
we should see that the traffic is always gonna go to router 6.
|
|
0:16:11
|
So, from BB3, we'll trace 150.28.1.1.
|
|
0:16:18
|
This link here, this is the connection
|
|
0:16:20
|
between BB1 and BB3.
|
|
0:16:24
|
Now, on the remote end, those neighbors don't actually have a route back to this.
|
|
0:16:28
|
So, what I need to do is source the packets
|
|
0:16:33
|
from something they do have a route to.
|
|
0:16:37
|
On BB3, if I look at the Show IP Route Connected,
|
|
0:16:42
|
this would be, let's say loopback 1.
|
|
0:16:54
|
From BB3, we'll say trace
|
|
0:16:58
|
to get to 150.28.1.1 from 28.119.17.1,
|
|
0:17:11
|
So, simply based on the fact that the longer match is only being advertised to BB1,
|
|
0:17:17
|
it now means that any traffic that is going to router 1's loopback
|
|
0:17:22
|
needs to take the link to BB1 first then to router 6 then down to router 1.
|
|
0:17:31
|
But just like the previous aggregation, the keypoint is that the network is still resilient
|
|
0:17:37
|
becasue if the link between router 6 and BB1 goes down,
|
|
0:17:40
|
we still have the route to the /20 via the other entry path.
|
|
0:17:50
|
There's a question here,
|
|
0:17:51
|
"Is it preferable to use an access list instead of a prefix list,
|
|
0:17:55
|
given that you can use the Show Acces List and see the hits against the list?"
|
|
0:18:00
|
The problem that you could run into when using an access list in BGP
|
|
0:18:04
|
is that if you use a standard access list,
|
|
0:18:07
|
you can only match on the address field and not on the subnet mask.
|
|
0:18:13
|
So, if theoretically, we had two prefixes that were different lengths but share the same address,
|
|
0:18:20
|
we would not be able to distinguish between them by using just a standard access list.
|
|
0:18:26
|
Now, we'll see later when we talk abuot some additional filtering techniques.
|
|
0:18:29
|
There is a way that you could use an extended access list in BGP
|
|
0:18:33
|
that will work basically the same way as a prefix list.
|
|
0:18:37
|
Where this was essentially a temporary workaround
|
|
0:18:40
|
that they came up with before they actually implemented the prefix list.
|
|
0:18:45
|
So, ideally, you would use the prefix list any time you're trying to match a route.
|
|
0:18:49
|
Because if we look at the final result of this on router 6,
|
|
0:18:54
|
say Show Run Include Route Map or...
|
|
0:18:59
|
Match or Set or Prefix...
|
|
0:19:06
|
or Inject.
|
|
0:19:11
|
Under the BGP process, we're saying, "Inject whatever Route is in the route map, generate subnet."
|
|
0:19:17
|
"But only if what's matched in the route-map, match aggregate and source..."
|
|
0:19:22
|
"is true."
|
|
0:19:26
|
So, match aggregate and source is saying, "If the prefix aggregate is in the BGP table
|
|
0:19:30
|
and it's being learned from this neighbor,
|
|
0:19:33
|
then we're allowed to generate the subnet.
|
|
0:19:37
|
So, the problem again with the access list is that if we were to match
|
|
0:19:41
|
150.28.0.0 in a standard ACL,
|
|
0:19:45
|
it wouldn't be able to tell the difference between the /20 and the /24 or a /16.
|
|
0:19:54
|
You'll also see that certain applications simply won't work
|
|
0:19:57
|
if you use and access list versus a prefix list.
|
|
0:20:01
|
And I believe this is one of them, when you're matching the route source.
|
|
0:20:06
|
I'm pretty sure you have to use the prefix list that has the /32.
|
|
0:20:10
|
You could try it out with the ACL and see if it works.
|
|
0:20:13
|
But design wise, there's really no reason why you would not use the prefix list.
|
|
0:20:18
|
The only case where you wouldn't is if the exam question says, "Don't use a prefix list."
|
|
0:20:23
|
But again, we'll see some work around later with that
|
|
0:20:26
|
using the extended access list in place of the prefix list.
|
|
0:20:37
|
So, documentation wise for this,
|
|
0:20:41
|
if we go under the...
|
|
0:20:45
|
configuration guide,
|
|
0:20:48
|
and I wanna say this is under...
|
|
0:20:53
|
configuring the basic BGP network..
|
|
0:20:56
|
So, again, you don't need to memorize where these different
|
|
0:20:59
|
configurations are located.
|
|
0:21:01
|
Just open up the differrent sections of the configuration guide
|
|
0:21:04
|
and use the find in page function of the browser.
|
|
0:21:08
|
So, you won't be able to search the documentation through the actual search engine,
|
|
0:21:13
|
but you can do a search on the individual webpage.
|
|
0:21:17
|
So, if I do control F and say Inject,
|
|
0:21:20
|
it's configuring a basic BGP network conditional route injection.
|