When the router is started for the first time, it will
provide an option ‘would you like to enter the initial configuration dialog?
[yes/no]’. The initial configuration dialog is used to provide basic
configuration to the router. If you type ‘yes’ to enter the configuration, it
will ask a series of questions, such as the hostname for the router, enable
password, etc.
If you do not go through initial configuration, there will
still be a very simple default configuration, which you can see with show
run. If you are going to be using another router’s config as a template for
this router, you will first need to clear the config with erase
startup-config. You can then restart the router (with reload), enter Global
Configuration mode, and paste in your template config. Note that with some
terminal emulation packages, you will need to adjust how fast the script is
pasted in. You can do this with character and line delay in the configuration
options of the terminal emulation software. If you don’t do this, you may find
that parts of the configuration get missed, as it is pasted faster that the
router can accept the input.
You will see the hostname for the router as the CLI prompt
(eg, if the router prompt is Router1# then the router’s hostname is Router1).
If you’re working on multiple routers at a time, this is particularly useful,
as it can get confusing. To configure the host name, enter Global Configuration
mode and type hostname name.
The router can have an enable password or an enable secret.
Although slightly misleading, they are both passwords. When you first log on to
the router and enter ‘enable’ mode, this is the password you are asked for. The
difference between the two is that the enable secret is encrypted, but the enable
password is not. Enable secret should always be used in preference to the
enable password, but you will sometimes still see enable password in use. To
set the password, use enable password password or enable
secret password. You can have both set if you want.
Usernames can optionally be set up. If configured, you will
be asked for a username and password when you login to the router. To add a
user, type username user privilege level secret 5 password.
User is the username, level is the privilege level (1 – 15) that
the user has (1 is user exec mode, 15 is privilege exec mode), ‘secret 5’ tells
the IOS to encrypt the password. Many admin accounts are created with level 15
privileges.
The easiest way to make a configuration change is look at
the current configuration, then copy and modifies the commands to suit what
you’re doing. For example, if you need to forward a port from the router to a
server, you could do a show run to see the commands that are already in
the config. You can then type out the command you need based on the command you
can see in the running config. If you need to remove a command, just add no
to the beginning of the command. For example, ip address 192.168.0.254
255.255.255.0 adds the IP address 192.168.0.254 to the interface you’re
configuring. Typing no ip address 192.168.0.254 255.255.255.0 will
remove that IP address.
IOS Basics
The IOS is the
operating system that runs on Cisco devices. The feature set of the IOS will
depend on the version that’s running, and the hardware it’s running on. The IOS
generally addresses four types of memory, which are ROM, Flash, RAM and NVRAM.
The ROM is read only,
and is where the bootstrap software is usually stored. The bootstrap
software is the first thing to boot when the router is turned on. Flash memory
is located on the system board, and can sometimes be upgraded with PCMCIA
cards. The flash memory is used to store the IOS images, configuration files
and the SDM (if used). The RAM is used in a similar way to a PC. It will store
the running configuration, buffers, tables, etc. NVRAM is used to store the
start-up configuration, which is loaded by the bootstrap software on start-up.
The router
configuration comes in two forms; the start-up configuration, and the running
configuration. The start-up configuration is stored in NVRAM, and is loaded
into RAM on startup. When the configuration is in the RAM, it becomes the
running configuration.
Either configuration
can be edited independently of the other. That means that you can change the
running configuration of the router to test it, and if there’s a problem,
reboot the router, and the startup config will be applied again. This means
that after changes are made, they must be written to NVRAM to be made
permanent. To write the configuration to NVRAM use copy running-config
startup-config, or write memory. Either configuration
can be displayed with show running-config or show
startup-config.
When using the CLI, you
can get a list of supported commands by typing help. If you
know the first part of a command, but are not sure what parameters to use, use ?
to display a list of options. For example, if you can remember that you need to
use the copy command, but can’t remember what comes next, type
copy ?. As soon as you press ? a list of
possible options is displayed. Also, if you can’t remember the whole command,
you can use the ? to get a list. For example, typing co?
will display ‘configure’, ‘connect’ and ‘copy’, as they all start with ‘co’.
CLI commands can be
shortened for brevity, as long as it’s obvious to the IOS which command you are
using. For example, show running-config can be shortened to sh
run. If you shorten a command too far, you will get an ‘ambiguous
command’ error, and you may need to be more specific. If you fail to enter
enough parameters (eg, copy run instead of copy run
start), you will get an ‘incomplete command’ error, meaning that you
have to enter more information.
Occasionally, you may
see some debug messages pop up. These will only appear in a session that is run
over the console by default. These messages will sometimes get in the way if
you happen to be typing at the time, which can lead to forgetting where you are
up to. If this happens, simply press the Tab key to bring up
the incomplete command.
Cisco routers use the
config register to store information on how the router behaves. The config
register is a hexadecimal number that represents specific configurations.
0x2102 is the default register. The register can be changed to specify the baud
rate for the console cable, whether to ignore ‘break’ and whether the router
boots up normally or into ROMMON (which is similar to ‘safe mode’ for windows).
You can find the value of the config register by typing show version.
0 comments:
Post a Comment