- You know, I've been in this industry for a long time
and over the years you learn many tips and tricks.
But there's a much quicker way of learning a bunch of stuff
than just many years of experience.
And the way to do that is to find someone
who knows something or has learned something
and can teach you.
So in other words, find mentors.
Now, I'm gonna be creating a series of videos
where I want to help you become
a better network engineer.
Don't spend 15 years like I have,
having to learn all these tips and tricks the hard way.
Just learn from these videos.
So hopefully the tips and tricks that I'm gonna show you
in this video and subsequent videos
will make you the so called Ten-X network engineer.
In other words, you'll become a network engineer
that's set apart from others.
You're gonna learn some commands in this video
that I wish I had known many years ago.
Use these commands to set you apart
from others in the industry.
When you go for an interview
or when you have a senior network engineer or someone else
watching what you're doing,
use these commands and amaze them with what you can do.
In this video I'm gonna show you
how you can leverage a Linux commands classic Cisco IOS.
Now, I'm not talking about dropping into Linux shell.
I'm not talking about enabling a Linux VM
or Linux shell separately from the Cisco IOS.
These commands run directly within Cisco IOS.
This is classic Cisco IOS.
In other words, the IOS that's been running
on network devices for many, many years.
I've tested this on multiple devices.
I'm gonna use GNS3 in this example,
but I'll also show you that
these commands work on older devices like 1900 routers.
So use these commands to get ahead
to show others that you know stuff
that many others in the industry don't know.
Hopefully you'll enjoy this video.
If you do, please like it
and please consider subscribing to my YouTube channel.
That really does help me.
Okay, you're ready to learn
some really cool Cisco IOS commands.
Let me show you what's possible
and show you how you can set yourself apart
from others in the industry.
Okay, glasses on because I'm old.
(upbeat electronic music)
Okay, so here I've got a Cisco IOS router running in GNS3.
"show version" shows me that this is VIOS.
Here's the version of operating system on this router.
Now some of you may already know some of these commands.
As an example, "sh ip int brief"
shows me interfaces on this router.
But notice here, I have got many many loopback interfaces.
So I've got my physical interfaces.
So gigabit 0/0, 0/1, 0/2, 0/3.
But notice here whole bunch of loopback interfaces.
Now there are plenty of these.
I'm gonna use forward slash now.
That command is available in Linux.
You'll find it in VI, as an example.
So here's a Linux device.
"Uname -a."
Notice I'm running Linux here.
This is an Ubuntu Linux PC.
It's actually a docker container running in GNS3.
But what I'll do here is start VI.
And I've got a file here, which is actually
a show run of a switch configuration.
Notice when I use forward slash,
I can filter as an example for face.
I can filter again for line
and that just scrolls through
the configuration to that point.
I'll put out a VI here.
So this forward slash allows me to filter,
as an example, for 192.
It's gonna take the show IP interface brief command
and filter it, notice filtering, up to that point.
Notice Loopback192.
I'll filter again because what I'm actually looking for
is this Loopback300 interface
starting with 192.168.100.1 as the IP addresses.
And there's a whole bunch of these.
I'll filter again for, let's say UN, as in tunnel.
And notice it filters all the way down to tunnel.
Now, I have shown this forward slash command in other videos
but that's not what I wanna show you here.
I'm gonna show you a really cool command.
Notice I'm gonna go into global configuration mode
and type "shell processing full".
So I've enabled full shell processing.
That's the only command that you need.
And notice what I can do now.
So rather than doing it that way,
like show IP interface brief,
and then having to filter through the configuration
looking for interfaces,
I'm gonna type "show ip int brief"
and notice what I'm gonna use here.
Grep.
Grep is a Linux command that allows me
to filter or search for stuff.
Now, some of you may already know include.
I could include, let's say 192.
And that shows me all the lines that include 192.
But that include statement is quite limiting.
I can only do one include.
I can only search for one thing.
But notice what I can do here.
I can do a grep for let's say up.
So I'm looking for all interfaces that are up.
Now, that's a bit boring because it's just
gonna show me every interface that's up.
But what I'm gonna do now is do "| grep"
and let's not show interfaces that include 172
and let's also not show 192.
This is a three-tiered grep.
I'm doing a search for something
and then I'm excluding something
and I'm excluding something else.
So I'm doing a three-type include as an example.
You can't do that with the standard include commands.
Notice this shows me interfaces that have up in the list.
So these interfaces are up
but I'm not seeing 172 and 192.
I've just filtered a whole range of interfaces
and all I'm seeing are the gigabit interfaces
and then these tunnel interfaces
and I've got two loopback interfaces here
in the 10.100 range.
So that's really powerful.
I could do another one here.
So let's remove those.
So let's say "grep -v" and I could just do it this way
where I could say remove loop.
I don't want loop.
And notice that just shows me gigabit interfaces
and tunnel interfaces.
Now some of you may say,
"Well you could just do that once."
And that's true.
Just play around with the commands
and see what works for you.
So I could just do grep up.
"Grep -v loop."
So show me interfaces that have up in them
but don't show me loopback interfaces.
So that's a positive and negative grep of output.
You try and do that with just include commands.
Now you may be able to do some of that
but let's show you an example on a switch
that may really help you.
"Show ip int brief."
This will show me interfaces on the switch.
I can see gigabit interfaces.
I can see vlan interfaces.
Some of the interfaces are up, some of them are down.
But what I could do is say
show me interfaces that are up
but don't show me interfaces that don't have
an IP address assigned on them.
That can be really useful if you've got
a large configuration and you only wanna see
interfaces that have an IP address on them
and that are up.
Okay, so how about "show run grep 1.1".
Now that dot is actually a regular expression.
Notice we've got a matching character there.
We've got a matching character here, here, and here.
What I could do however is say
grep again for let's say 10.
So show me everything that has 1.1.
In other words, one something one in it.
But filter that to only show me the lines
that have 10 in it.
So something like this.
Now you might say, "well, I could have just done include 10"
as an example.
And that's true but don't use these examples
to limit what you're thinking.
Use these examples just to show you what's possible
and then think out of the box.
How can you use this?
Try different things and see if you can think of
ideas of how you can use these commands
and add them below this video.
Tell me examples that you've found useful.
Now, notice I can do an include
but I can't do an exclude here.
So with grep I can do that.
So the include, exclude option is kinda limiting.
But with grep I could say show me that
but let's do -v,
let's exclude gig.
And that's probably because I didn't use grep there.
So, "grep -v Gig".
Notice same kind of result as I had over there.
This is a double include, if you like, or double grep.
Show me something that matches twice.
Here I've got show me a matching line
but don't show me this line that matches.
So we've got an include/exclude.
You can't do that with the traditional
show run pipe include, show run pipe exclude.
Here I'm doing include/exclude at the same time.
Okay, so let's look at some other Linux commands.
Here's my Linux PC once again.
So "uname -a" shows me that I'm using Linux.
"--help" gives me help options with this command.
But on a Cisco device as an example,
I can type "uname -a".
This shows me that I'm using IOSv, as an example.
Now just like in Linux, I can use man.
So look at the manuals.
So give me details of uname.
Notice lots of options available with uname.
So "uname -a" shows me all the information
about this router.
S just give me the version.
So it's IOSv.
N gives me the name of the router.
But let's try R.
That's the version of operating system.
So if you just wanna get the version of operating system,
there you go.
That could be useful in a script as an example.
Or V gives me details of the version.
Very similar to the output over here with -a.
Now again, Linux does something very similar.
I could say "uname -a", gives me all the output.
S tells me that this is Linux.
This shell option has many commands.
Now you may be wondering
what kind commands are supported?
I don't wanna make this video too long.
I will show you some more complex stuff in a separate video.
But if you wanna start investigating
what options are available,
we have this "show shell functions" command
that will show us which functions
are supported by this command.
So notice a very basic one, cat.
We've got cut.
We've got echo.
We've got grep, which I've been showing you at the moment.
It says, "search for regular expressions
"in piped output or files."
We've got head, more.
Plenty of Linuxed commands available here.
So let's use head and tail.
So, "sho run | head" will show me the first 10 lines
of the running configuration.
So there you go.
So first few lines of the running configuration.
I could also say tail, which will show me
the last few lines of the running configuration.
That's very basic stuff.
Cat allows me to read a file.
So if I type "dir", notice there's some files in flash.
Let's do this.
Show run, and this is very much a Linux command.
I'm gonna pipe the show running configuration to shrun.cfg.
So I'm gonna type show run, pipe that configuration,
or push that configuration to a file in flash.
So dir shows me that that file exists in flash.
And what I can do here is type "more shrun.cfg".
And notice there's the file that I'm reading from flash.
But how about this?
Let's do "sh IP route".
And actually let's push that to shiproute.txt.
So, that file once again exists in the flash of the router.
So what I'll do here is use cat.
So, "cat shiproute.txt".
Cat just shows you the whole file in one go.
Notice there are a lot of routes here.
So I may have preferred to use more.
More shows me one line at a time
rather than just showing you the whole output in one go.
So while we're waiting for that,
let's go back into Linux.
So clear.
LS shows me the file here.
"Cat shrun".
Those shows me the running configuration in one go.
So that was a bit quick.
So notice, "cat shrun",
whole configuration in one go.
I could do more.
Notice that shows me one page of configuration at a time.
Same here.
Rather than using cat, I may prefer to use more.
So I'm reading that file from flash.
But what it allows me to do here is press q to quit.
So rather than seeing all that output,
I could just see one page at a time and then quit.
Okay so I could go on for a long time here.
Notice we are using classic IOS here
and I was able to use these commands
by just running the shell processing full command.
Now in other videos I'm going to show you
even more powerful ways of leveraging this
to make you stand out from the competition
as a network engineer.
So learn this stuff and hopefully it will save you
a lot of time in the real world.
It will help you become a better network engineer.
And it'll help you differentiate yourself
from others in the industry.
Now hopefully this is gonna change the way that you work.
Hopefully it's gonna separate you
from others that you work with
or others in interviews.
Hopefully it will show people that you work with
that you're serious
and that you're an excellent network engineer.
Once again, if you don't mind,
please subscribe to my YouTube channel
and please like this video.
I'm David Bombal and I wish you all the very best.
(upbeat electronic music)