Cisco IOS Basic Commands PDF
Cisco IOS Basic Commands PDF
Cisco IOS Basic Commands PDF
Table Of Contents
3. Logging On
o Command to create User Level Password
o Command to create Enable Password
o Command to create Enable Secret Password
The Storyline
You have just received your new Cisco Router by Express Delivery,
and you are sitting there admiring the wonderful Cisco box.
(A Clean Slate refers back to a time when students wrote on slabs of rock)
Erase Startup-config
Reload
"What is a Command?"
The most important thing to understand is that all computers run on Magic.
And that Commands are the Magic Words that make computers do things.
And that a Routers is merely a Computer in a box that does nothing but Route.
So what we are talking about here is the Magic Commands for Routing.
And you are going to become the Magician!
Forget the commands, mis-spell them, put them in the wrong place,
and you could call up evil Daemons that will destroy your network.
Yes, it is just like real magic - you will be playing with fire!
First you need to get into it, so you use the "Key" command.
This allows you to open the door.
Cisco Routers use "Password" commands for this, but it's the same thing.
Then you have to use another Key command to start the car.
You have several commands that control what the car does.
There's the "Gas Pedal" Command that makes it go fast.
And the "Brake" Command that hopefully slows you down.
Of course it's good to have hands-on experience with the Steering Wheel,
which is a command that lets you adjust the direction you're going.
If Cisco had designed your car you would not have a Steering Wheel,
or Brakes, or a Gas Pedal. You would have a Text-Based User Interface.
STEERING-WHEEL RIGHT 90
Italics stand for Arguments for which You supply the Values.
number-of-degrees is an Argument that can be from 0 to 360 Degrees.
If you are feeling thankful that Cisco did not design your car,
just wait til we get to the Parallel Parking exercise!
If you are lucky and actually bought a Brandnew Router, you should have:
A Power Cord
A cable for connecting to a Computer port
A CD with all the Cisco Info in the World on it.
A manual (what's a manual, you ask? Who knows?)
If you bought a Used Second Hand Router and have all the Above
Count yourself as being one of the Luckiest people alive.
If you have said Manuals, read the Cisco "Getting Started Guide" now.
On the other hand, if you are Unlucky and do not have this manual,
but are using this Tutorial as a substitute, I will take mercy
and give you the "basic gist" of setting up a new machine.
There should be a Port on the back of your Router that says "Console"
Well, there are lots of different computers and even more different terminal
programs.
Most Windows computers come with a program called "Hyperterminal".
You can also download the latest version of this by searching the Net.
VT100 Emulation
9600 Baud
No Parity
8 Data Bits
1 Stop Bit
Some of you are already Experts and know what all these do.
If you don't know what these things mean, don't worry.
They will be appearing in my forthcoming 10,000 page Book "Everything About
Computers"
available at fine bookstores near you by the year 3,000...
There should also be a small fan noise. Some fans are louder than others.
You should also start to see the following on your VT100 Terminal Program:
It should ask you "Would you like to enter the initial configuration dialog?
[yes|no]:"
But we are going to type in "NO" when it asks us if we want to use the
"System Configuration Dialog", because putting in the commands ourselves,
will let us learn exactly how to properly configure a Router.
Besides if you are a Cisco person, you like doing things the hard way!
As they always say, "The more difficult and challenging, the better!"
But since we have a brandnew Router and you've turned down the Setup Dialog
there is no Password yet,
If you think this would be a terrible security flaw, you are correct!
You should definitely set up Passwords for your Router as your first step!
This initial "setting of password" can only be done from the Console Port.
Router>
To enter Privileged Exec Mode type in the word enable at the prompt.
Router> enable
Router# . . . . . . .
This changes the prompt from Router> (with an arrow)
To Router# (with a # or pound sign.)
The # means that you have entered Privileged Exec Mode
Needless to say, nearly everyone just calls it "Enable Mode" for short.
You will very seldom hear anyone call it Privileged Exec Mode.
So you should Immediately set Passwords so that everyone else can not
just as easily become All-Powerful Deity. This would be Bad!
Just to keep this Tutorial simple, let's use "CISCO" for all the passwords.
But wait, in order to set passwords you must be in the right Mode!
In order to configure nearly anything on a Cisco Router
you must be in Configuration Mode.
Router# configure
Router(config)#
Your very next step should be to set the Password for the Console Port.
Please do not use CISCO as a password in real life. This is just a Demo!
Also note that the Ctrl-Z (Control-Z, also written ^Z) ends your session,
and brings you back up to the Router# prompt.
Now you can start using the sub-commands to configure the Aux port.
Router(config-line)# Ctrl-Z
Router#
And now your Router has a password protecting the AUX port.
VTY Ports are rather a special case, since they are not real ports.
In other words, you won't find a Port on the back of your Router labelled VTY.
They are what could be called "Virtual Ports" that wait patiently
for a Remote Connection, usually using Telnet, to log in.
If you don't set these, you won't be able to Telnet in to your Router.
This means every time your routers have a problem, you have to drive in to work.
Or to where-ever the routers may be hidden (like Timbuktu?).
Configuring the VTY password is very similar to doing the Console and Aux ones.
The only difference is that there are 5 VTY virtual ports,
which are named 0, 1, 2, 3, and 4 .
You can use the shortcut 0 4 (a zero, a space, and 4) to set all 5 passwords at the same
time.
Once again start out with the Router in "Enable" (or "Prilileged") mode.
From the Command Prompt issue the Global Command configure terminal
Again you can now do a Ctrl-Z to get back to your "Router#" prompt.
This is why it is good advice Not to forget your Enable Secret Password!
The Router doesn't like the Enable Secret to be the same as the Enable.
The Enable Secret takes over from the regular Enable password.
This means if you set an Enable Secret Password, your Enable one will NOT work.
Router(config)#
(type in enable secret your-enable-secret-password
That's really all it takes. Don't forget it!
Again do a Ctrl-Z to exit.
This will put you back at the Global Enable Mode Prompt:
Router#
Now that you have successfully entered all the Passwords your Router needs,
this is a good time to do a quick practise session.
To leave the Enable Mode you need to type in the word disable
Remember again that Enable Mode is formally called "Privileged Exec Mode".
Router >
Now we are going to leave and say "Quit" or "Exit" to our Router:
Okay, at this point you would go ahead and press the ENTER key.
The next thing you will see on the screen will be:
You quickly recognise the "Router >" at the User Exec Level Prompt.
Router#
If you are like the rest of mankind and think of UNIX as User-Hostile,
then take hope from the fact that Cisco doesn't use ALL the UNIX commands.
I have it on good authority that the people who designed the Cisco IOS
liked to use the BASH Shell, a UNIX shell that is fairly polite.
And they very much liked using the standard editing program "vi".
(which may stand for "Variable Insanity" or "Very Intense"...)
Anyway, if you've worked for years with BASH shells and "vi" you're in luck.
Note that using the ARROW Keys is limited to those using a VT-100 Terminal
Emulation.
If the end of a line goes too long, it will not automatically wrap to the next one.
Instead the Cisco IOS command shell gives you a dollar sign $.
This indicates that you are an over-achiever and have typed too much,
at least too much to be shown on the screen.
Router#$ this is a way too long line that is full of sound and fury
You can get back to the beginning of your Novel by typing CTRL-A
Router# For Demo Purposes Only this is a long line that is full of $
If you want to you can turn off these Advance Editing Tools
by simplying typing in Terminal No Editing at the prompt.
Since this would be a silly thing to do, please turn them back on
by typing in the two words Terminal Editing.
Command History!
The Router keeps the last 10 commands you issued in its HISTORY,
which is a special memory Buffer which holds the "Command History".
(note here that a "Buffer" is a memory space for storing things...)
If you are a poor unfortunate without VT-100 you can use these instead:
1. Command One
2. Command Two
3. Command Three
4. Command Four
5. Command Five
6. Command Sixx - (with a mistake!)
7. Command Six - (fixed now)
8. Command Eight - "There is No Command 7!"
9. Command Nine
10. Command Ten
You can increase the size of your HISTORY buffer by using the command:
For us poor Mortals we can rejoice in the fact that the Cisco IOS
has a very good "HELP" function built into it.
In other words, a person in User Exec mode would only see a few commands.
A person in Privileged (Enable) Mode would see lots more command options.
3. If you type in the first few letters of a command and a Question Mark
the IOS will give you a list of Commands that start with those letters.
(please note there is No Space between the letters and the ? - Important!)
Let's start out at the User Exec prompt and look for "Configure"
(remember that User Exec is limited and has No Privileges!)
--more--
Anyway, let's take the hint and get into Enable Mode.
Now let's see what new and different commands are available!
Router# Type in a ?
Router#?
Exec commands:
--more--
Notice that in the Priveleged (Enable) Mode you have different commands.
From here it is possible to enter the Global command configure
and begin to actually change the configuration of your router!
Just to show more of the Help functions, how about we type in:
This will give us a list of the "Options" for the configure command.
Router#configure ?
Memory
Network
Terminal
Most SHOW command can be viewed from the regular USER Exec mode.
Some SHOW commands can only be viewed from the Priviledged Exec (Enable)
mode.
None of the SHOW commands can be used from the (config) mode.
This will just give you an error and you will feel very silly!
If you type in the command Show, a space, and then a Question Mark,
at the proper Enable Mode "Router#" prompt,
the Help function will give you a long list of the multitudinous show commands.
Router#show ?
show access-expression
show access-list
show apple interface
show apple route
show appletalk
show atm
show bridge
show cam
show cam dynamic
show cdp neighbors
show config
Luckily, you do not need to memorize all these right away for the tests.
There are, however, several show commands that are very useful
for taking a closer look at what your router has in it and what it's doing.
Show Version
Show version will also show you what interfaces the router has.
router>show version
Bridging software
X.25 software, Version 2.0, NET2,, BFE and GOSIP compliant.
Show Memory
Router>show memory
1. A Summary
Router>:show memory
As you can see the SHOW MEMORY command gives you lots of detailed
information
about the memory contained within your router.
Show Processes
The show processes command shows you all the active processes,
in the form of a chart containing the following information in Columns:
PC - Program Counter.
Invoked - This is the amount of time the Process has been invoked.
Stacks - This shows both the "low watermark" / "total stack space" in bytes.
Process - Finally, this actually gives you the Name of the process!
Router>show processes
CPU utilization for five seconds: 7%/7%; one minute: 9%; five
minutes: 12%
PID QTy PC Runtime (ms) Invoked uSecs Stacks TTY
Process
--More--
SHOW STACKS
Stacks are usually ordered in a "Last In, First Out" (LIFO) data structure.
The SHOW STACKS command looks at the manner in which the Cisco Router's
Processes and Interupts utilize these stacks.
Router>show stacks
Free/Size Name
2704/4000 Setup
3256/4000 Autoinstall
3524/4000 Exec
SHOW BUFFERS
Buffers are sort of like Bus Stops, but some are Bigger (like a Bus Station),
and some of them are very large, like an Airport!
SHOW BUFFERS lets you see the size of the Small, Middle, Big, Very Big, Large,
and Huge buffers.
Router>show buffers
Buffer elements:
0 failures (0 no memory)
0 failures (0 no memory)
0 failures (0 no memory)
0 failures (0 no memory)
0 failures (0 no memory)
Huge buffers, 18024 bytes (total 0, permanent 0)
:
0 in free list (0 min, 4 max allowed)
0 failures (0 no memory)
24 hits, 0 fallbacks
3 hits, 0 fallbacks
12 hits, 0 fallback
12 hits, 0 fallbacks
25 hits, 0 fallbacks
25 hits, 0 fallbacks
6 hits, 0 fallbacks
6 hits, 0 fallbacks
10 hits, 0 fallbacks
SHOW FLASH
We'd already discussed what Flash Memory is early, but a reminder can't hurt.
Flash Memory
An Electronically Erasable and Re-Programmable memory chip.
The "Flash" contains the full Operating System, or "Image".
This allows you to Upgrade the OS without removing chips.
SHOW FLASH tells you how Big the Flash Memory is and what it is doing.
Again lots of good statistics to use in troubleshooting your Router.
Router> (type in show flash
Router>show flash
1 11780820 12-04T.bin
SHOW INTERFACES
Router>show interfaces
Hardware is BRI
0 carrier transitions
Hardware is BRI
0 carrier transitions
Hardware is BRI
0 carrier transitions
Hardware is HD64570
0 carrier transitions
Hardware is HD64570
23 carrier transitions
0 carrier transitions
0 carrier transitions
SHOW PROTOCOLS
Even if the Interface is UP, if the Line Protocol isn't working, nothing works.
Router>show protocols
Global values:
SUMMARY
As you can see, the SHOW commands give you an inside view of your router.
There are many, many show commands, and you will get to know most of them!
One is SHOW STARTUP-CONFIG, and let's you see what is stored in the Router's
NVRAM (Non-Volatile Memory), the place where configurations live when the power
is off.
The other one is SHOW RUNNING-CONFIG, which shows you the configuration
as you have changed it since turning on the router.
For Security Reasons, these commands are not available from the User Prompt.
The reason for this is that most of the Passwords are shown by these commands.
Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router
!
enable secret 5 $1$60Ad$4etO0u.sxYl6DHv1pEXJ4/
enable password CISCO
!
ip subnet-zero
!
!
!
!
interface Ethernet0
no ip address
no ip directed-broadcast
shutdown
!
interface Serial0
no ip address
no ip directed-broadcast
no ip mroute-cache
shutdown
no fair-queue
!
interface Serial1
no ip address
no ip directed-broadcast
shutdown
!
interface Serial2
no ip address
no ip directed-broadcast
shutdown
!
interface Serial3
no ip address
no ip directed-broadcast
shutdown
!
interface BRI0
no ip address
no ip directed-broadcast
shutdown
!
ip classless
no ip http server
!
!
!
line con 0
password CISCO
login
transport input none
line aux 0
password CISCO
login
line vty 0 4
password CISCO
login
!
end
Show Running-Config
As we said a minute ago, SHOW RUNNING-CONFIG, let's you see the configuration
that is actually Live, in RAM Memory, running right now on your router.
You should now see the following Prompt, because Router is now ARNOLD.
ARNOLD#
Now if we type in the SHOW RUNNING-CONFIG (or SHOW RUN for short)
you will see that the name of the router is now ARNOLD.
Router(config)#hostname ARNOLD
ARNOLD(config)#exit
ARNOLD#
1d03h: %SYS-5-CONFIG_I: Configured from console by console
ARNOLD#show run
Building configuration...
Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname ARNOLD
!
enable secret 5 $1$60Ad$4etO0u.sxYl6DHv1pEXJ4/
enable password CISCO
!
ip subnet-zero
!
!
!
!
interface Ethernet0
no ip address
no ip directed-broadcast
shutdown
!
interface Serial0
no ip address
no ip directed-broadcast
no ip mroute-cache
shutdown
no fair-queue
!
interface Serial1
no ip address
no ip directed-broadcast
shutdown
!
interface Serial2
no ip address
no ip directed-broadcast
shutdown
!
interface Serial3
no ip address
no ip directed-broadcast
shutdown
!
interface BRI0
no ip address
no ip directed-broadcast
shutdown
!
ip classless
no ip http server
!
!
!
line con 0
password CISCO
login
transport input none
line aux 0
password CISCO
login
line vty 0 4
password CISCO
login
!
end
ARNOLD#
ARNOLD#
And then the Router asks for the IP address of the TFTP server.
Remote host[]? 10.1.1.1 (this is just a madeup sample IP address)
Building configuration...
Once again, since for this tutorial we only have one router and no network,
we won't be able to practise doing a COPY RUN TFTP for real.
But hopefully you've got the basic concept, right?
Now we go on to the obvious next step, and learn to put the saved file back in.
Building configuration . . .
OK
And now you know two methods for re-doing the router's running configuration.
Well, it is good for resetting the router back to square one if you make a mistake.
ERASE STARTUP-CONFIG takes your Router and Nukes it back to the stone age.
In other words, it erases your NVRAM so that the next time you RELOAD,
you have a completely blank Router.
If you want to change something you can type in your own answers.
First, would you like to see the current Interface summary? [yes]
Anyhow, as you can see, these Interfaces are not doing anything much.
They have no IP Addresses (all unassigned!) and they are Not "OK?"
What's worse, they have no method as it's "not set",
and their status is "down" and protocol is "down".
How very depressing!
"What is an Interface?"
For example, the Ethernet Interface is where the Ethernet cable goes,
and the Serial Interface is where you plug in the Serial Cables
(add milk and sugar to taste).
Got that picture? Good... we'll wait til later to tell you about "Virtual Interfaces"!
Global Configuration
But wait, there's More!
The next Step will allow you to give your Router a Name
Let's name this Router after the ancient Sumerian City "UR".
Type in the Name "URouter" in the text box below.
Enter Host Name [Router]
Which will change the Prompt on your Terminal Screen to change to:
URouter#
Note that the Router now has Your Name on it, "URouter"!
The "Non-privileged" can log onto the Router with the regular password
and they can basically look at stuff but can't touch.
Enter Password: (type in your password here)
Of course the "Enable" password is plain old text and not secure,
So Cisco recommends that you use the encrypted "Enable Secret" password instead.
Now you get asked if you want to use the OSI Connectionless Network Service.
(trust us, you do not need this protocol right now)
Next we pretend you are a Mac fanatic with a huge Multi-Zone Network!
You can also safely say "NO" to Banyan Vines, Xerox XNS, and Digital' DECnet.
They are still being used out there somewhere... but not by you, not today!
Now we get into the main Protocol for the whole Internet,
which of course is named the "Internet Protocol" or "IP" for short.
Now it asks if you to want to use the Interior Gateway Routing Protocol
This Protocol does IP Routing for you, but you don't want it Now, okay?
Configure IGRP? [yes]: (write in "No" please)
You don't want the Apollo Routing Protocol either, unless you're on the Moon?
Interface Configuration
Well, that's enough for the Global Configuration stuff for now.
We'll be moving on to the even more complicated Interface junk.
Okay, what you will actually see next in the Dialog is:
Let's pick the Class A address, "10.0.0.1" to use, cause it's easy.
Warning! This is going to get a Bit confusing! (yes, Pun intended, sorry)
We'll have to go over all this IP addressing stuff later over a good Rootbeer...
Well, in this case you are correct, since we are not going to try IPX/SPX,
Appletalk, Banyan Vines, Decnet, or any of the other interested protocols yet.
Actually using SETUP is the easy way to get a Router up and running,
but as we mentioned earlier, doing things the easy way means
that you don't have to learn as much.
And for the Cisco tests, you had better take the time to learn everything!
Summary
In the course of this Tutorial:
This should be enough for you to be able to get a router up and running.
You, of course, know that is merely the beginning.
The true challenge come when you have two or three, or 30,000 routers,
all interconnected, and each one of them serving one or more networks.
Hopefully you will look forward to each challenge as it comes.
Learn the Basics well, and they will serve you well in the future!
1. Flash Memory
2. ROM- Read Only Memory
3. NVRAM - Non-Volatile RAM
4. RAM - Random Access Memory
2. Which kind of Memory is the full Operating System or "Image" stored in?
1. Flash
2. NVRAM
3. RAM
4. ROM
4. Which are the "Ports" that connect your Router to the outside world?
1. NVRAM
2. Interfaces
3. Flash
4. LEDs
Booting Up Questions
5. What is the very first thing that happens when your Router Boots Up?
1. The Configuration FIle saved in NVRAM is loaded into RAM.
2. The Operating System Image is loaded into RAM.
3. The Bootstrap Program, stored in ROM, loads and runs itself.
4. The Router goes through a Power-on Self-Test (POST)
8. When you first log on to a new router, what password do you use?
1. All Cisco Routers come with the password cisco from the factory.
2. You don't need a password on the Console Port is the factory default.
3. You can't log onto a new Router until it has been configured.
4. You press Control=Shift-6 to enter the Router.
10. The Privileged Exec Mode is entered into by issuing which command.
1. Disable.
2. Show Run
3. Enable.
4. Erase Start
11. In order to create passwords, which Global command do you need to use first?
1. Configure
2. Compose
3. Password
4. Disable
12. In order to set a Console Password, which Major Command do you use first?
1. Password
2. Line Console 0
3. Login
4. Ctrl-Z
1. Enable Password
2. Auxilary Password
3. Console Password
4. VTY Password
14. The Enable Secret Password is improved over the regular Enable because?
16. Which of the following Editing Commands will take you to the End of a line.
1. CTRL-A
2. CTRL-E
3. CTRL-B
4. Escape-F
17. If you wanted to use a previous command over again, what are 2 ways to do it.
18. Which of the following Help commands would show you USER Exec
commands
that start with the letter S?
1. Router> S ?
2. Router>Help S
3. Router# S?
4. Router> S?
SHOW Commands
20. If you wanted to find what the Configuration Register contained, you'd use?
1. SHOW MEMORY
2. SHOW VERSION
3. SHOW INTERFACES
4. SHOW BUFFERS
21. If your Router suddenly crashed, which command would help troubleshoot?
1. SHOW INTERFACES
2. SHOW VERSION
3. SHOW STACKS
4. SHOW OFF
22. If you wanted to check quickly to make sure all your interfaces were
talking correctly with the outside world you'd use which command?
1. SHOW PROTOCOLS
2. SHOW PROCESSES
3. SHOW MEMORY
4. SHOW TIME
1. Router>show running-config
2. Router#show run
3. Router(config)#show running-config
4. Router#show running-config
25. What are two reasons not to use the commands ERASE STARTUP-CONFIG
amd then RELOAD on the Router that connects your company to the Internet?
(choose all that apply)
>> **A little bit of TFTP FAQ's would be useful...need to "touch" the >> file on UNIX,
the usual need for fully qualified file names, etc. >> in the scenario, do a erase startup
and reset. Show managment >> through the configuration editor after reboot**
>> 11) Prepare to backup, upgrade, and load a backup Cisco IOS >> software image.
>> 9) Copy and manipulate configuration files.
>> 8) Enter an initial configuration using the setup command.
,p> >> ** Do this LAST. Yes, the user needs to know how to do it to pass the >> test, but
SETUP causes BAD habits**
>> Howard feels that you can develop a White Paper addressing what
>> CCNA candidates should know about IOS before taking the
CCNA >> exam. The paper would need to be 20-25 pages in length
and you should >> make every effort to address the following twelve
specific IOS CCNA >> exam objectives: (Note Howard has
regrouped the 12 CCNA IOS exam objectives >> and revised them
into a more rational presentation order as follows: (Note >> Howard
has also added personal comments bracketed by **)
>> ** There may be no configuration at all in the router the user is
working >> with. If it isn't a production router, begin the scenario by
logging in** >> 1) Log into a router in both user and privileged
modes. >> 2) Use the context-sensitive help facility. >> 3) Use the
command history and editing features. >> 4) Examine router elements
(RAM, ROM, CDP, show). >> 7) Identify the main Cisco IOS
commands for router startup. >> 10) List the commands to load Cisco
IOS software from: flash memory, a >> TFTP server, or ROM. >> >>
**A little bit of TFTP FAQ's would be useful...need to "touch" the >>
file on UNIX, the usual need for fully qualified file names, etc. >> in
the scenario, do a erase startup and reset. Show managment >>
through the configuration editor after reboot** >> >> 5) Manage
configuration files from the privileged exec mode. >> 6) Control
router passwords, identification, and banner. >> 12) Prepare the initial
configuration of your router and enable IP. >> >> ** for a scenario,
you will probably need a server** >> >> 11) Prepare to backup,
upgrade, and load a backup Cisco IOS >> software image. >> 9)
Copy and manipulate configuration files. >> 8) Enter an initial
configuration using the setup command. >> >> ** Do this LAST.
Yes, the user needs to know how to do it to pass the >> test, but
SETUP causes BAD habits**
and during the course of this discussion, you'll get to meet them.
Some of the more complex Commands are made up of smaller ones,
and sometimes you need to use one command before you can use another.
The Command -
Key Words - Words that modify what the Command does.
Arguments - Also words that modify what the Command does.
Parameters - More things that modify what the Command does.
For example, lets say you want your Car to turn Right
You would have to use the Steering-Wheel command
A lot of Cisco commands are written with parameters that further modify them.
Some commands have parameters that are necessary [ ]
While other parameters are just "optional" [use-turn-signal]
Just like in real Magic, you have to know what the Magic Name is,
and where the Magic Name is Hidden.
Then when you Pronounce the Magic Name
Powerful magical forces are brought into play!