1 00:00:00,150 --> 00:00:02,610 How well do you know the Cisco iOS? 2 00:00:03,390 --> 00:00:06,990 Hopefully in this video, I'm going to teach you some commands that you don't know. 3 00:00:19,220 --> 00:00:19,910 In this video. 4 00:00:19,910 --> 00:00:23,040 I'm going to show you some tips and tricks with regards to the Cisco iOS. 5 00:00:23,060 --> 00:00:26,870 Hopefully this will make you a better Cisco network engineer. 6 00:00:27,260 --> 00:00:34,730 A lot of these commands are available in the configurations fundamentals Configuration Guide Cisco have 7 00:00:34,730 --> 00:00:41,870 multiple examples of this guide that show you, for instance, the basics like context sensitive help 8 00:00:42,050 --> 00:00:44,750 Sealy editing shortcuts and features. 9 00:00:45,350 --> 00:00:47,450 But I'm going to show you some more advanced stuff. 10 00:00:47,750 --> 00:00:54,620 Please comment below this video and let me know at which point in the video you learn something. 11 00:00:54,620 --> 00:00:58,970 So let's see how far you can get through this video without learning something new. 12 00:00:59,480 --> 00:01:01,670 I'm running a genius three topology here. 13 00:01:01,670 --> 00:01:03,680 There are two routers and the switch. 14 00:01:03,920 --> 00:01:13,940 These are traditional Cisco routers as in they run traditional classic Cisco iOS show version shows 15 00:01:13,940 --> 00:01:20,090 me that the version of operating system that this router is using is 15.6 to TI. 16 00:01:20,450 --> 00:01:25,160 So classic traditional Cisco iOS. 17 00:01:25,190 --> 00:01:30,710 Nothing spectacular or exceptional about the Cisco iOS. 18 00:01:30,710 --> 00:01:35,030 These are Cisco viral images that I'm running within SE three. 19 00:01:35,930 --> 00:01:36,170 Okay. 20 00:01:36,230 --> 00:01:38,420 So let's start with something straight away. 21 00:01:38,420 --> 00:01:40,130 Show question mark. 22 00:01:40,130 --> 00:01:48,560 Now show here shows me a whole bunch of commands and I can scroll and scroll and scroll, but notice 23 00:01:48,680 --> 00:01:53,150 show question mark, I see more as an option. 24 00:01:53,270 --> 00:01:55,880 So I've simply typed show question mark. 25 00:01:57,140 --> 00:02:02,090 When more is displayed, I can use multiple options like forward slash. 26 00:02:02,390 --> 00:02:06,830 This allows me to filter, for instance for a keyword such as class. 27 00:02:07,340 --> 00:02:08,870 So that's what I've typed. 28 00:02:09,940 --> 00:02:11,500 iOS is faltering. 29 00:02:11,740 --> 00:02:16,570 The output of this show command to class map more is displayed. 30 00:02:16,570 --> 00:02:24,130 Once again, I can use forward slash and for instance search for rad as in radius. 31 00:02:24,880 --> 00:02:29,770 So all I did was type show question mark and notice the output is being filtered. 32 00:02:31,160 --> 00:02:32,330 Ford slash again. 33 00:02:32,810 --> 00:02:33,740 VPN. 34 00:02:34,750 --> 00:02:38,350 Output is filtered to web a VPN. 35 00:02:38,800 --> 00:02:42,490 Now you can use this with many commands such as show run. 36 00:02:43,260 --> 00:02:49,650 So an on top show run most displayed forward slash type something such as face. 37 00:02:50,100 --> 00:02:59,670 The output is faulted until face is found as in interface loopback 100 Moore's displayed forward slash. 38 00:02:59,820 --> 00:03:02,490 Let's look for something such as network. 39 00:03:03,280 --> 00:03:07,600 This is filtering the output until the first network statement. 40 00:03:07,840 --> 00:03:13,600 Now I've purposely used a sub command here rather than something such as router. 41 00:03:14,530 --> 00:03:17,440 So as an example, I could filter for t y. 42 00:03:17,950 --> 00:03:24,670 Now some people have said when I've shown them this previously that you can just type sho run pipe section 43 00:03:24,670 --> 00:03:29,860 and let's say router slash v t y as an example. 44 00:03:29,860 --> 00:03:35,080 And that will show you the router configuration and the VTI configuration. 45 00:03:35,080 --> 00:03:36,070 And that's true. 46 00:03:36,730 --> 00:03:39,390 I'm not trying to tell you which command is better than another. 47 00:03:39,400 --> 00:03:41,680 I'm trying to show you different options. 48 00:03:42,340 --> 00:03:50,350 This shows me the router sections as in router IP, router BGP, router OSPF. 49 00:03:50,350 --> 00:03:52,710 And here I've got v y. 50 00:03:52,720 --> 00:04:01,760 But notice when I type show run I could as an example filter the config for one keyword such as face. 51 00:04:01,780 --> 00:04:04,210 So that's like a section of configuration. 52 00:04:04,210 --> 00:04:11,380 But then I could filter for a different keyword, which could be a sub command such as 0.0. 53 00:04:11,860 --> 00:04:13,840 So that's filtering. 54 00:04:14,530 --> 00:04:17,170 To that, which is actually a regular expression. 55 00:04:17,500 --> 00:04:22,580 So let's do forward slash again and say zero backslash dot zero. 56 00:04:22,600 --> 00:04:27,730 So this is a regular expression saying Escape the special meaning of a dot. 57 00:04:27,910 --> 00:04:29,680 A dot is any single character. 58 00:04:29,680 --> 00:04:31,240 So that matched there. 59 00:04:31,270 --> 00:04:37,690 But I'm going to actually look for 0.0 and that's filtered down to here. 60 00:04:37,690 --> 00:04:39,370 So it's not a section of code. 61 00:04:39,370 --> 00:04:40,960 It's a sub command. 62 00:04:41,650 --> 00:04:43,500 And then I could filter for something else. 63 00:04:43,510 --> 00:04:44,680 Let's say log. 64 00:04:46,330 --> 00:04:50,440 This is showing me the configuration from a certain point. 65 00:04:51,110 --> 00:04:52,970 In this example banner login. 66 00:04:53,720 --> 00:05:00,530 But what you might have noticed is I've used, I think, four different search criteria in one show 67 00:05:00,530 --> 00:05:01,220 command. 68 00:05:01,370 --> 00:05:07,910 So I'm looking at output and I'm doing multiple searches on that output. 69 00:05:08,390 --> 00:05:11,300 The closest that you can get is perhaps begin. 70 00:05:11,300 --> 00:05:17,150 So show run, pipe begin and let's say log in. 71 00:05:17,240 --> 00:05:23,030 That will show me the running configuration from the word logging as in banner logging. 72 00:05:23,960 --> 00:05:26,510 But that's all it's going to give me. 73 00:05:26,930 --> 00:05:34,000 But note, I have more here so I could do a search for VTI or some other kind of keyword. 74 00:05:34,010 --> 00:05:37,940 It's not showing anything here because VTI was already displayed in. 75 00:05:37,940 --> 00:05:40,130 There's no VTI the remaining config. 76 00:05:40,250 --> 00:05:47,990 But what I could do is type show run, pipe, begin, face something further up in the configuration 77 00:05:47,990 --> 00:05:51,890 as an interface and then I could search for router. 78 00:05:52,620 --> 00:05:54,150 And then search for something else. 79 00:05:54,180 --> 00:05:54,360 V. 80 00:05:54,360 --> 00:05:54,510 T. 81 00:05:54,510 --> 00:05:55,050 Y. 82 00:05:55,500 --> 00:05:58,560 So the forward slash command is fantastic. 83 00:05:58,560 --> 00:06:00,540 It doesn't just work with showrun run. 84 00:06:00,540 --> 00:06:04,370 It basically works with any command where you've got more displayed. 85 00:06:04,380 --> 00:06:09,090 So here I typed show IP route Moore's displayed. 86 00:06:09,420 --> 00:06:14,310 So what I can do is use Ford slash and let's search for 172. 87 00:06:15,020 --> 00:06:20,870 The show IP rot output is filtered to 172 and then I could filter for something else. 88 00:06:20,870 --> 00:06:26,120 Let's say 192.168. 105. 89 00:06:26,810 --> 00:06:31,700 Output is filtered to that point in the IP route command. 90 00:06:32,970 --> 00:06:34,990 So Ford's really useful. 91 00:06:35,010 --> 00:06:36,840 Another one that you could use. 92 00:06:37,350 --> 00:06:38,240 No, please. 93 00:06:38,250 --> 00:06:40,740 I'm going to just do show question mark here. 94 00:06:42,210 --> 00:06:45,810 Now I'm going to use plus and let's. 95 00:06:46,930 --> 00:06:48,670 Search for Roku. 96 00:06:49,360 --> 00:06:56,440 This is filtering all that output to only show me show commands with Oro. 97 00:06:56,440 --> 00:06:58,000 You in them. 98 00:06:58,330 --> 00:07:03,190 Now you might say, Well, David, this is kind of pointless, but don't restrict your imagination. 99 00:07:03,280 --> 00:07:09,700 Look at what this command can do and then play around with different options and see what works for 100 00:07:09,700 --> 00:07:10,060 you. 101 00:07:10,090 --> 00:07:18,790 The moral of the story is with a command showing more you could either use forward slash or you could 102 00:07:18,790 --> 00:07:19,720 use plus. 103 00:07:20,140 --> 00:07:28,330 And another option is minus where I don't want to see certain commands, so I want to remove everything, 104 00:07:28,360 --> 00:07:29,980 let's say with ORU unit. 105 00:07:30,010 --> 00:07:31,300 Now that's not a great example. 106 00:07:31,300 --> 00:07:35,200 So let's do that with a routing command like show IP route. 107 00:07:35,500 --> 00:07:37,090 So show IP route. 108 00:07:37,810 --> 00:07:41,020 I don't want to see let's say 192 routes. 109 00:07:41,140 --> 00:07:45,250 The routing table here has been filtered to remove 192. 110 00:07:45,760 --> 00:07:48,760 And let me just show you the whole routing table to make the point. 111 00:07:48,760 --> 00:07:52,480 Show IP route, no filtering. 112 00:07:52,510 --> 00:07:53,650 We've got two routes. 113 00:07:53,650 --> 00:07:54,550 We've got ten routes. 114 00:07:54,550 --> 00:07:56,050 We've got 172 routes. 115 00:07:56,050 --> 00:07:59,260 We've got 192 routes in the routing table here. 116 00:07:59,680 --> 00:08:03,490 But if I type show IP route, I could say minus. 117 00:08:03,490 --> 00:08:04,960 Don't show me 172. 118 00:08:04,990 --> 00:08:06,580 Don't show me 192. 119 00:08:06,820 --> 00:08:10,750 I don't want to see those routes in the output of this command. 120 00:08:11,800 --> 00:08:19,750 Again, you could type show IP route pipe include well, let's do exclude, which is similar to minus 121 00:08:19,750 --> 00:08:22,210 one 72192. 122 00:08:22,330 --> 00:08:26,260 You could do it that way and that will show you equivalent output. 123 00:08:26,650 --> 00:08:32,860 In this method you are doing the command before showing the output in the other method. 124 00:08:33,190 --> 00:08:38,559 I'm typing a command when I see more, then I'm deciding what to exclude. 125 00:08:38,890 --> 00:08:42,309 And I can do that multiple times with a backslash. 126 00:08:42,340 --> 00:08:48,730 But I can't do that with a minus or plus, but with a backslash I could filter multiple times. 127 00:08:49,480 --> 00:08:49,620 Okay. 128 00:08:49,720 --> 00:08:52,780 So show run pipe. 129 00:08:54,420 --> 00:09:01,980 Begin is similar to forge slash include is similar to plus exclude is similar to minus. 130 00:09:02,430 --> 00:09:02,670 Okay. 131 00:09:02,670 --> 00:09:06,690 So that's some basic commands plus minus forward slash. 132 00:09:07,680 --> 00:09:10,830 You once again can do that with any commands. 133 00:09:10,830 --> 00:09:21,150 So I'll show you one more example and then wrap it up here in BGP, I can use question mark, BGP question 134 00:09:21,150 --> 00:09:22,680 mark gives me options. 135 00:09:23,160 --> 00:09:27,300 I could see BGP, question mark plus max. 136 00:09:27,750 --> 00:09:29,700 This only shows me. 137 00:09:31,040 --> 00:09:33,290 Commands with the max keyword in them. 138 00:09:34,130 --> 00:09:35,540 I filtered the output. 139 00:09:36,380 --> 00:09:43,970 And again wherever you are and you use question mark and I shouldn't be using show they let me just 140 00:09:43,970 --> 00:09:49,030 use question mark in global config mode with no options. 141 00:09:49,040 --> 00:09:53,720 Wherever you are here you can use forward slash plus minus. 142 00:09:54,050 --> 00:10:01,880 So arrow you as an example here shows me all commands in global config mode that have zero you in them 143 00:10:02,060 --> 00:10:07,850 either as the command or as the description of the command. 144 00:10:08,270 --> 00:10:13,460 So if you can just slightly remember what a command should give you, but you can't remember the exact 145 00:10:13,460 --> 00:10:16,280 command you can filter that way if you want to. 146 00:10:17,240 --> 00:10:19,070 Okay, but let's step it up a notch. 147 00:10:19,070 --> 00:10:23,930 Let's enable Linux commands directly on the Cisco iOS. 148 00:10:24,690 --> 00:10:30,150 Now I've discussed this command shell processing full in this video. 149 00:10:30,600 --> 00:10:33,930 If you want to see more details, have a look at this playlist. 150 00:10:34,410 --> 00:10:41,190 You can either enable this globally or you can just enable it on the current terminal. 151 00:10:41,520 --> 00:10:47,940 But what this allows me to do is it allows me to use Linux commands such as CAT. 152 00:10:48,770 --> 00:10:52,760 So show shell functions shows me options. 153 00:10:53,360 --> 00:10:56,000 GREP is a great one, which I'm going to show you right now. 154 00:10:56,000 --> 00:10:58,820 We've also got Interface, which I'll show you in a moment. 155 00:10:59,090 --> 00:11:02,690 You've also got NLL, which numbers any line in the output. 156 00:11:03,140 --> 00:11:09,170 Basically, there's a whole bunch of things we can do now that you can't typically do with Cisco, iOS, 157 00:11:09,170 --> 00:11:10,790 so include exclude. 158 00:11:10,790 --> 00:11:12,800 Commands like that are very limited here. 159 00:11:12,800 --> 00:11:15,950 We can do nested grips, all kinds of interesting things. 160 00:11:15,950 --> 00:11:21,770 So as an example, show IP Interface Brief gives me a list of interfaces on this router. 161 00:11:21,860 --> 00:11:27,020 So there's the command again, show IP interface, brief bunch of output on the router. 162 00:11:27,080 --> 00:11:28,400 So I'll just do that again. 163 00:11:28,880 --> 00:11:30,260 There's the command. 164 00:11:31,010 --> 00:11:32,660 Yeah, all the interfaces. 165 00:11:32,930 --> 00:11:38,180 But what I could do now is say grep and only show me interfaces that are up. 166 00:11:38,510 --> 00:11:40,550 So all those interfaces are up. 167 00:11:41,030 --> 00:11:44,960 This command shows me all up interfaces. 168 00:11:45,230 --> 00:11:51,830 Scrolling up to the previous command show IP interface brief shows me interfaces, but also shows me 169 00:11:51,830 --> 00:11:53,300 interfaces that are down. 170 00:11:53,300 --> 00:11:55,400 So these interfaces are currently done. 171 00:11:57,110 --> 00:11:58,610 But I can do. 172 00:11:58,610 --> 00:12:04,010 Nested groups now remove loop backs from that output. 173 00:12:04,490 --> 00:12:09,620 So show me all interfaces that are up, but remove loopback interfaces. 174 00:12:10,230 --> 00:12:13,740 Now, you could perhaps just do it this way. 175 00:12:14,130 --> 00:12:20,160 Show me all interfaces except loopback interfaces, but notice those interfaces are administratively 176 00:12:20,160 --> 00:12:20,760 down. 177 00:12:21,600 --> 00:12:23,180 Again, use your imagination. 178 00:12:23,190 --> 00:12:25,770 This is a positive match. 179 00:12:26,280 --> 00:12:27,600 This is an exclusion. 180 00:12:27,600 --> 00:12:31,500 So we basically doing an include and then an exclude. 181 00:12:32,100 --> 00:12:36,510 But let me show you some more commands that I haven't discussed in other videos. 182 00:12:36,780 --> 00:12:38,370 How about this? 183 00:12:38,460 --> 00:12:47,340 Show me the running configuration, but begin with 0/0. 184 00:12:47,850 --> 00:12:52,890 This is similar to begin, but I'm going to make it more complex in a moment. 185 00:12:53,280 --> 00:12:54,000 But. 186 00:12:54,910 --> 00:12:59,710 And let me push that to more because this is like Linux, so you can use more to show one page at a 187 00:12:59,710 --> 00:13:00,250 time. 188 00:13:00,670 --> 00:13:08,290 So that command that I run there shows the running configuration from this point, but it's showing 189 00:13:08,290 --> 00:13:11,140 the entire running configuration and it went by very quickly. 190 00:13:11,230 --> 00:13:16,420 If I push it to more, it's going to show me one page at a time. 191 00:13:16,420 --> 00:13:22,450 So there's the command showing one page of output at a time. 192 00:13:23,110 --> 00:13:25,900 But you could say, Well, I could just do that with Begin. 193 00:13:26,170 --> 00:13:28,060 Okay, but how about this? 194 00:13:28,390 --> 00:13:34,980 Show me the running configuration beginning at this point, but ending at router. 195 00:13:35,050 --> 00:13:42,640 So in other words, scrolling up, we're going to start at this point, but only show me until this 196 00:13:42,640 --> 00:13:45,340 point when we see routers stop the output. 197 00:13:46,270 --> 00:13:52,360 Okay, so let's try that show run pipe grep, begin zero zero grep you router. 198 00:13:53,290 --> 00:14:02,380 There's the output interface gigabit zero zero and notice it ended at the point specified ended at router. 199 00:14:02,530 --> 00:14:06,970 Now again, if you don't want it to scroll past, if you've got a lot of output, you can use more. 200 00:14:07,000 --> 00:14:15,370 So we're doing double grep sheer and pushing it to more to only show certain parts of the configuration. 201 00:14:15,670 --> 00:14:19,870 But you could say, David, I could just use section like section interface. 202 00:14:21,370 --> 00:14:24,360 But notice the difference with section interface. 203 00:14:24,370 --> 00:14:31,110 I am seeing loopback interfaces and then I'm seeing my gigabit interfaces. 204 00:14:31,120 --> 00:14:36,100 What I'm doing with grep here is I'm deciding which section of code I want to see. 205 00:14:36,990 --> 00:14:39,330 Could be a small piece of code, could be a long piece of code. 206 00:14:39,330 --> 00:14:41,610 And I'm not restricted by what I can search on. 207 00:14:41,790 --> 00:14:46,380 I could, for instance, search on a exclamation. 208 00:14:46,380 --> 00:14:50,850 So show me the output from zero zero until exclamation. 209 00:14:52,260 --> 00:14:54,360 Basically search on anything you want. 210 00:14:55,690 --> 00:14:55,900 Okay. 211 00:14:55,950 --> 00:14:56,570 So there you go. 212 00:14:56,580 --> 00:14:57,270 That did it. 213 00:14:57,300 --> 00:14:58,650 Didn't do it previously. 214 00:14:58,680 --> 00:15:06,270 Notice it started at gigabit 200, ended at exclamation y because when you do show run. 215 00:15:07,080 --> 00:15:08,760 And I'll use my Ford slush again. 216 00:15:08,790 --> 00:15:10,100 I like Ford slush. 217 00:15:12,300 --> 00:15:17,460 I showed the config from this point until this point. 218 00:15:18,060 --> 00:15:23,910 You basically have the power here to do what you want, search for whichever output you want. 219 00:15:23,910 --> 00:15:27,770 So let's do it from grep tool. 220 00:15:28,170 --> 00:15:28,950 Log in. 221 00:15:29,400 --> 00:15:34,380 I want to see all the output from zero zero until log in. 222 00:15:34,380 --> 00:15:37,110 So all the output from zero zero. 223 00:15:37,530 --> 00:15:41,400 So 0/0 interface gigabit zero zero until log in. 224 00:15:41,700 --> 00:15:48,240 So I see my interfaces, I see rotor and when I see log in it ends. 225 00:15:48,240 --> 00:15:50,250 So actually I should have done control plane there. 226 00:15:50,250 --> 00:15:55,890 So let's do plane because I don't want to get the banner. 227 00:15:56,850 --> 00:16:02,210 So show me all the configuration from 0/0 until plane. 228 00:16:02,220 --> 00:16:04,810 So there's interface gigabit to zero zero. 229 00:16:04,830 --> 00:16:08,430 Scrolling all the way down until plane. 230 00:16:08,430 --> 00:16:12,690 The plane control plane command is typically shown here in the output. 231 00:16:12,690 --> 00:16:14,220 But I've I don't want to see that. 232 00:16:14,220 --> 00:16:16,050 I just want to see up until that point. 233 00:16:17,310 --> 00:16:17,520 Okay. 234 00:16:17,520 --> 00:16:19,140 But grep is even more powerful. 235 00:16:19,140 --> 00:16:20,600 How about this? 236 00:16:20,610 --> 00:16:31,140 Typically commands or case sensitive, but I could say I so face I'm going to put in uppercase notice 237 00:16:31,140 --> 00:16:31,620 please. 238 00:16:31,620 --> 00:16:37,170 That face here is lowercase but I'm going to say ignore case. 239 00:16:37,170 --> 00:16:43,770 When you use section or include or one of those commands, it's case sensitive. 240 00:16:44,070 --> 00:16:47,880 So commands such as show run pipe include exclude or k sensitive. 241 00:16:47,880 --> 00:16:49,140 But yeah, I've told it. 242 00:16:49,140 --> 00:16:54,210 Show me the running configuration from face face being uppercase or lowercase. 243 00:16:54,210 --> 00:16:56,550 Don't k until plane. 244 00:16:56,550 --> 00:17:03,900 So I'm seeing all my loopback interfaces and then I'm seeing gigabit interfaces up to plane. 245 00:17:04,319 --> 00:17:12,150 Now if you're not sure about options notice man which is a linux command for manual grep shows me options 246 00:17:12,150 --> 00:17:21,240 so there's b match everything in a file after a pattern dash II or hyphen I ignore case you match everything 247 00:17:21,240 --> 00:17:24,540 until a certain pattern of V is invert. 248 00:17:24,540 --> 00:17:32,310 So typically when you do show run pipe include, you have to match the case here. 249 00:17:33,860 --> 00:17:36,620 But with grip you don't have to. 250 00:17:36,650 --> 00:17:38,640 So show run pipe include face. 251 00:17:38,660 --> 00:17:41,300 This matches all lines with the word face in it. 252 00:17:41,570 --> 00:17:43,250 I could say grep. 253 00:17:45,180 --> 00:17:46,020 I. 254 00:17:46,050 --> 00:17:49,650 And then my face can be any case I want. 255 00:17:49,720 --> 00:17:51,330 Doesn't matter what the case is. 256 00:17:51,350 --> 00:17:51,800 Yeah. 257 00:17:51,810 --> 00:17:53,880 That wouldn't work with include. 258 00:17:54,210 --> 00:17:55,920 So output is the same. 259 00:17:57,210 --> 00:17:59,370 But let's say I want to exclude my loop backs. 260 00:17:59,370 --> 00:18:02,130 So let's use a negative grep. 261 00:18:02,130 --> 00:18:07,920 So V says exclude loopback interfaces. 262 00:18:07,920 --> 00:18:10,830 So I'll use dash v loop. 263 00:18:10,980 --> 00:18:16,650 So show me the ethernet interfaces but exclude the loopback interfaces and there you go. 264 00:18:16,650 --> 00:18:21,540 I'm only seeing gigabit interfaces, so that's a really powerful option. 265 00:18:21,810 --> 00:18:26,340 Now, this video is unfortunately getting quite long, so I'm going to have to put the more advanced 266 00:18:26,340 --> 00:18:30,930 stuff that I wanted to show you in a separate video, but hopefully you found this useful again. 267 00:18:30,930 --> 00:18:33,840 Please comment below and let me know what you've learnt. 268 00:18:34,720 --> 00:18:36,640 At what time STEM did you actually learn something? 269 00:18:36,640 --> 00:18:37,960 Which commands did you learn? 270 00:18:38,860 --> 00:18:42,580 And as always, please, would you subscribe to my YouTube channel? 271 00:18:42,610 --> 00:18:45,340 Please, would you like this video if you found it useful? 272 00:18:45,460 --> 00:18:50,960 Please click on the bell to get notifications when I post a new video, we bought this.