|
This chapter describes how to use the Cisco IOS command-line interface (CLI) to configure the router and includes the following sections:
This section describes how to copy configuration files to and from the Flash PC card (referred to as the card in the rest of this section) to RAM and NVRAM. You might need to do this if you do either of the following tasks:
This section describes two processes:
Use this procedure if your systems administrator gives you, or installed in the router, a Flash PC card containing a configuration file. This procedure assumes that your router has not yet been configured.
Follow these steps to copy a configuration from a card to the router:
Step 1 Confirm that the card containing the configuration file is installed in the router.
If the card that contains your configuration file is not installed in your router, install the card according to the "Installing a Flash PC Card" section in the "Installation" chapter earlier in this guide.
Step 2 Turn the router on by pressing the power switch to the on ( | ) position.
While the router is booting up, a series of messages display on your terminal or PC. Wait until this message is displayed:
--- System Configuration Dialog ---
Would you like to enter the initial configuration dialog?[yes/no]:
Step 3 Enter n to exit the automatic configuration dialog and begin the copy process:
--- System Configuration Dialog ---
Would you like to enter the initial configuration dialog?
[yes/no]: n
Press RETURN to get started!
Step 4 Press Return to enter user EXEC mode:
Router>
Step 5 Enter the enable command to enter privileged EXEC mode (the enable password does not show up on the monitor):
c1400> enable
Password:<password>
c1400#
Step 6 Enter the copy command as shown to copy the file from the card to the router NVRAM (running memory):
Router# copy flash:filename running-config
Step 7 Enter Return at the following prompt:
Destination file name [running-config]? <Return>
361 bytes copied in 1.344 secs (361 bytes/sec)
c1400#
You have finished copying a file from the card to the router RAM (running configuration).
Step 8 To save the configuration to NVRAM (the startup configuration), enter the copy command as shown:
c1400# copy running-config startup-config
Building configuration...
[OK]
c1400#
Follow the steps in this section if you want to give someone else a copy of the configuration file that you are using on your router. This procedure assumes that the router has been configured.
Follow these steps to copy a file in RAM (the running configuration) to the card:
Step 1 Be sure that there is only one configuration file on the Flash PC card.
Step 2 Enter the enable command and your enable or enable secret password to enter privileged EXEC mode (the enable password does not show up on the monitor):
c1400> enable
Password:<password>
c1400#
Step 3 Enter the copy command to copy the running configuration to the card:
c1400# copy running-config flash:
Step 4 At the following prompt, press Return to name the file the default (shown in parentheses):
Destination filename [running-config]? <Return>
Step 5 At the following prompt, enter n:
Erase flash: before copying? [confirm]? n
You will see output similar to this:
Verifying checksum... OK (0x4213)
419 bytes copied in 1.23 seconds (419 bytes/sec)
c1400#
You have finished copying a file to the card.
This section describes how to configure the router using the Cisco IOS software command-line interface. The configuration shown in this section is an example. Your configuration might be different depending on your network.
More information on router configuration, including commands and examples, can be found on the Documentation CD-ROM that came with your router. Follow these links from the CD-ROM home page:
Cisco Product Documentation: Cisco IOS Software Configuration: Cisco IOS Release 12.0: Configuration Guides and Command References.
The configuration in this chapter is based on the following assumptions:
Before you begin configuring, remember:
This section describes how to configure the router and contains the following sections:
Use this table to configure the router for some global parameters.
Step | Task | Router Prompt | Command |
---|---|---|---|
1. | Enter configuration mode. |
| configure terminal |
2. | Configure the router to show the dates and time of all debug messages. This step is optional, but recommended if you use debug commands to troubleshoot your configuration. |
| service timestamps debug datetime msec |
3. | Configure the router to show the date and time of all log messages. This command is optional, but recommended if you use the verification steps described in this chapter. This feature is enabled for the command output example shown in this chapter. |
| service timestamps log datetime msec |
Use this table to configure the router with some security information, including the password used to access the router and the username and password used during PPP authentication
1. Specify a password to prevent unauthorized access to the router. Passwords are case-sensitive. Router(config)#
enable password 1400user 2. Configure the router with a hostname, which is used in prompts and default configuration file names. For PPP authentication, the hostname entered with this command must match the username of the central-site router. Router(config)#
hostname c1400 3. Specify the password used during CHAP and PAP authentication. The username entered with this command must match the hostname of the central-site router. Usernames and passwords are case-sensitive. c1400(config)#
username HQ password guessme
Step
Task
Router Prompt
Command
.
Use this table to configure the Ethernet interface (which connects the router to your local network) with an IP address.
Step | Task | Router Prompt | Command |
---|---|---|---|
1. | Enter configuration mode for the Ethernet interface. | | interface ethernet0 |
2. | Configure this interface with an IP address and a subnet mask. | | ip address 10.1.1.1 255.255.255.0 |
3. | Enable this interface and the configuration changes you have just made on the interface. | | no shutdown |
4. | Exit configuration mode for this interface. | | exit |
Use this table to configure the ATM-25 interface (Cisco 1401 router) or ADSL interface (Cisco 1407 and Cisco 1417 routers), which connects your router to the ADSL line.
Step | Task | Router Prompt | Command |
---|---|---|---|
1. | Enter configuration mode for the ATM-25 or ADSL interface. Use the ATM0 keyword for both interface types. | | interface atm0 |
2. | Enable the interface. | | no shutdown |
3. | Create a permanent virtual connection (PVC) on the ATM interface, identify the virtual path identifier and virtual channel identifier, and enter interface-ATM-VC configuration mode. | | pvc 0/33 |
4. | Configure the ATM adaptation layer (AAL) and encapsulation type for the PVC, and assign a number to identify the virtual template. This command configures the interface for PPP routing. | | encap aal5mux ppp Virtual-Template1 |
5. | Exit interface-ATM-VC configuration mode. | | exit-vc |
6. | Enter configuration mode for the virtual template. | | interface Virtual-Template1 |
7. | Configure the virtual template with an IP address and subnet mask. | | ip address 10.0.0.1 |
8. | Exit configuration mode for the virtual template. | | exit |
Step | Task | Router Prompt | Command |
---|---|---|---|
1. | Specify the console terminal line. |
| line console 0 |
2. | Set the interval that the router waits until user input is detected. If this interval passes before you have entered any commands, the router ends the console session. If this occurs, you must log into the router using the console and enable passwords. |
| exec-timeout 5 |
3. | Specify a virtual terminal for remote console access. |
| line vty 0 4 |
4. | Specify a password on the line. |
| password lineaccess |
5. | Enable password checking at terminal session login. |
| login |
6. | Exit configuration mode. |
| end |
This section describes the conventions of the Cisco IOS CLI. If you are familiar with Cisco IOS software, you can skip this section.
To configure the router with a PC, the PC must have some type of terminal emulation software installed. The PC uses this software to send commands to your router.
Table 3-1 lists some common names for this software, based on the type of PC you are using.
PC Operating System | Software |
---|---|
Windows 98, Windows 95, Windows NT | HyperTerminal (included with Windows software) |
Windows 3.1 | Terminal (included with Windows software) |
Macintosh | ProComm, VersaTerm (supplied separately) |
You can use the terminal emulation to change settings for the type of device that is connected to the PC, in this case a router. Configure the software to the following settings so that your PC can communicate with your router:
This section describes the Cisco IOS command mode structure. Each command mode supports specific Cisco IOS commands. For example, the interface type_number command is used only in global configuration mode.
You use the following Cisco IOS command modes when configuring the scenarios described in this document:
Table 3-2 lists the command modes that are used in this guide, how to access each mode, the prompt you see in that mode, and how to exit that mode. The examples in the table use the hostname 1400.
How to Enter | Prompt | How to Exit | About this Mode |
---|---|---|---|
User EXEC Mode | |||
Begin a session with your router. |
| Enter the logout command. | A subset of the commands available in this mode. Use this mode to
|
Privileged EXEC Mode | |||
Enter the enable command in user EXEC mode. |
|
| Use this mode to configure your router operating parameters. You should configure your router with an enable password to prevent anyone from making unauthorized changes to the router configuration. |
Global Configuration Mode | |||
Enter the configure command while in privileged EXEC mode. |
|
| Use this mode to configure parameters that apply to your router as a whole. |
Interface Configuration Mode | |||
Enter the interface command (with a specific interface) in global configuration mode. |
|
| Use this mode to configure parameters for the LAN and WAN interfaces of your router:
|
Router Configuration Mode | |||
Enter your router command followed by the appropriate keyword in global configuration mode. |
|
| Use this mode to configure an IP routing protocol. |
Line Configuration Mode | |||
Specify a line with the line vty command in the global configuration mode. |
|
| Use this mode to configure parameters for the terminal line. |
You can use the question mark (?) and arrow keys to help you enter commands. Here is how to get help while in any command mode:
Router (config-if)# s?
shutdown
snapshot
snmp
standby
Router (config-if)# snapshot ?
client Enable client control of Snapshot routing
server Send routing updates out this link when updates are received
Router (config-if)# snapshot client ?
<5-1000> duration, in minutes, of each active period
Router> sh ho
Default domain is not set
Name/address lookup uses domain service
Name servers are 255.255.255.25
Because many privileged-level EXEC commands are used to set operating parameters, you should password-protect these commands to prevent unauthorized use.
You use two commands to do this:
You must enter an enable secret password to gain access to privileged EXEC mode commands.
The Cisco IOS software does not allow you to enter the same password for both the enable and the enable secret passwords. You will see this error message:
The enable password you have chosen is the same as your enable secret.
This is not recommended. Re-enter the password.
An enable secret password can contain from 1 to 25 uppercase and lowercase alphanumeric characters. An enable password can contain any number of uppercase and lowercase alphanumeric characters. In both cases, a number cannot be the first character. Spaces are also valid password characters; for example, two words is a valid password. Leading spaces are ignored; trailing spaces are recognized.
If you lose or forget your enable password, refer to the "Troubleshooting" appendix later in this guide.
Take these steps to enter configuration mode:
Step 1 After your router boots up, enter no when the following question displays:
Would you like to enter the initial configuration dialog [yes]:
no
Step 2 If you have configured your router with an enable password, enter the enable command, and enter the enable password when you are prompted for it.
The enable password does not show on the screen when you enter it. This example shows how to enter configuration mode on a Cisco 1400 router:
Router> enable
Password: <enable_password>
Router#
Enable mode is indicated by the pound sign (#) in the prompt. You can now make changes to your router configuration.
Step 3 Enter the configure terminal command to enter configuration mode, indicated by (config) # in the prompt:
Router# configure terminal
Router(config)#
This section provides some tips about entering Cisco IOS commands with the CLI.
You only have to enter enough characters for the router to recognize the command as unique. This example shows how to enter the show configuration command:
1400# show conf
Using 385 out of 7506 bytes
!
version 11.2
no service udp-small-servers
no service tcp-small-servers
.
.
.
Table 3-3 lists some error messages you might encounter while using the CLI to configure your router.
Error Message | Meaning | How to Get Help |
---|---|---|
| You did not enter enough characters for your router to recognize the command. | Re-enter the command followed by a question mark (?) with no space between the command and the question mark. The possible keywords that you can enter with the command are displayed. |
| You did not enter all of the keywords or values required by this command. | Re-enter the command followed by a question mark (?) with no space between the command and the question mark. The possible keywords that you can enter with the command are displayed. |
| You entered the command incorrectly. The error occurred where the caret mark (^) appears. | Enter a question mark (?) to display all of the commands that are available in this command mode. |
To disable a feature or undo a command you entered, you can enter the keyword no before most commands; for example, to disable IP routing on an interface, enter no ip routing.
You must enter the copy running-config startup-config command to save your configuration changes to NVRAM so that they are not lost if there is a system reload or power outage. This example shows how use this command to save your changes:
1400# copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
It might take a minute or two to save the configuration to NVRAM. After the configuration has been saved, the privileged EXEC prompt will appear:
1400#
Posted: Fri Sep 27 23:37:03 PDT 2002
All contents are Copyright © 1992--2002 Cisco Systems, Inc. All rights reserved.
Important Notices and Privacy Statement.