1 00:00:01,170 --> 00:00:07,020 You know, I've been in this industry for a long time and over the years you learn many tips and tricks. 2 00:00:07,230 --> 00:00:14,010 But there's a much quicker way of learning a bunch of stuff than just many years of experience. 3 00:00:14,220 --> 00:00:20,610 And the way to do that is to find someone who knows something or has learned something and can teach 4 00:00:20,610 --> 00:00:20,890 you. 5 00:00:20,910 --> 00:00:22,590 So, in other words, find mentors. 6 00:00:22,740 --> 00:00:29,070 Now I'm going to be creating a series of videos where I want to help you become a better network engineer. 7 00:00:29,100 --> 00:00:35,370 Don't spend 15 years like I have having to learn all these tips and tricks the hard way. 8 00:00:35,760 --> 00:00:37,720 Just learn from these videos. 9 00:00:37,740 --> 00:00:42,570 So hopefully the tips and tricks that I'm going to show you in this video and subsequent videos will 10 00:00:42,570 --> 00:00:45,600 make you the so called ten x network engineer. 11 00:00:45,720 --> 00:00:49,770 In other words, you'll become a network engineer that's set apart from others. 12 00:00:50,010 --> 00:00:56,310 You're going to learn some commands in this video that I wish I had known many years ago. 13 00:00:56,730 --> 00:01:00,660 Use these commands to set you apart from others in the industry. 14 00:01:00,660 --> 00:01:06,060 When you go for an interview, or when you have a senior network engineer or someone else watching what 15 00:01:06,060 --> 00:01:06,730 you're doing. 16 00:01:06,750 --> 00:01:10,200 Use these commands and amaze them with what you can do. 17 00:01:10,950 --> 00:01:16,980 In this video, I'm going to show you how you can leverage a Linux commands on classic Cisco iOS. 18 00:01:17,010 --> 00:01:19,800 Now, I'm not talking about dropping into a Linux shell. 19 00:01:19,830 --> 00:01:27,000 I'm not talking about enabling a Linux VM or Linux shell separately from the Cisco iOS. 20 00:01:27,030 --> 00:01:30,960 These commands run directly within Cisco iOS. 21 00:01:31,290 --> 00:01:33,310 This is classic Cisco iOS. 22 00:01:33,330 --> 00:01:37,590 In other words, the iOS that's been running on network devices for many, many years. 23 00:01:38,280 --> 00:01:40,590 I've tested this on multiple devices. 24 00:01:40,590 --> 00:01:46,050 I'm going to use Genius three in this example, but I'll also show you that these commands work on older 25 00:01:46,050 --> 00:01:48,140 devices, like 1900 routers. 26 00:01:48,150 --> 00:01:55,620 So use these commands to get ahead to show others that, you know, stuff that many others in the industry 27 00:01:55,620 --> 00:01:56,370 don't know. 28 00:01:56,850 --> 00:01:59,520 Hopefully you'll enjoy this video. 29 00:01:59,550 --> 00:02:03,600 If you do, please like it and please consider subscribing to my YouTube channel. 30 00:02:03,600 --> 00:02:05,100 That really does help me. 31 00:02:05,340 --> 00:02:05,940 Okay. 32 00:02:05,940 --> 00:02:10,229 You ready to learn some really cool Cisco iOS commands? 33 00:02:10,500 --> 00:02:16,080 Let me show you what's possible and show you how you can set yourself apart from others in the industry. 34 00:02:17,070 --> 00:02:17,850 Glasses on. 35 00:02:17,850 --> 00:02:19,170 Because I'm old. 36 00:02:28,810 --> 00:02:29,080 Okay. 37 00:02:29,080 --> 00:02:31,540 So here I've got a Cisco. 38 00:02:32,520 --> 00:02:38,490 iOS router running in genius three show version shows me that this is via iOS. 39 00:02:38,520 --> 00:02:41,820 Here's the version of operating system on this writer. 40 00:02:42,120 --> 00:02:44,940 Now, some of you may already know some of these commands. 41 00:02:45,420 --> 00:02:51,720 As an example, show IP interface brief shows me interfaces on this router. 42 00:02:51,720 --> 00:02:58,740 But notice, yeah, I have got many, many loopback interfaces, so I've got my physical interfaces. 43 00:02:59,130 --> 00:03:02,790 So gigabit is 00010203. 44 00:03:02,790 --> 00:03:06,390 But notice a whole bunch of loopback interfaces. 45 00:03:07,140 --> 00:03:10,020 Now there are plenty of these I'm going to use forward slash. 46 00:03:10,020 --> 00:03:14,700 Now that command is available in Linux, you'll find it in VI as an example. 47 00:03:14,790 --> 00:03:18,240 So here's a Linux device, you name. 48 00:03:20,220 --> 00:03:20,940 Dutchie. 49 00:03:20,970 --> 00:03:22,510 Notice I'm running linux here. 50 00:03:22,530 --> 00:03:24,900 This is an ubuntu linux pc. 51 00:03:25,050 --> 00:03:26,520 It's actually a docker container. 52 00:03:26,520 --> 00:03:27,730 Running in June is three. 53 00:03:27,750 --> 00:03:30,360 But what I'll do here is start vi. 54 00:03:30,480 --> 00:03:35,310 And I've got a file here which is actually a show run of a switch configuration. 55 00:03:35,370 --> 00:03:40,350 Notice when I use forward slash, I can filter as an example for face. 56 00:03:41,200 --> 00:03:48,310 I can filter again for line and that just scrolls through the configuration to that point. 57 00:03:49,420 --> 00:03:50,870 I'll put out a vie here. 58 00:03:50,890 --> 00:03:57,460 So this forward slash allows me to falter as an example for one i.t. 59 00:03:57,550 --> 00:04:01,370 It's going to take the show ip interface, brief command and filter it. 60 00:04:01,390 --> 00:04:04,020 Notice filtering up to that point. 61 00:04:04,030 --> 00:04:05,800 Notice loopback 192. 62 00:04:05,890 --> 00:04:13,060 I'll filter again because what I'm actually looking for is this a loopback 300 interface starting with 63 00:04:13,060 --> 00:04:19,660 192168 100.1 as the IP addresses and there's a whole bunch of these. 64 00:04:19,959 --> 00:04:29,110 I'll filter again for let's say uhn as in tunnel and notice it filters all the way down to tunnel. 65 00:04:29,590 --> 00:04:35,830 Now I have shown this forward slash command in other videos, but that's not what I want to show you 66 00:04:35,830 --> 00:04:36,310 here. 67 00:04:36,340 --> 00:04:38,320 I'm going to show you a really cool command. 68 00:04:38,350 --> 00:04:44,530 Notice I'm going to go into global configuration mode and type shell processing full. 69 00:04:45,770 --> 00:04:48,440 So I've enabled full shell processing. 70 00:04:48,440 --> 00:04:50,210 That's the only command that you need. 71 00:04:50,840 --> 00:04:52,540 And notice what I can do now. 72 00:04:52,550 --> 00:04:59,060 So rather than doing it that way, like show IP interface brief and then having to filter through the 73 00:04:59,060 --> 00:05:05,990 configuration looking for interfaces, I'm going to tap show IP interface, brief and notice what I'm 74 00:05:05,990 --> 00:05:06,800 going to use here. 75 00:05:06,830 --> 00:05:12,860 GREP grep is a Linux command that allows me to filter or search for stuff. 76 00:05:13,220 --> 00:05:19,070 Now, some of you may already know include I could include, let's say one, IE two, and that shows 77 00:05:19,070 --> 00:05:25,400 me all lines that include 192, but that includes statement is quite limiting. 78 00:05:25,400 --> 00:05:26,810 I can only do one include. 79 00:05:26,810 --> 00:05:30,550 I can only search for one thing, but notice what I can do here. 80 00:05:30,560 --> 00:05:33,590 I can do a grep for let's say up. 81 00:05:34,100 --> 00:05:36,620 So I'm looking for all interfaces that are up. 82 00:05:36,800 --> 00:05:40,700 Now that's a bit boring because it's just going to show me every interface that's up. 83 00:05:41,000 --> 00:05:51,920 But what I'm going to do now is do pipe grep and let's not show interfaces that include 172 and let's 84 00:05:51,920 --> 00:05:55,130 also not show 192. 85 00:05:55,190 --> 00:05:57,470 This is a three tier grep. 86 00:05:57,620 --> 00:06:03,680 I'm doing a search for something and then I'm excluding something and I'm excluding something else. 87 00:06:03,680 --> 00:06:06,980 So I'm doing a three type include as an example. 88 00:06:06,980 --> 00:06:09,620 You can't do that with a standard include commands. 89 00:06:10,070 --> 00:06:14,450 Notice this shows me interfaces that have up in the list. 90 00:06:14,780 --> 00:06:21,550 So these interfaces are up, but I'm not seeing 172 and 192. 91 00:06:21,560 --> 00:06:29,840 I've just filtered a whole range of interfaces and all I'm seeing are the gigabit interfaces and then 92 00:06:29,840 --> 00:06:36,830 these tunnel interfaces and I've got two loopback interfaces here in the ten 100 range. 93 00:06:37,500 --> 00:06:38,580 So that's really powerful. 94 00:06:38,580 --> 00:06:40,890 I could do another one here, so let's remove those. 95 00:06:40,890 --> 00:06:47,480 So let's say grep minus V and I could just do it this way where I could say remove loop. 96 00:06:47,490 --> 00:06:52,460 I don't want to loop and notice that just shows me gigabit interfaces and tunnel interfaces. 97 00:06:52,470 --> 00:06:56,760 Now some of you may say, well, you could just do that once and that's true. 98 00:06:56,880 --> 00:06:59,700 Just play around with the commands and see what works for you. 99 00:06:59,730 --> 00:07:05,070 So I could just do grep up, grep hyphen v loop. 100 00:07:05,070 --> 00:07:09,840 So show me interfaces that have up in them, but don't show me loopback interfaces. 101 00:07:09,840 --> 00:07:13,290 So that's a positive and negative grep of output. 102 00:07:13,650 --> 00:07:16,950 You try and do that with just include commands. 103 00:07:17,040 --> 00:07:21,570 Now you may be able to do some of that, but let's show you an example and a switch that may really 104 00:07:21,570 --> 00:07:24,480 help you show IP interface brief. 105 00:07:24,510 --> 00:07:27,060 This will show me interfaces on the switch. 106 00:07:28,210 --> 00:07:30,010 I can see gigabit interfaces. 107 00:07:31,180 --> 00:07:33,760 I can see vlan interfaces. 108 00:07:34,620 --> 00:07:37,110 Some of the interfaces are up, some of them are down. 109 00:07:37,440 --> 00:07:45,210 But what I could do is say, show me interfaces that are up, but don't show me interfaces that don't 110 00:07:45,210 --> 00:07:47,240 have an IP address assigned on them. 111 00:07:47,250 --> 00:07:52,980 That can be really useful if you've got a large configuration and you only want to see interfaces that 112 00:07:52,980 --> 00:07:55,380 have an IP address on them and that are up. 113 00:07:56,670 --> 00:07:56,940 Okay. 114 00:07:56,940 --> 00:07:59,760 So how about show run grep? 115 00:08:00,660 --> 00:08:02,520 1.1. 116 00:08:02,910 --> 00:08:05,560 Now that dot is actually a regular expression. 117 00:08:05,580 --> 00:08:08,550 Notice we've got a matching character there. 118 00:08:08,580 --> 00:08:12,630 We've got a matching character here, here and here. 119 00:08:12,990 --> 00:08:17,880 What I could do, however, is say grep again for, let's say ten. 120 00:08:18,150 --> 00:08:21,920 So show me everything that has 1.1. 121 00:08:21,930 --> 00:08:29,340 In other words, one something, one in it, but filter that to only show me a lines that have ten in 122 00:08:29,340 --> 00:08:29,700 it. 123 00:08:29,700 --> 00:08:31,110 So something like this. 124 00:08:31,350 --> 00:08:37,289 Now you might say, well, I could have just done include ten as an example, and that's true. 125 00:08:37,289 --> 00:08:41,260 But don't use these examples to limit what you're thinking. 126 00:08:41,280 --> 00:08:45,060 Use these examples just to show you what's possible and then think out of the box. 127 00:08:45,060 --> 00:08:51,120 How can you use this to try different things and see if you can think of ideas of how you can use these 128 00:08:51,120 --> 00:08:53,160 commands and add them below this video? 129 00:08:53,160 --> 00:08:55,740 Tell me examples that you've found useful. 130 00:08:56,250 --> 00:09:01,650 Now notice I can do an include, but I can't do an exclude here. 131 00:09:02,040 --> 00:09:05,100 So with grep I can do that. 132 00:09:05,100 --> 00:09:07,680 So the include exclude option is kind of limiting. 133 00:09:07,680 --> 00:09:10,740 But with grep I could say show me that. 134 00:09:10,770 --> 00:09:18,120 But let's do hyphen V or dash v, let's exclude gig. 135 00:09:18,880 --> 00:09:19,930 And. 136 00:09:21,040 --> 00:09:23,680 That's probably because I didn't use grep there. 137 00:09:24,100 --> 00:09:31,630 So grep dash v gig notice, same kind of result as I had over there. 138 00:09:31,840 --> 00:09:34,300 This is a double include. 139 00:09:35,160 --> 00:09:36,630 If you like, or double grip. 140 00:09:36,630 --> 00:09:38,670 Show me something that matches twice. 141 00:09:38,850 --> 00:09:45,270 You have got show me a matching line, but don't show me this line that matches. 142 00:09:45,270 --> 00:09:47,220 So we've got to include exclude. 143 00:09:48,150 --> 00:09:52,590 You can't do that with the traditional show run pipe include show, run, pipe, exclude. 144 00:09:52,620 --> 00:09:55,320 Here I'm doing include exclude at the same time. 145 00:09:55,830 --> 00:09:58,620 Okay, so let's look at some other Linux commands. 146 00:09:58,650 --> 00:10:00,930 Here's my Linux PC once again. 147 00:10:00,930 --> 00:10:13,020 So you name A shows me that I'm using Linux hyphen hyphen help gives me help options with this command. 148 00:10:13,410 --> 00:10:18,370 But on a Cisco device as an example I can type you name dash. 149 00:10:18,660 --> 00:10:22,920 This shows me that I'm using iOS V as an example. 150 00:10:23,460 --> 00:10:25,290 Now just like in Linux I can use man. 151 00:10:25,290 --> 00:10:26,400 So look at the manuals. 152 00:10:26,400 --> 00:10:29,130 So give me details of you name. 153 00:10:30,350 --> 00:10:33,200 Notice lots of options available with your name. 154 00:10:33,470 --> 00:10:39,110 So you name dash a shows me all the information about this router. 155 00:10:39,260 --> 00:10:47,060 Se just gives me the version, sets eos v dn gives me the name of the router. 156 00:10:47,820 --> 00:10:49,380 But let's try r. 157 00:10:49,410 --> 00:10:51,720 That's the version of operating system. 158 00:10:51,720 --> 00:10:54,310 So if you just want to get the version of operating system, there you go. 159 00:10:54,330 --> 00:10:59,910 That could be useful in a script as an example or V gives me details of the version. 160 00:11:00,830 --> 00:11:03,110 Very similar to the output over here with. 161 00:11:04,880 --> 00:11:07,100 Now again, Linux does something very similar. 162 00:11:07,110 --> 00:11:10,770 I could say you name A gives me all the output. 163 00:11:10,790 --> 00:11:13,340 SW tells me that this is Linux. 164 00:11:14,180 --> 00:11:18,140 This Shell option has many commands. 165 00:11:18,500 --> 00:11:21,120 Now you may be wondering what commands are supported. 166 00:11:21,140 --> 00:11:22,700 I don't want to make this video too long. 167 00:11:22,700 --> 00:11:25,220 I'll show you some more complex stuff in a separate video. 168 00:11:25,220 --> 00:11:31,640 But if you want to start investigating what options are available, we have this show Shell Functions 169 00:11:31,640 --> 00:11:35,720 Command that will show us which functions are supported by this command. 170 00:11:35,720 --> 00:11:37,790 So notice a very basic one. 171 00:11:37,800 --> 00:11:45,260 Cat we've got cut, we've got echo, we've got grep, which I've been showing you at the moment. 172 00:11:45,260 --> 00:11:48,830 So search for regular expressions in piped output or files. 173 00:11:49,190 --> 00:11:50,480 We've got head. 174 00:11:51,550 --> 00:11:52,410 More. 175 00:11:53,110 --> 00:11:56,350 Plenty of Linux commands available here. 176 00:11:56,650 --> 00:11:58,450 So let's use head and tail. 177 00:11:58,450 --> 00:12:03,610 So show run head will show me the first ten lines of the running configuration. 178 00:12:05,120 --> 00:12:05,990 So there you go. 179 00:12:06,020 --> 00:12:11,450 So first few lines of the running configuration, I could also say tail, which will show me the last 180 00:12:11,450 --> 00:12:14,000 few lines of the running configuration. 181 00:12:14,240 --> 00:12:16,100 That's very basic stuff. 182 00:12:16,930 --> 00:12:19,280 Cat allows me to read a file. 183 00:12:19,310 --> 00:12:24,590 So if I type r notice there's some files and flash. 184 00:12:25,380 --> 00:12:26,850 Let's do this show run. 185 00:12:27,300 --> 00:12:30,340 And this is a this is very much a Linux command. 186 00:12:30,360 --> 00:12:34,950 I'm going to pipe the show running configuration to show run dot cfg. 187 00:12:35,400 --> 00:12:42,840 So I'm going to tap show run pipe that configuration or push that configuration to the to a file in 188 00:12:42,840 --> 00:12:43,440 flash. 189 00:12:43,650 --> 00:12:47,490 So DA shows me that that file exists in Flash. 190 00:12:47,640 --> 00:12:51,930 And what I can do here is type more, show run, see cfg. 191 00:12:52,380 --> 00:12:57,150 And notice there's the file that I'm reading from Flash. 192 00:12:57,790 --> 00:12:59,770 But how about this? 193 00:13:00,220 --> 00:13:03,700 Let's do a show IP route. 194 00:13:05,970 --> 00:13:12,240 And actually let's push that to show ip route txt. 195 00:13:13,040 --> 00:13:18,800 So that file once again exists in the flesh of the router. 196 00:13:19,250 --> 00:13:20,780 So what I'll do here is use cat. 197 00:13:20,780 --> 00:13:23,720 So cat ip route text. 198 00:13:24,750 --> 00:13:27,600 Cat just shows you the whole file in one go. 199 00:13:28,930 --> 00:13:30,640 Notice there are a lot of routes. 200 00:13:31,500 --> 00:13:32,070 Here. 201 00:13:32,190 --> 00:13:36,090 So I'm may have preferred to use more. 202 00:13:36,180 --> 00:13:36,690 More? 203 00:13:36,690 --> 00:13:40,350 Shows me one line at a time rather than just show me the whole output in one go. 204 00:13:40,860 --> 00:13:43,290 So while we're waiting for that, let's go back into Linux. 205 00:13:43,620 --> 00:13:44,970 So clear. 206 00:13:46,260 --> 00:13:48,150 Liz shows me the file here. 207 00:13:48,180 --> 00:13:49,260 Catch show run. 208 00:13:49,260 --> 00:13:51,980 Now shows me the running configuration in one go. 209 00:13:51,990 --> 00:13:52,890 So that was a bit quick. 210 00:13:52,890 --> 00:13:56,400 So notice catch show run whole configuration in one go. 211 00:13:56,490 --> 00:13:58,350 I could do more. 212 00:13:59,540 --> 00:14:04,850 Notice that shows me one page of configuration at a time. 213 00:14:06,210 --> 00:14:07,200 Same here. 214 00:14:07,470 --> 00:14:11,880 Rather than using cat, I may prefer to use more. 215 00:14:13,840 --> 00:14:16,060 So I'm reading that file from Flash. 216 00:14:16,570 --> 00:14:19,690 But what it allows me to do here is press Q to quit. 217 00:14:19,930 --> 00:14:25,300 So rather than seeing all that output, I can just see one page at a time and then quit. 218 00:14:26,110 --> 00:14:29,260 So I could go on for a long time here. 219 00:14:30,340 --> 00:14:37,630 Notice we are using classic EOS here and I was able to use these commands by just running the shell 220 00:14:37,630 --> 00:14:39,070 processing full command. 221 00:14:39,610 --> 00:14:45,820 Now in other videos, I'm going to show you even more powerful ways of leveraging this to make you stand 222 00:14:45,820 --> 00:14:49,400 out from the competition as a network engineer. 223 00:14:49,420 --> 00:14:55,690 So learn this stuff and hopefully it will save you a lot of time in the real world. 224 00:14:55,720 --> 00:15:00,550 It will help you become a better network engineer, and it will help you differentiate yourself from 225 00:15:00,550 --> 00:15:01,750 others in the industry. 226 00:15:02,260 --> 00:15:04,600 Now, hopefully this is going to change the way that you work. 227 00:15:04,630 --> 00:15:10,000 Hopefully it's going to separate you from others that you work with or others in interviews. 228 00:15:10,090 --> 00:15:14,770 Hopefully it will show people that you work with, that you're serious, and that you are an excellent 229 00:15:14,770 --> 00:15:15,760 network engineer. 230 00:15:15,970 --> 00:15:21,340 Once again, if you don't mind, please subscribe to my YouTube channel and please like this video. 231 00:15:21,370 --> 00:15:22,480 I'm David Bumble. 232 00:15:22,510 --> 00:15:24,250 I want to wish you all the very best.