1 00:00:00,000 --> 00:00:02,400 [AUDIO LOGO] 2 00:00:02,400 --> 00:00:08,170 3 00:00:08,170 --> 00:00:11,740 So now what we're going to do is jump into the command line 4 00:00:11,740 --> 00:00:15,070 and actually implement some route maps. 5 00:00:15,070 --> 00:00:17,800 What we're going to be focusing on in this video 6 00:00:17,800 --> 00:00:23,320 is implementing route maps with OSPF and IS-IS. 7 00:00:23,320 --> 00:00:25,240 Now, the important thing to keep in mind 8 00:00:25,240 --> 00:00:27,580 as we're going into this is we're 9 00:00:27,580 --> 00:00:31,000 going to be applying the route maps with the distribute list 10 00:00:31,000 --> 00:00:32,170 command. 11 00:00:32,170 --> 00:00:35,920 With the distribute list command, all that supported 12 00:00:35,920 --> 00:00:39,100 is filtering with a route map. 13 00:00:39,100 --> 00:00:42,970 So if we tried to do something like setting the next hop, 14 00:00:42,970 --> 00:00:46,240 or setting the metric, again, the route map 15 00:00:46,240 --> 00:00:47,530 will let us do that. 16 00:00:47,530 --> 00:00:50,260 There's no logic check to tell us, hey, 17 00:00:50,260 --> 00:00:52,940 you can't do that in this application. 18 00:00:52,940 --> 00:00:55,720 But when we go look at our routing table, what 19 00:00:55,720 --> 00:00:58,370 we would find is that the metrics were not changed, 20 00:00:58,370 --> 00:01:00,860 or the next hops were not changed. 21 00:01:00,860 --> 00:01:05,230 We can't manipulate the routes with the distribute list 22 00:01:05,230 --> 00:01:06,500 command. 23 00:01:06,500 --> 00:01:10,240 Now, we do have a way to do that in BGP, 24 00:01:10,240 --> 00:01:12,730 manipulate the routes with a route map 25 00:01:12,730 --> 00:01:15,380 before they get to the routing table. 26 00:01:15,380 --> 00:01:17,470 And not to give away all the secrets, 27 00:01:17,470 --> 00:01:20,230 but it's something called a table map. 28 00:01:20,230 --> 00:01:22,480 The reason I'm bringing this up now, 29 00:01:22,480 --> 00:01:25,480 it doesn't really apply to this course, 30 00:01:25,480 --> 00:01:29,710 but just for your knowledge on other Cisco platforms, 31 00:01:29,710 --> 00:01:35,590 specifically on NX-OS on the Nexus series of switches. 32 00:01:35,590 --> 00:01:40,720 They actually have a table map for OSPF. 33 00:01:40,720 --> 00:01:44,410 Now, that's not on our platforms yet. 34 00:01:44,410 --> 00:01:47,500 But again, we know things change over time, 35 00:01:47,500 --> 00:01:50,230 and they may just bring that feature here. 36 00:01:50,230 --> 00:01:54,880 A table map does allow you to manipulate the routes 37 00:01:54,880 --> 00:01:57,410 as they're put into the routing table. 38 00:01:57,410 --> 00:02:01,870 So just be aware that that's out there and it exists. 39 00:02:01,870 --> 00:02:04,180 In our case, we're just going to be doing 40 00:02:04,180 --> 00:02:06,460 filtering with route-maps. 41 00:02:06,460 --> 00:02:09,592 So as usual, let's bring up our topology, 42 00:02:09,592 --> 00:02:11,800 take a look at what's going on, and where we're going 43 00:02:11,800 --> 00:02:13,060 to be doing our filtering. 44 00:02:13,060 --> 00:02:14,920 And then we'll jump into the command line 45 00:02:14,920 --> 00:02:20,967 and see those route maps doing filtering in our environment. 46 00:02:20,967 --> 00:02:22,550 So for this demonstration, we're going 47 00:02:22,550 --> 00:02:26,300 to be using IGP Topology I, where we 48 00:02:26,300 --> 00:02:28,100 have two separate environments. 49 00:02:28,100 --> 00:02:32,930 We have an OSPF domain, and we have an IS-IS domain. 50 00:02:32,930 --> 00:02:35,510 There is no redistribution currently going on 51 00:02:35,510 --> 00:02:38,790 between these two IGP domains. 52 00:02:38,790 --> 00:02:42,050 So it's essentially acting as two completely separate 53 00:02:42,050 --> 00:02:43,340 environments. 54 00:02:43,340 --> 00:02:46,250 What we're going to be focusing on in this video 55 00:02:46,250 --> 00:02:49,130 is we're going to start on router 9 56 00:02:49,130 --> 00:02:51,080 and we're going to look at some of the routes 57 00:02:51,080 --> 00:02:54,305 that it's learning from the rest of the OSPF environment. 58 00:02:54,305 --> 00:02:56,430 It doesn't really matter where they're coming from, 59 00:02:56,430 --> 00:02:58,730 but most of them are, in fact, coming from router 10 60 00:02:58,730 --> 00:03:00,363 and coming through the environment. 61 00:03:00,363 --> 00:03:02,030 But we'll be looking at different things 62 00:03:02,030 --> 00:03:03,350 we can filter on. 63 00:03:03,350 --> 00:03:06,080 We're not really going to be focusing on prefix lists 64 00:03:06,080 --> 00:03:10,130 or ACLs because we have done those in other skills. 65 00:03:10,130 --> 00:03:13,310 We'll do some filtering based on some other attributes. 66 00:03:13,310 --> 00:03:18,290 Then in the IS-IS domain, we're going to focus on router 7 67 00:03:18,290 --> 00:03:21,350 here and do some filtering on routes 68 00:03:21,350 --> 00:03:24,530 coming from both the router 8 side 69 00:03:24,530 --> 00:03:27,410 as well as the router 3 side. 70 00:03:27,410 --> 00:03:29,480 So we'll be taking a look at both 71 00:03:29,480 --> 00:03:32,430 of those in the IS-IS domain. 72 00:03:32,430 --> 00:03:36,650 Now, keep in mind, in the IS-IS domain, when we have these two 73 00:03:36,650 --> 00:03:40,250 areas, area 10 and area 20, that this 74 00:03:40,250 --> 00:03:45,020 is going to be a level 2 connection between router 7 75 00:03:45,020 --> 00:03:46,940 and router 3. 76 00:03:46,940 --> 00:03:50,960 So router 7 should be getting a combination of level 1 77 00:03:50,960 --> 00:03:52,700 and level 2 prefixes. 78 00:03:52,700 --> 00:03:55,440 And we'll do some filtering based on that as well. 79 00:03:55,440 --> 00:03:58,650 So let's go ahead and jump into the command line. 80 00:03:58,650 --> 00:04:01,340 We'll start on router 9, as we said. 81 00:04:01,340 --> 00:04:03,735 And we'll just start off by looking at the OSPF routing 82 00:04:03,735 --> 00:04:04,235 table. 83 00:04:04,235 --> 00:04:09,500 84 00:04:09,500 --> 00:04:11,890 So in our routing table here, we have 85 00:04:11,890 --> 00:04:13,120 quite a few different routes. 86 00:04:13,120 --> 00:04:16,120 We have some O routes, some O IA routes, 87 00:04:16,120 --> 00:04:19,880 some external type 2s that are coming from router 10. 88 00:04:19,880 --> 00:04:23,950 So let's go ahead and start doing some filtering here. 89 00:04:23,950 --> 00:04:28,780 To begin with, let's filter out the external type 2s. 90 00:04:28,780 --> 00:04:32,090 We have two prefixes here that fall into that category, 91 00:04:32,090 --> 00:04:39,720 the 10.10.10.10 and the 100.1.1.0/24. 92 00:04:39,720 --> 00:04:43,980 But our goal here is to not filter on the prefixes, 93 00:04:43,980 --> 00:04:48,270 but rather to filter on the fact that they're external type 2s. 94 00:04:48,270 --> 00:04:51,900 So let's go ahead and do that with a route map. 95 00:04:51,900 --> 00:04:54,370 So we'll go into configuration mode. 96 00:04:54,370 --> 00:04:59,370 We'll do a route map, let's just call it RM_OSPF_FILTER. 97 00:04:59,370 --> 00:05:02,340 We'll start off with a deny statement of 10, 98 00:05:02,340 --> 00:05:06,510 since what we're trying to do is filter out some routes. 99 00:05:06,510 --> 00:05:11,710 For our match, we're going to match on the route type. 100 00:05:11,710 --> 00:05:13,630 Let's take a look at some of our choices here. 101 00:05:13,630 --> 00:05:15,820 We could do, of course, external. 102 00:05:15,820 --> 00:05:17,050 We could do internal. 103 00:05:17,050 --> 00:05:18,550 This would include things like if we 104 00:05:18,550 --> 00:05:23,380 wanted to filter the Os for the intra area routes versus the O 105 00:05:23,380 --> 00:05:26,200 IA for the inter area routes. 106 00:05:26,200 --> 00:05:29,320 If this was IS-IS, which of course, we'll 107 00:05:29,320 --> 00:05:31,690 be seeing in a moment, we could filter here 108 00:05:31,690 --> 00:05:33,940 on level 1 versus level 2. 109 00:05:33,940 --> 00:05:36,220 We can filter locally generated. 110 00:05:36,220 --> 00:05:39,440 We can filter nsaa-externals, which are, 111 00:05:39,440 --> 00:05:43,330 of course, your OSPF type 7 LSAs. 112 00:05:43,330 --> 00:05:46,240 But when they say OSPF type 1 or 2, 113 00:05:46,240 --> 00:05:50,620 they mean type 1 external or type 2 external. 114 00:05:50,620 --> 00:05:55,240 So in this case, it would actually mean n1 or n2. 115 00:05:55,240 --> 00:05:58,900 Now, again, in our case, we're going for those external type 116 00:05:58,900 --> 00:05:59,950 2s. 117 00:05:59,950 --> 00:06:03,430 So if we say external, we see we then have that choice 118 00:06:03,430 --> 00:06:05,800 to say type 1 or type 2. 119 00:06:05,800 --> 00:06:09,430 We could also hit Enter, in which case, it would do both. 120 00:06:09,430 --> 00:06:13,980 But we'll go ahead and specify and we'll say type 2. 121 00:06:13,980 --> 00:06:16,620 Now, don't forget, when we're trying to filter out 122 00:06:16,620 --> 00:06:19,110 routes just based on a specific attribute, 123 00:06:19,110 --> 00:06:22,260 such as external type 2, don't forget 124 00:06:22,260 --> 00:06:25,980 that just like access lists and prefix lists, 125 00:06:25,980 --> 00:06:31,260 route maps do have an implicit deny all at the end, 126 00:06:31,260 --> 00:06:33,600 unless we do something about that. 127 00:06:33,600 --> 00:06:36,720 Since we're using this route map specifically 128 00:06:36,720 --> 00:06:42,420 for filtering, what I usually do is put a permit statement 129 00:06:42,420 --> 00:06:46,210 way high as far as statement numbers. 130 00:06:46,210 --> 00:06:49,740 So for example here, I'm going to put in a permit statement 131 00:06:49,740 --> 00:06:52,170 with a permit 1,000. 132 00:06:52,170 --> 00:06:54,870 Because we may come back and add other things 133 00:06:54,870 --> 00:06:57,660 to this route map, which in fact, in just a moment, 134 00:06:57,660 --> 00:06:59,290 we're going to do just that. 135 00:06:59,290 --> 00:07:01,380 And when we add to it, we don't want 136 00:07:01,380 --> 00:07:06,160 to have to continuously be taking that permit at the end 137 00:07:06,160 --> 00:07:08,910 and pushing it out further and further and further. 138 00:07:08,910 --> 00:07:11,970 If we start with it at a very high number, 139 00:07:11,970 --> 00:07:14,130 then we can add to this route map 140 00:07:14,130 --> 00:07:17,370 and deny more things over time without having 141 00:07:17,370 --> 00:07:20,260 to redo that permit every time. 142 00:07:20,260 --> 00:07:23,730 So let's go ahead and put in that very, very high permit 143 00:07:23,730 --> 00:07:25,360 statement. 144 00:07:25,360 --> 00:07:31,470 So what we're going to do is say route-map RM_OSPF_FILTER, 145 00:07:31,470 --> 00:07:33,720 and then just say, like, permit 1,000. 146 00:07:33,720 --> 00:07:35,880 You can go higher with this number, if you like, 147 00:07:35,880 --> 00:07:37,810 whatever you want to do. 148 00:07:37,810 --> 00:07:40,543 But then we don't put any match statement. 149 00:07:40,543 --> 00:07:42,210 Remember, if there's no match statement, 150 00:07:42,210 --> 00:07:44,140 it matches everything. 151 00:07:44,140 --> 00:07:47,680 So this is just going to permit everything else at the end. 152 00:07:47,680 --> 00:07:50,730 Next, we'll go into router OSPF 1. 153 00:07:50,730 --> 00:07:53,400 We'll apply this with the distribute list. 154 00:07:53,400 --> 00:07:56,790 We have to specify that we're using a route map. 155 00:07:56,790 --> 00:08:00,480 Then we put in the route-map name, and a direction, 156 00:08:00,480 --> 00:08:04,710 just like we did with our ACLs and our prefix lists. 157 00:08:04,710 --> 00:08:07,360 Then we can exit configuration. 158 00:08:07,360 --> 00:08:10,810 And if we do our show IP route OSPF, again, 159 00:08:10,810 --> 00:08:15,570 we see here that we no longer have any external type 2s. 160 00:08:15,570 --> 00:08:19,390 So the route-map is filtering exactly as we want. 161 00:08:19,390 --> 00:08:22,570 So now let's modify our route map a little bit. 162 00:08:22,570 --> 00:08:26,130 If we look over these routes, we can see that 163 00:08:26,130 --> 00:08:27,630 for all the different metrics. 164 00:08:27,630 --> 00:08:32,010 We have a variety of different metrics here, 2, 4, 5, and so 165 00:08:32,010 --> 00:08:32,830 on. 166 00:08:32,830 --> 00:08:39,787 Let's filter out any routes that have a metric between 4 and 6. 167 00:08:39,787 --> 00:08:41,370 Now, that's certainly going to get rid 168 00:08:41,370 --> 00:08:43,500 of a lot of these routes, but that's OK. 169 00:08:43,500 --> 00:08:45,610 This is just for demonstration. 170 00:08:45,610 --> 00:08:48,390 So let's go back into configuration mode. 171 00:08:48,390 --> 00:08:51,150 And we'll change our route-map, and we'll 172 00:08:51,150 --> 00:08:52,560 add another deny statement. 173 00:08:52,560 --> 00:08:54,960 We'll just make this one 20. 174 00:08:54,960 --> 00:08:58,960 For our match statement, we're going to match the metric. 175 00:08:58,960 --> 00:09:01,390 And if we hit the question mark here, 176 00:09:01,390 --> 00:09:03,900 notice we can either specify a given 177 00:09:03,900 --> 00:09:08,100 metric or we can say external for an external protocol 178 00:09:08,100 --> 00:09:09,190 metric. 179 00:09:09,190 --> 00:09:12,000 Well, we already sort of know what our metric is going to be, 180 00:09:12,000 --> 00:09:14,520 but we said we wanted to use a range. 181 00:09:14,520 --> 00:09:19,120 Well, the way the range works is you put in a middle number. 182 00:09:19,120 --> 00:09:22,800 So since we said our range was going to be 4 through 6, 183 00:09:22,800 --> 00:09:25,500 what we're going to do is put in a 5. 184 00:09:25,500 --> 00:09:30,460 Then, after this, you can put in a deviation. 185 00:09:30,460 --> 00:09:35,200 So we can then say plus or and how much to match on. 186 00:09:35,200 --> 00:09:37,770 So we'll say plus or minus 1. 187 00:09:37,770 --> 00:09:41,320 This way, it'll match from 4 through 6. 188 00:09:41,320 --> 00:09:44,100 So because of the way we wrote our permit statement, 189 00:09:44,100 --> 00:09:48,540 being way up at 1,000, we don't need to modify that in any way 190 00:09:48,540 --> 00:09:50,490 when we add this new statement. 191 00:09:50,490 --> 00:09:54,010 However, I am going to jump in there real quick 192 00:09:54,010 --> 00:09:56,580 and we're just going to put in a set statement. 193 00:09:56,580 --> 00:09:59,670 The only reason I'm doing it is just to show you 194 00:09:59,670 --> 00:10:02,550 that when we're using the distribute list option here, 195 00:10:02,550 --> 00:10:05,800 the set statements won't actually do anything. 196 00:10:05,800 --> 00:10:08,280 So let's go ahead and configure something in there 197 00:10:08,280 --> 00:10:10,620 just again to show that it doesn't actually 198 00:10:10,620 --> 00:10:14,180 function with the distribute list command. 199 00:10:14,180 --> 00:10:17,030 So we'll go back into our permit statement. 200 00:10:17,030 --> 00:10:21,970 And let's just say to set the metric to 100. 201 00:10:21,970 --> 00:10:24,470 We'll exit out of configuration. 202 00:10:24,470 --> 00:10:28,660 And if we do our show IP route OSPF, notice that anything 203 00:10:28,660 --> 00:10:32,050 with a metric over 3, so 4 through 6, 204 00:10:32,050 --> 00:10:34,120 we didn't have anything higher than 6, 205 00:10:34,120 --> 00:10:39,850 but anything with a metric higher than 3 is now gone. 206 00:10:39,850 --> 00:10:42,190 Also notice that none of the metrics 207 00:10:42,190 --> 00:10:44,350 are hundreds, which is what we told 208 00:10:44,350 --> 00:10:46,010 the route map to set it to. 209 00:10:46,010 --> 00:10:47,890 So we can see that setting the metric 210 00:10:47,890 --> 00:10:50,630 didn't do anything in this case. 211 00:10:50,630 --> 00:10:53,800 So now that we've seen how this works with OSPF, 212 00:10:53,800 --> 00:10:58,930 let's hop over to router 7 and see how this works with IS-IS. 213 00:10:58,930 --> 00:11:01,520 It's, of course, going to be very similar, 214 00:11:01,520 --> 00:11:05,660 but we're going to be matching on some different things. 215 00:11:05,660 --> 00:11:09,400 So again, let's start with our show IP route for IS-IS. 216 00:11:09,400 --> 00:11:13,150 And what we see is we have a nice combination of level 1 217 00:11:13,150 --> 00:11:15,740 and level 2 routes as we expected. 218 00:11:15,740 --> 00:11:18,070 So let's just start off with something simple. 219 00:11:18,070 --> 00:11:21,070 Let's just get rid of all the level 1 prefixes. 220 00:11:21,070 --> 00:11:23,950 This is, again, probably not something we would normally do, 221 00:11:23,950 --> 00:11:25,840 but it's just a lab and we're just trying 222 00:11:25,840 --> 00:11:27,770 to see how our route maps work. 223 00:11:27,770 --> 00:11:30,380 So let's go into configuration mode. 224 00:11:30,380 --> 00:11:35,230 We'll write our route-map we'll call this RM_ISIS_FILTER. 225 00:11:35,230 --> 00:11:38,380 Once again, we'll do a deny for 10. 226 00:11:38,380 --> 00:11:42,040 And we're going to say to match route-type. 227 00:11:42,040 --> 00:11:44,080 And we saw these choices earlier, 228 00:11:44,080 --> 00:11:48,580 but this time, we're going to be choosing level 1. 229 00:11:48,580 --> 00:11:50,530 So we'll go ahead and hit Enter. 230 00:11:50,530 --> 00:11:55,480 Just like before, we'll put in our permit of 1,000. 231 00:11:55,480 --> 00:11:58,000 We'll go into our routing process, 232 00:11:58,000 --> 00:12:01,790 we say distribute-list, route-map, put in the name. 233 00:12:01,790 --> 00:12:04,090 And again, this is going to be inbound. 234 00:12:04,090 --> 00:12:06,880 We'll do our show IP route IS-IS. 235 00:12:06,880 --> 00:12:09,430 And notice that the only things that are left 236 00:12:09,430 --> 00:12:11,900 are the level 2 prefixes. 237 00:12:11,900 --> 00:12:14,800 So as we can see, we've lost a lot of routes here. 238 00:12:14,800 --> 00:12:16,420 This was very destructive. 239 00:12:16,420 --> 00:12:18,400 However, for the sake of the lab, 240 00:12:18,400 --> 00:12:21,940 we can see that our route map is working exactly as we want. 241 00:12:21,940 --> 00:12:24,550 And just like we did with OSPF, we 242 00:12:24,550 --> 00:12:28,390 could very easily get rid of prefixes based on their metric 243 00:12:28,390 --> 00:12:29,420 as well. 244 00:12:29,420 --> 00:12:31,930 So maybe for example we want to get rid of anything 245 00:12:31,930 --> 00:12:33,730 with a metric from-- 246 00:12:33,730 --> 00:12:37,960 let's this time use, say, 30 through 50. 247 00:12:37,960 --> 00:12:40,780 So we'll go back into configuration mode, 248 00:12:40,780 --> 00:12:43,000 back into our route map. 249 00:12:43,000 --> 00:12:45,430 We'll add our deny 20. 250 00:12:45,430 --> 00:12:48,490 And of course, this time, we're going to match on the metric. 251 00:12:48,490 --> 00:12:51,190 And we're going to do this the same way we did OSPF. 252 00:12:51,190 --> 00:12:55,750 To get that range of 30 through 50, what we're going to say 253 00:12:55,750 --> 00:12:59,860 is 40 plus or minus 10. 254 00:12:59,860 --> 00:13:03,340 We'll exit configuration mode, look at our routing table 255 00:13:03,340 --> 00:13:04,490 again. 256 00:13:04,490 --> 00:13:06,580 And as we see, we have hardly any routes 257 00:13:06,580 --> 00:13:10,160 left now that we've filtered this all out. 258 00:13:10,160 --> 00:13:13,480 So we can see that our route-maps are working exactly 259 00:13:13,480 --> 00:13:16,610 as we expect, although with the examples we did, 260 00:13:16,610 --> 00:13:21,070 it has wiped out almost our entire routing table. 261 00:13:21,070 --> 00:13:25,060 So in this video, we looked at how to use route-maps, 262 00:13:25,060 --> 00:13:31,150 both with OSPF and IS-IS, in order to filter routes out 263 00:13:31,150 --> 00:13:34,220 of the routing table using the distribute-list command. 264 00:13:34,220 --> 00:13:37,060 Now keep in mind that, again, with 265 00:13:37,060 --> 00:13:39,760 the distribute-list command, we can't actually 266 00:13:39,760 --> 00:13:41,590 manipulate the routes. 267 00:13:41,590 --> 00:13:44,500 We can put set statements in our route maps. 268 00:13:44,500 --> 00:13:46,760 There's nothing stopping us from doing that. 269 00:13:46,760 --> 00:13:49,180 But they don't actually function. 270 00:13:49,180 --> 00:13:52,120 And we saw that by putting in a setting 271 00:13:52,120 --> 00:13:54,400 of the metric on router 9. 272 00:13:54,400 --> 00:13:56,950 And we saw that it just simply ignored it. 273 00:13:56,950 --> 00:13:58,940 It didn't change anything. 274 00:13:58,940 --> 00:14:02,590 So keep in mind, we can do this for a route filtering. 275 00:14:02,590 --> 00:14:04,700 And the big advantage, of course, 276 00:14:04,700 --> 00:14:08,170 is we can use this for more complex scenarios. 277 00:14:08,170 --> 00:14:10,720 In this case, we matched on things 278 00:14:10,720 --> 00:14:15,530 that you can't match in an ACL or a prefix list. 279 00:14:15,530 --> 00:14:19,820 So this can be very helpful in that type of a situation. 280 00:14:19,820 --> 00:14:21,910 I hope this has been informative for you. 281 00:14:21,910 --> 00:14:24,990 And I'd like to thank you for viewing. 282 00:14:24,990 --> 00:14:29,000