Cisco® Router Configuration & Troubleshooting - 3 - Initial Router Setup
Cisco® Router Configuration & Troubleshooting - 3 - Initial Router Setup
Startup Script
When a Cisco router is first powered on and the bootstrap ROM has loaded the basic IOS image into
RAM, the nonvolatile RAM (NVRAM) is checked for a preexisting configuration. If no
configuration file is found, the bootstrap program executes the setup script from ROM. This setup
script asks a series of questions that are used to generate an initial router configuration. Each question
asked has a default answer associated with it. The default choice is displayed in brackets at the end of
the prompt.
Listing 3.1 shows some of the questions asked during an initial router power-on. The setup program
determines which questions to ask based on the responses you give to the first few questions. For
instance, if you answer "yes" to the question "Configure IGRP routing?", the setup program will ask
questions during the interface configuration dialogs that allow it to generate a basic IGRP
configuration for those interfaces.
file://I:\chapters\z\zb196.html 3/21/01
Cisco® Router Configuration & Troubleshooting - CH 3 - Initial Router Setup Page 2 of 10
After you've answered all the questions, the setup program generates the configuration file that
matches the answers you provided. You are then asked whether this configuration should be used to
program the router. You must answer "yes" or "no" to this question. There is no default choice.
Listing 3.2 shows the sample configuration generated by the setup program answers shown in Listing
3.1.
hostname test-r1
enable password cisco
line vty 0 4
password termpwd
!
ip routing
!
interface Ethernet0
ip address 192.168.17.2 255.255.255.0
!
interface Serial0
shutdown
no ip address
!
interface Ethernet1
ip address 192.168.80.2 255.255.255.0
!
interface Serial1
shutdown
no ip address
!
end
Once the configuration has been loaded, the router displays the user EXEC mode prompt test-r1>.
You’ll notice that the setup program doesn’t ask you whether you would like to configure OSPF or
file://I:\chapters\z\zb196.html 3/21/01
Cisco® Router Configuration & Troubleshooting - CH 3 - Initial Router Setup Page 3 of 10
BGP, or many other features that are available in the IOS. These other features must be configured
manually either through the privileged EXEC mode command-line interface or from a prebuilt
configuration file on a TFTP server or flash card.
file_id is required on 7000 and 7500 series routers because they offer the use of PCMCIA flash cards.
The configuration file must be given a name in this case. There are two PCMCIA flash card slots on
the RP: RSP7000 and RSP series route processor cards. Remember from Chapter 2, "Cisco Routers:
An Overview," that the route processor cards handle all the router's administrative functions. These
functions include responding to SNMP queries and receiving and processing routing updates. Also, in
cases where VIP cards aren't used, the router processor is actually responsible for forwarding packets.
The file_id would be a combination of the PCMCIA flash card slot number and the actual filename
given to the configuration file, separated by a colon. For example, the following command would
copy the configuration file from a TFTP server to a file named config-router1 on the flash card in
slot0:
After this command is entered in IOS command-line enable mode (which is discussed later in this
chapter), a series of prompts allows you to define the IP address of the TFTP server, as well as the
filename on the TFTP server.
After the configuration file has been copied to the flash card, it must be moved into memory. The
following command copies the configuration stored on the flash card into RAM:
Now that the configuration file has been loaded into RAM, it must be stored into NVRAM so that it
won't be lost should the router ever need to be reloaded. The following command copies the
file://I:\chapters\z\zb196.html 3/21/01
Cisco® Router Configuration & Troubleshooting - CH 3 - Initial Router Setup Page 4 of 10
Another option using a TFTP server is to copy the configuration file from the TFTP server directly to
RAM or NVRAM. The following example copies a configuration file from a TFTP server into
NVRAM. This procedure would be used to load a completely new configuration for your router that
will be made active after the next reload of the router:
The next example copies a configuration file from a TFTP server to RAM. This procedure would be
used to enable or modify options in the configuration currently running in the router. An example of
when this would be used is to add lines to an existing access-list or to enable SNMP on a router that
doesn't currently have it active:
Manual Configuration
Manual configuration of a Cisco router encompasses building the router configuration piece by piece.
This means that all options you want enabled need to be programmed without the use of an
interactive setup program.
This section outlines the Cisco IOS command modes mentioned in this book. The following is a
complete list of the command modes available in the Cisco IOS:
file://I:\chapters\z\zb196.html 3/21/01
Cisco® Router Configuration & Troubleshooting - CH 3 - Initial Router Setup Page 5 of 10
Access to the interactive command mode on a Cisco router can be achieved via a number of different
means. The method most often used to connect to a Cisco router that hasn't been configured is via the
console port. The console port is a serial connection on the chassis of the router or the processor
board if the router is a model in one of the modular router families. The console port interface is
usually a male DB-25 serial connection, but it can also be an RJ-45-type connector, depending on the
model of the router. Any VT100 terminal or PC with a serial port and communications software can
be used to connect to the console port.
Access to a Cisco router can also be achieved via telnet from a remote host once the router is placed
into a network and the appropriate configuration for the network interfaces and VTY lines is made on
the router.
The auxiliary port (labeled AUX on the router itself) can be configured as an asynchronous serial line
and supports SLIP and PPP. Once the AUX port has been configured as an asynchronous serial port,
you can attach a modem and use it to access your router from a remote location over a dedicated
phone line.
The basic prompt given when you first connect to a Cisco router is the user EXEC prompt. It consists
of the router name followed by a greater-than symbol (>). If the router name hasn't been configured,
the prompt is router>.
In basic user EXEC mode, a subset of the Cisco IOS commands is available for execution. In order to
file://I:\chapters\z\zb196.html 3/21/01
Cisco® Router Configuration & Troubleshooting - CH 3 - Initial Router Setup Page 6 of 10
gain access to the full set of IOS commands, you must enter user privileged EXEC mode. The enable
command is used to change from user EXEC mode to privileged EXEC mode.
If there is an enable password or a secret password configured on the router, the user is prompted for
the password before the privileged EXEC mode prompt is returned. The commands available in basic
user EXEC mode don't let you alter the system parameters. All commands that affect the system are
accessed via privileged EXEC mode. For this reason, it's a good idea to password-protect access to
privileged EXEC mode.
The router prompt changes once you have entered privileged EXEC mode. The prompt becomes the
router hostname followed by the pound symbol (#). If no hostname is configured, the prompt is
router#. To leave privileged EXEC mode and return to basic user EXEC mode, use either the disable
or exit command.
Access to the other configuration modes is possible from privileged EXEC mode. The next sections
discuss the global configuration, interface configuration, line configuration, and router configuration
modes.
Global configuration commands set parameters that affect the operation of the router as a whole. Use
the following privileged EXEC command to enter global configuration mode:
configure
After entering this command, you will receive the following prompt:
Setting a Password
A common mistake is to enable remote access on the router for the TTY and VTY lines,
require that a password be given, and then not set a password. I have often installed a
router in a network and then tried to access it via telnet and been denied access because a
password is required but not set.
The three configuration options are from the directly attached terminal or session, NVRAM, or a
network server. The default option terminal is displayed in brackets at the end of the command
prompt. Any of the three global configuration options can be given along with the configure
command to bypass the prompt. For example, to configure the router from NVRAM, you could use
the following command:
configure memory
Once the system is in global configuration mode, the command prompt on the router changes to the
hostname with the word config in parentheses, followed by the pound symbol (#). If the hostname
hasn't been configured, the prompt would be router(config)#. Using the configuration entered in the
startup script from Listing 3.1, the prompt is test-r1(config)#. After the router has been placed into
global configuration mode, all other configuration modes are accessible.
file://I:\chapters\z\zb196.html 3/21/01
Cisco® Router Configuration & Troubleshooting - CH 3 - Initial Router Setup Page 7 of 10
The rest of configuration mode can be accessed from global configuration mode. To leave global
configuration mode and return to privileged EXEC mode, type exit or end, or press Ctrl+Z.
Many of the Cisco IOS features are configured on a per-interface basis. Interface configuration
commands are entered after the router has been placed in interface configuration mode. The following
command is used to change from global configuration mode to interface configuration mode:
interface-type can be any of the interfaces currently installed in the router. interface-number is the
corresponding port on the interface card that you want to apply the interface configuration commands
to. For example, if you wanted to assign IP address 192.168.300.10 with a 24-bit subnet mask to
interface Ethernet 4/0, you would use the following series of commands:
router> enable
password:
router# configure terminal
router(config)# interface ethernet 4/0
router(config-if)# ip address 192.168.300.10 255.255.255.0
router(config-if)#
The router prompt changes once the command mode is changed from global to interface. The router
prompt becomes the hostname, followed by config-if in parentheses, followed by the pound symbol
(#). The router prompt will now look like this:
test-r1(config-if)#
To leave interface configuration mode and return to global configuration mode, use the exit
command. To leave interface configuration mode and return to enable mode, either use the end
command or press Ctrl+Z.
Interface Notation
The interface notation used here is from a modular router in the Cisco product family.
The notation 4/0 means slot 4, interface 0. To someone actually looking at the router, it is
the first port on the interface card in slot 4. Interface cards that have multiple ports on
them are numbered sequentially, starting with 0. Also, you might remember from
Chapter 2 that the slots on the modular routers are numbered from 0 as well. So slot 4 is
actually the fifth slot in the chassis.
file://I:\chapters\z\zb196.html 3/21/01
Cisco® Router Configuration & Troubleshooting - CH 3 - Initial Router Setup Page 8 of 10
The commands used in the preceding example to configure the IP address for the
Ethernet interface could also have been entered in abbreviated notation. The Cisco IOS
allows commands to be entered with only the first few letters of the actual command
name. For instance, the IP address command could have been entered as ip add rather
than ip address. The number of letters required before the command is recognized
depends on the various other commands available at that command level. For instance,
the interface configuration command ip a could mean ip address, ip accounting, or ip
access-group. The interface configuration command ip ac could be either ip accounting
or ip access-group. Once you have reached a point in the spelling of the command that
allows only one possible interpretation by the IOS, the IOS will accept the abbreviated
command.
Router Prompts
If you are beginning to see a recurring theme with the router prompts, you are correct.
Every Cisco IOS command mode has a different prompt. This helps you keep track of
where you are within the IOS command structure.
Line configuration mode is used to set parameters on the TTY and VTY ports of a Cisco router, as
well as the console and auxiliary ports. To enter line configuration mode from global configuration
mode, enter the following command:
line-number is the port number that you want the following commands applied to. You can apply the
line configuration commands to a series of line numbers by specifying an ending line number. For
example, to have vty port 0 through 12 auto-disconnect after 15 minutes of idle time, execute the
following series of commands:
test-r1> enable
password:
The router prompt changes once you have entered line configuration mode. The prompt becomes the
hostname, followed by config-line in parentheses, followed by the pound symbol (#). The router
prompt now looks like this:
test-r1(config-line)#
To exit line configuration mode and return to global configuration mode, use the exit command. To
leave line configuration mode and return to privileged EXEC mode, use the end command or press
Ctrl+Z.
file://I:\chapters\z\zb196.html 3/21/01
Cisco® Router Configuration & Troubleshooting - CH 3 - Initial Router Setup Page 9 of 10
Router configuration mode is used to configure IP routing protocols. To enter router configuration
mode from global configuration mode, use the following command:
router keyword
The keyword used can be any of the options listed in Table 3.1.
Keyword Description
bgp Border gateway protocol
The command prompt in the IOS changes once you have entered router configuration mode. The
command prompt becomes the hostname, followed by config-router in parentheses, followed by the
pound symbol (#).
For example, to configure the redistribution of static routes into OSPF process 1000, use the
following series of commands:
test-r1> enable
password:
test-r1# configure terminal
test-r1(config)# router ospf 1000
test-r1(config-router)# redistribute static subnets
test-r1(config-router)# ^Z
test-r1#
To exit from router configuration mode and return to global configuration mode, use the exit
command. To leave router configuration mode and return to privileged EXEC mode, use the end
command or press Ctrl+Z.
file://I:\chapters\z\zb196.html 3/21/01
Cisco® Router Configuration & Troubleshooting - CH 3 - Initial Router Setup Page 10 of 10
Each of the configuration modes can be accessed directly from another configuration mode. For
instance, if you are in line configuration mode and you want to program an Ethernet interface, you
don't have to exit line configuration mode and then enter interface configuration mode from global
configuration mode. You can simply enter interface configuration mode from line configuration
mode.
Conclusion
The configuration modes discussed here are only a few of those available in the Cisco IOS. All of the
configuration modes operate in the same fashion. You can enter them and exit them all the same way
and with a similar syntax. Use of the ? operator in any of the EXEC or command modes will list the
available command options. This help operator is an invaluable tool, because no one wants to
memorize the command syntax of every feature in the Cisco IOS, and rarely do network operators
carry the complete IOS command set publications with them.
Table 3.2 recaps the most-used command modes, their corresponding router prompts, what the
command mode is used for, and the command used to enter that mode.
file://I:\chapters\z\zb196.html 3/21/01