1 00:00:02,339 --> 00:00:05,589 (modern digital music) 2 00:00:09,079 --> 00:00:10,953 - [Instructor] In the last video, when I introduced you 3 00:00:10,953 --> 00:00:12,946 to the concept of configuring OSPF 4 00:00:12,946 --> 00:00:15,178 and showed you most of the commands you would need, 5 00:00:15,178 --> 00:00:18,712 I verbally introduced the concept of OSPF Cost. 6 00:00:18,712 --> 00:00:21,192 I want to have a special video just dedicated to that 7 00:00:21,192 --> 00:00:23,094 because I think it's very important that 8 00:00:23,094 --> 00:00:24,968 for each routing protocol you learn about, 9 00:00:24,968 --> 00:00:28,457 that you're able to understand the metric type that's used 10 00:00:28,457 --> 00:00:30,529 by that protocol so you can compare 11 00:00:30,529 --> 00:00:32,601 and contrast them along the way. 12 00:00:32,601 --> 00:00:35,038 So hopefully by this point, you've learned about RIP 13 00:00:35,038 --> 00:00:39,205 and the routing metric for RIP is hop count. 14 00:00:40,198 --> 00:00:43,544 And you've learned about EIRGP and the routing metric 15 00:00:43,544 --> 00:00:47,990 for EIRGP is called distance. 16 00:00:47,990 --> 00:00:50,587 Now the routing metric that we're gonna deal with, OSPF, 17 00:00:50,587 --> 00:00:54,746 is called OSPF Cost. 18 00:00:54,746 --> 00:00:56,062 So like Spanning-Tree, 19 00:00:56,062 --> 00:00:57,778 if you've learned about Spanning-Tree, 20 00:00:57,778 --> 00:00:58,703 this should be easy. 21 00:00:58,703 --> 00:01:01,343 Because just like Spanning-Tree, cost is a value 22 00:01:01,343 --> 00:01:04,303 that's derived from the interface bandwidth. 23 00:01:04,303 --> 00:01:07,349 And just like Spanning-Tree, the greater the bandwidth, 24 00:01:07,349 --> 00:01:10,387 the faster the interface, the lower the cost. 25 00:01:10,387 --> 00:01:12,743 And just like in Spanning-Tree, if I have two paths 26 00:01:12,743 --> 00:01:16,910 to a particular place, the lower cost is the better path. 27 00:01:18,174 --> 00:01:22,614 Now, OSPF does not use the same formula as Spanning-Tree. 28 00:01:22,614 --> 00:01:24,732 So, you don't have to worry about that 29 00:01:24,732 --> 00:01:26,519 so that the numbers are not going to be the same. 30 00:01:26,519 --> 00:01:28,510 As an example, review question. 31 00:01:28,510 --> 00:01:30,969 In LAN switching with Spanning-Tree, 32 00:01:30,969 --> 00:01:33,086 what was the Spanning-Tree Cost 33 00:01:33,086 --> 00:01:35,687 of a fast ethernet interface, 34 00:01:35,687 --> 00:01:40,567 so a 100 megabit per second fast ethernet interface. 35 00:01:40,567 --> 00:01:43,166 Hopefully you answered the number 19. 36 00:01:43,166 --> 00:01:46,374 Fast ethernet is 19th in the world of Spanning-Tree. 37 00:01:46,374 --> 00:01:50,541 Well, in OSPF, the cost of a fast ethernet interface is one. 38 00:01:51,654 --> 00:01:53,487 So, different formula. 39 00:01:55,876 --> 00:01:59,815 And the cost of an OSPF interface will default 40 00:01:59,815 --> 00:02:02,290 to be whatever you know, derived from the bandwidth, 41 00:02:02,290 --> 00:02:04,323 but you can change that, you can explicitly configure 42 00:02:04,323 --> 00:02:08,101 the cost of an interface or if you modify 43 00:02:08,101 --> 00:02:10,660 the bandwidth of an interface, that implicitly 44 00:02:10,660 --> 00:02:12,531 changes the cost as well. 45 00:02:12,531 --> 00:02:14,397 So there are two ways that you can change it. 46 00:02:14,397 --> 00:02:15,819 You can go on to an interface and use 47 00:02:15,819 --> 00:02:19,799 the ip ospf cost command and then explicitly 48 00:02:19,799 --> 00:02:22,770 set the value to whatever you want, or like I said, 49 00:02:22,770 --> 00:02:26,937 by changing the bandwidth, that will also affect it. 50 00:02:28,049 --> 00:02:31,389 And you can use the command show ip ospf interface 51 00:02:32,433 --> 00:02:34,753 to actually see what the cost is of any given interface 52 00:02:34,753 --> 00:02:37,349 and certainly when you look at an ospf route 53 00:02:37,349 --> 00:02:39,870 in the routing table with the command show ip route, 54 00:02:39,870 --> 00:02:41,860 or show ip route ospf. 55 00:02:41,860 --> 00:02:44,621 You'll see what the total cumulative cost is 56 00:02:44,621 --> 00:02:46,977 to reach any given destination. 57 00:02:46,977 --> 00:02:49,572 So let's see an example of this. 58 00:02:49,572 --> 00:02:51,887 So on our whiteboard here, we can see that 59 00:02:51,887 --> 00:02:55,586 if we look from Switch-3's perspective, 60 00:02:55,586 --> 00:02:59,077 and we look at his way of getting to the 3.2.3 network, 61 00:02:59,077 --> 00:03:02,657 he actually has two equal cost paths. 62 00:03:02,657 --> 00:03:05,214 He can get to there via Switch-2, 63 00:03:05,214 --> 00:03:07,854 or you can get there via Router-3. 64 00:03:07,854 --> 00:03:09,559 So if we actually go into Switch-3, 65 00:03:09,559 --> 00:03:13,717 we take a look as routing table, that confirms that. 66 00:03:13,717 --> 00:03:15,380 We can see right here, 3.2.3.0 67 00:03:15,380 --> 00:03:17,871 and he's got two equal cost paths. 68 00:03:17,871 --> 00:03:20,188 They both have a cost of two. 69 00:03:20,188 --> 00:03:23,323 And that makes sense, because this is a fast ethernet link 70 00:03:23,323 --> 00:03:26,449 so that's a cost of one, and this is a fast ethernet link, 71 00:03:26,449 --> 00:03:28,437 so that gives us another cost of one. 72 00:03:28,437 --> 00:03:30,467 So one plus one is two going this way. 73 00:03:30,467 --> 00:03:33,272 One plus one is two going this way. 74 00:03:33,272 --> 00:03:38,070 So let me start by saying, okay, maybe I want Switch-3 75 00:03:38,070 --> 00:03:39,903 only to use this path. 76 00:03:41,834 --> 00:03:46,001 So what I'm gonna do, I'm gonna go on to Switch-2. 77 00:03:47,963 --> 00:03:50,322 I'm gonna go on to as fast ethernet, 0/3 interface 78 00:03:50,322 --> 00:03:52,739 and I'm gonna raise the cost. 79 00:03:54,090 --> 00:03:58,173 I'm gonna set the cost to five on that interface. 80 00:03:59,251 --> 00:04:01,891 So then, this path will not be as preferable. 81 00:04:01,891 --> 00:04:04,159 That will be a total cost of six. 82 00:04:04,159 --> 00:04:06,825 This will be a cost of two. 83 00:04:06,825 --> 00:04:09,060 And so Switch-3 will now only have one route 84 00:04:09,060 --> 00:04:10,607 in his routing table. 85 00:04:10,607 --> 00:04:14,061 So I'm gonna go to Switch-2, sorry, Switch-3 86 00:04:14,061 --> 00:04:15,987 will have a single route in his writing table 87 00:04:15,987 --> 00:04:17,470 going this way. 88 00:04:17,470 --> 00:04:18,649 So now I'm gonna go to Switch-2. 89 00:04:18,649 --> 00:04:20,849 I'm gonna go on a fast ethernet 0/3, 90 00:04:20,849 --> 00:04:24,766 I'm gonna officially increase the cost to five. 91 00:04:28,278 --> 00:04:32,252 Okay, so, #int fast 0/3, 92 00:04:32,252 --> 00:04:33,747 #ip ospf cost, 93 00:04:33,747 --> 00:04:35,192 actually, before I do it, 94 00:04:35,192 --> 00:04:39,109 #do show ip ospf interface fast 0/3. 95 00:04:41,889 --> 00:04:45,015 And you can see, by default, it's Cost: 1, 96 00:04:45,015 --> 00:04:46,727 'cause fast ethernet. 97 00:04:46,727 --> 00:04:49,644 Now I'm gonna type #ip ospf cost 5. 98 00:04:51,113 --> 00:04:55,280 And now when I take a look at the output of that command, 99 00:04:56,385 --> 00:04:59,517 now we can verify that the cost is five. 100 00:04:59,517 --> 00:05:01,996 So, at this point if I go back to Switch-3, 101 00:05:01,996 --> 00:05:05,650 he should now see a total cost of six going this way 102 00:05:05,650 --> 00:05:08,130 and a cost of two going this way. 103 00:05:08,130 --> 00:05:11,422 So only this path, the path via Router-3 104 00:05:11,422 --> 00:05:15,587 should now be the only path to get to the 3.2.3 network. 105 00:05:15,587 --> 00:05:18,420 (keyboard clicks) 106 00:05:22,705 --> 00:05:23,885 And that's what we see. 107 00:05:23,885 --> 00:05:27,885 Now there's only one path and it's via Router-3. 108 00:05:29,248 --> 00:05:30,915 Now, let's just change it one more time. 109 00:05:30,915 --> 00:05:33,349 So now what I want to do is I want to have 110 00:05:33,349 --> 00:05:36,720 Switch-3 prefer this path. 111 00:05:36,720 --> 00:05:38,831 I want this to be the better path. 112 00:05:38,831 --> 00:05:41,512 So what I'm gonna do, is I'm gonna go under Router-3's 113 00:05:41,512 --> 00:05:42,856 fast ethernet interface. 114 00:05:42,856 --> 00:05:46,834 I'm gonna take the bandwidth and I'm gonna lower it 115 00:05:46,834 --> 00:05:48,990 to some really small number. 116 00:05:48,990 --> 00:05:51,177 Make this interface look like it's incredibly slow 117 00:05:51,177 --> 00:05:53,574 by giving it a really low bandwidth. 118 00:05:53,574 --> 00:05:56,257 And by making the bandwidth number really small, 119 00:05:56,257 --> 00:05:59,665 that will make the cost really big. 120 00:05:59,665 --> 00:06:01,420 Because remember, the larger the cost, 121 00:06:01,420 --> 00:06:03,977 the less preferable it its. 122 00:06:03,977 --> 00:06:05,519 So let's go on the Router-3 now 123 00:06:05,519 --> 00:06:08,510 and change it's interface bandwidth. 124 00:06:08,510 --> 00:06:11,343 (keyboard clicks) 125 00:06:13,447 --> 00:06:15,674 Your fast paced ethernet 0/0, 126 00:06:15,674 --> 00:06:19,453 #do sho int fast 0/0 so we can see right now, 127 00:06:19,453 --> 00:06:23,620 it's current bandwidth is 100000 kbit/sec. 128 00:06:25,545 --> 00:06:27,859 So if you actually do the math, that's one hundred million 129 00:06:27,859 --> 00:06:29,000 bits per second. 130 00:06:29,000 --> 00:06:31,641 So now I'm gonna say, #bandwidth. 131 00:06:31,641 --> 00:06:35,808 How about we say, 2000 kilo bits per second, really slow. 132 00:06:37,737 --> 00:06:39,904 Only 2000 bits per second. 133 00:06:42,532 --> 00:06:46,699 So now if I type sho ip ospf int fast 0/0, 134 00:06:48,736 --> 00:06:51,069 look at his cost now, 50000. 135 00:06:52,324 --> 00:06:55,540 It was one before, and now it's 50000. 136 00:06:55,540 --> 00:06:57,449 So we can see how modifying the bandwidth 137 00:06:57,449 --> 00:07:00,005 clearly affects the OSPF Cost. 138 00:07:00,005 --> 00:07:03,088 And lastly, if I go over to Switch-3, 139 00:07:06,306 --> 00:07:09,960 now we can see that the 3.2.3 route has switched over. 140 00:07:09,960 --> 00:07:13,210 It's now pointing at Switch-2, 2.3.2.22 141 00:07:14,425 --> 00:07:16,941 as the next hop, because the cost of six 142 00:07:16,941 --> 00:07:20,695 is certainly better than the cost of 50000 and one. 143 00:07:20,695 --> 00:07:23,945 (modern digital music)