Basic Config Using Cisco IOS Command Line Interface
Basic Config Using Cisco IOS Command Line Interface
This document describes how to use the Cisco IOS command-line interface (CLI) to perform a basic software configuration for your router.
Contents
Platforms Supported by This Document, page 1 Prerequisites for Basic Software Configuration Using the Cisco IOS CLI, page 2 Restrictions for Basic Software Configuration Using the Cisco IOS CLI, page 2 How to Perform a Basic Software Configuration Using the Cisco IOS CLI, page 2 Where to Go Next, page 19 Additional References, page 19
Cisco 1800 series routers Cisco 2800 series routers Cisco 3800 series routers
Corporate Headquarters: Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
Prerequisites for Basic Software Configuration Using the Cisco IOS CLI
Prerequisites for Basic Software Configuration Using the Cisco IOS CLI
Follow the instructions in the quick start guide that shipped with your router to install the chassis, connect cables, and power up the router.
Timesaver
Before powering up the router, disconnect all WAN cables from the router to keep it from trying to run the AutoInstall process. The router may try to run AutoInstall if you power it on while there is a WAN connection on both ends and the router does not have a valid configuration file stored in NVRAM (for instance, when you add a new interface). It can take several minutes for the router to determine that AutoInstall is not connected to a remote TCP/IP host.
Restrictions for Basic Software Configuration Using the Cisco IOS CLI
If Cisco Router and Security Device Manager (SDM) is installed on your router, we recommend that you use Cisco SDM instead of the Cisco IOS CLI to perform the initial software configuration. To access SDM, see the quick start guide that shipped with your router.
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
This section contains the following procedures:
Configuring the Router Hostname, page 3 (Optional) Configuring the Enable and Enable Secret Passwords, page 4 (Required) Configuring the Console Idle Privileged EXEC Timeout, page 5 (Optional) Configuring Fast Ethernet and Gigabit Ethernet Interfaces, page 7 (Required) Specifying a Default Route or Gateway of Last Resort, page 9 (Required) Configuring Virtual Terminal Lines for Remote Console Access, page 12 (Required) Configuring the Auxiliary Line, page 14 (Optional) Verifying Network Connectivity, page 15 (Required) Saving Your Router Configuration, page 17 (Required) Saving Backup Copies of Your Configuration and System Image, page 17 (Optional)
OL-5593-01
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
SUMMARY STEPS
1. 2. 3. 4. 5.
enable configure terminal hostname name Verify that the router prompt displays your new hostname. end
DETAILED STEPS
Command or Action
Step 1
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
hostname name
Example:
Router(config)# hostname myrouter
Step 4
Step 5
end
Example:
myrouter# end
Basic Software Configuration Using the Cisco IOS Command-Line Interface OL-5593-01
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
What to Do Next
Proceed to the Configuring the Enable and Enable Secret Passwords section on page 4.
Restrictions
If you configure the enable secret command, it takes precedence over the enable password command; the two commands cannot be in effect simultaneously.
SUMMARY STEPS
1. 2. 3. 4. 5. 6. 7.
enable configure terminal enable password password enable secret password end enable end
DETAILED STEPS
Command or Action
Step 1
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
OL-5593-01
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
Command or Action
Step 3
enable password password
Purpose (Optional) Sets a local password to control access to various privilege levels.
Example:
Router(config)# enable password pswd2
We recommend that you perform this step only if you boot an older image of the Cisco IOS software or if you boot older boot ROMs that do not recognize the enable secret command.
Step 4
Example:
Router(config)# enable secret greentree
Step 5
end
Example:
Router(config)# end
Step 6
enable
Example:
Router> enable
Step 7
end
Example:
Router(config)# end
Troubleshooting Tips
If you forget the password that you configured, or if you cannot access privileged EXEC (enable) mode, see the Password Recovery Procedures for your router, available at http://www.cisco.com/warp/public/474.
What to Do Next
If you want to set the console interface privileged EXEC timeout to a value other than 10 minutes (the default), proceed to the Configuring the Console Idle Privileged EXEC Timeout section on page 5. If you do not wish to change the privileged EXEC timeout, proceed to the Specifying a Default Route or Gateway of Last Resort section on page 9.
Basic Software Configuration Using the Cisco IOS Command-Line Interface OL-5593-01
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
SUMMARY STEPS
1. 2. 3. 4. 5. 6. 7.
enable configure terminal line console 0 exec-timeout minutes [seconds] end show running-config exit
Note
The exec-timeout command or any changes to the exec-command value is triggered only after you exit from the EXEC mode and login again.
DETAILED STEPS
Command or Action
Step 1
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
line console 0
Configures the console line and starts the line configuration command collection mode.
Example:
Router(config)# line console 0
Step 4
Example:
Router(config-line)# exec-timeout 0 0
Sets the idle privileged EXEC timeout, which is the interval that the privileged EXEC command interpreter waits until user input is detected.
Step 5
end
Example:
Router(config-line)# end
OL-5593-01
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
Command or Action
Step 6
show running-config
Example:
Router# show running-config
Verify that you properly configured the idle privileged EXEC timeout.
Step 7
exit
Example:
Router# exit
For the exec-timeout command to take effect, you must exit from the EXEC mode and login again.
Examples
The following example shows how to set the console idle privileged EXEC timeout to 2 minutes 30 seconds:
line console exec-timeout 2 30
The following example shows how to set the console idle privileged EXEC timeout to 10 seconds:
line console exec-timeout 0 10
What to Do Next
Proceed to the Configuring Fast Ethernet and Gigabit Ethernet Interfaces section on page 7.
Note
Cisco 1841 and Cisco 2801 routers have a hardware limitation on the Fast Ethernet ports FE0/0 and FE0/1. In half-duplex mode, when traffic reaches or exceeds 100% capacity (equal to or greater than 5 Mbps in each direction), the interface will experience excessive collisions and reset once per second. To avoid this problem, traffic must be limited to less than 100% of capacity.
SUMMARY STEPS
1. 2. 3. 4.
enable show ip interface brief configure terminal interface {fastethernet | gigabitethernet} 0/port
Basic Software Configuration Using the Cisco IOS Command-Line Interface OL-5593-01
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
5. 6. 7. 8. 9.
description string ip address ip-address mask no shutdown end show ip interface brief
DETAILED STEPS
Command or Action
Step 1
enable
Example:
Router> enable
Step 2
Displays a brief status of the interfaces that are configured for IP.
Example:
Router# show ip interface brief
Learn which type of Ethernet interface is on your router: Fast Ethernet or Gigabit Ethernet.
Step 3
configure terminal
Example:
Router# configure terminal
Step 4
Example:
Router(config)# interface fastethernet 0/1
For information on interface numbering, see the quick start guide that shipped with your router.
Example:
Router(config)# interface gigabitethernet 0/0
Step 5
description string
Example:
Router(config-if)# description FE int to 2nd floor south wing
The description helps you remember what is attached to this interface. The description can be useful for troubleshooting.
Step 6
Example:
Router(config-if)# ip address 172.16.74.3 255.255.255.0
Step 7
no shutdown
Enables an interface.
Example:
Router(config-if)# no shutdown
OL-5593-01
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
Command or Action
Step 8
end
Example:
Router(config)# end
Step 9
Displays a brief status of the interfaces that are configured for IP.
Example:
Router# show ip interface brief
Examples
Configuring the Fast Ethernet Interface: Example
! interface FastEthernet0/0 description FE int to HR group ip address 172.16.3.3 255.255.255.0 duplex auto speed auto no shutdown !
What to Do Next
Proceed to the Specifying a Default Route or Gateway of Last Resort section on page 9.
SUMMARY STEPS
1.
enable
Basic Software Configuration Using the Cisco IOS Command-Line Interface OL-5593-01
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
2. 3. 4. 5.
configure terminal ip routing ip route dest-prefix mask next-hop-ip-address [admin-distance] [permanent] ip default-network network-number or ip route dest-prefix mask next-hop-ip-address end show ip route
6. 7.
DETAILED STEPS
Command or Action
Step 1
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
ip routing
Enables IP routing.
Example:
Router(config)# ip routing
Step 4
Example:
Router(config)# ip route 192.168.24.0 255.255.255.0 172.28.99.2
Step 5
Selects a network as a candidate route for computing the gateway of last resort. Creates a static route to network 0.0.0.0 0.0.0.0 for computing the gateway of last resort.
Example:
Router(config)# ip default-network 192.168.24.0
Example:
Router(config)# ip route 0.0.0.0 0.0.0.0 172.28.99.1
10
OL-5593-01
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
Command or Action
Step 6
end
Example:
Router(config)# end
Step 7
show ip route
Example:
Router# show ip route
Basic Software Configuration Using the Cisco IOS Command-Line Interface OL-5593-01
11
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
Examples
Specifying a Default Route: Example
! ip routing ! ip route 192.168.24.0 255.255.255.0 172.28.99.2 ! ip default-network 192.168.24.0 !
What to Do Next
Proceed to the Configuring Virtual Terminal Lines for Remote Console Access section on page 12.
SUMMARY STEPS
1. 2. 3.
12
OL-5593-01
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
4. 5. 6. 7. 8.
password password login end show running-config From another network device, attempt to open a Telnet session to the router.
DETAILED STEPS
Command or Action
Step 1
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
Starts the line configuration command collection mode for the virtual terminal lines (vty) for remote console access.
Note
Example:
Router(config)# line vty 0 4
Make sure that you configure all vty lines on your router. To verify the number of vty lines on your router, use the line vty ? command.
Step 4
password password
Example:
Router(config-line)# password guessagain
Step 5
login
Example:
Router(config-line)# login
Step 6
end
Example:
Router(config-line)# end
Basic Software Configuration Using the Cisco IOS Command-Line Interface OL-5593-01
13
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
Command or Action
Step 7
show running-config
Example:
Router# show running-config
Verify that you properly configured the virtual terminal lines for remote access.
Step 8
From another network device, attempt to open a Telnet Verifies that you can remotely access the router and that the session to the router. virtual terminal line password is correctly configured.
Example:
Router# 172.16.74.3 Password:
Examples
The following example shows how to configure virtual terminal lines with a password:
! line vty 0 4 password guessagain login !
What to Do Next
After you configure the vty lines, follow these steps:
(Optional) To encrypt the virtual terminal line password, see the Configuring Passwords and Privileges chapter in the Cisco IOS Security Configuration Guide. Also see the Cisco IOS Password Encryption Facts tech note. (Optional) To secure the VTY lines with an access list, see Part 3: Traffic Filtering and Firewalls in the Cisco IOS Security Configuration Guide. To continue with the basic software configuration for your router, proceed to the Configuring the Auxiliary Line section on page 14.
14
OL-5593-01
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
Configuring AUX-to-AUX Port Async Backup with Dialer Watch, sample configuration http://www.cisco.com/warp/public/471/aux-aux-watch.html Modem-Router Connection Guide, tech note http://www.cisco.com/warp/public/76/9.html
SUMMARY STEPS
1. 2. 3. 4.
enable configure terminal line aux 0 See the tech notes and sample configurations to configure the line for your particular implementation of the AUX port.
DETAILED STEPS
Command or Action
Step 1
enable
Example:
Router> enable
Step 2
configure terminal
Example:
Router# configure terminal
Step 3
line aux 0
Starts the line configuration command collection mode for the auxiliary line.
Example:
Router(config)# line aux 0
Step 4
See the tech notes and sample configurations to configure the line for your particular implementation of the AUX port.
What to Do Next
Proceed to the Verifying Network Connectivity section on page 15.
Basic Software Configuration Using the Cisco IOS Command-Line Interface OL-5593-01
15
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
Prerequisites
Complete all previous configuration tasks in this document. The router must be connected to a properly configured network host.
SUMMARY STEPS
1. 2. 3.
DETAILED STEPS
Command or Action
Step 1
enable
Example:
Router> enable
Step 2
Example:
Router# ping 172.16.74.5
To verify connectivity, ping the next hop router or connected host for each configured interface to.
Step 3
Example:
Router# telnet 10.20.30.40
If you want to test the vty line password, perform this step from a different network device, and use your routers IP address.
Examples
The following display shows sample output for the ping command when you ping the IP address 192.168.7.27:
Router# ping Protocol [ip]: Target IP address: 192.168.7.27 Repeat count [5]: Datagram size [100]: Timeout in seconds [2]: Extended commands [n]: Sweep range of sizes [n]: Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.7.27, timeout is 2 seconds: !!!!! Success rate is 100 percent, round-trip min/avg/max = 1/2/4 ms
16
OL-5593-01
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
The following display shows sample output for the ping command when you ping the IP hostname donald:
Router# ping donald Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.7.27, timeout is 2 seconds: !!!!! Success rate is 100 percent, round-trip min/avg/max = 1/3/4 ms
What to Do Next
Proceed to the Saving Your Router Configuration section on page 17.
SUMMARY STEPS
1. 2.
DETAILED STEPS
Command or Action
Step 1
enable
Example:
Router> enable
Step 2
Example:
Router# copy running-config startup-config
What to Do Next
Proceed to the Saving Backup Copies of Your Configuration and System Image section on page 17.
Basic Software Configuration Using the Cisco IOS Command-Line Interface OL-5593-01
17
How to Perform a Basic Software Configuration Using the Cisco IOS CLI
SUMMARY STEPS
1. 2. 3. 4.
enable copy nvram:startup-config {ftp: | rcp: | tftp:} show flash: copy flash: {ftp: | rcp: | tftp:}
DETAILED STEPS
Command or Action
Step 1
enable
Example:
Router> enable
Step 2
The configuration file copy can serve as a backup copy. Enter the destination URL when prompted.
Example:
Router# copy nvram:startup-config ftp:
Step 3
show flash:
Example:
Router# show flash:
Step 4
Example:
Router# copy flash: ftp:
Copy the system image file to a server to serve as a backup copy. Enter the filename and destination URL when prompted.
Examples
Copying the Startup Configuration to a TFTP Server: Example
The following example shows the startup configuration being copied to a TFTP server:
Router# copy nvram:startup-config tftp: Remote host[]? 172.16.101.101 Name of configuration file to write [rtr2-confg]? <cr> Write file rtr2-confg on host 172.16.101.101?[confirm] <cr> ![OK]
The following example shows the use of the show flash: command in privileged EXEC to learn the name of the system image file and the use of the copy flash: tftp: privileged EXEC command to copy the system image (c3640-2is-mz) to a TFTP server. The router uses the default username and password.
18
OL-5593-01
Where to Go Next
Router# show flash: System flash directory: File Length Name/status 1 4137888 c3640-c2is-mz [4137952 bytes used, 12639264 available, 16777216 total] 16384K bytes of processor board System flash (Read/Write)\ Router# copy flash: tftp: IP address of remote host [255.255.255.255]? 172.16.13.110 filename to write on tftp host? c3600-c2is-mz writing c3640-c2is-mz !!!!... successful ftp write.
Where to Go Next
When you complete the basic software configuration, consider implementing routing protocols or access lists and other security-improving methods to protect your router. See the documents listed in the Related DocumentsAdditional Configuration section on page 20. To configure features on your router, see Finding Feature Documentation.
Additional References
The following sections provide references related to basic software configuration using the Cisco IOS CLI.
Basic Software Configuration Using the Cisco IOS Command-Line Interface OL-5593-01
19
Additional References
Topic Configuring virtual terminal lines Configuring the auxiliary (AUX) port
Related Document Title or Link Cisco IOS Terminal Services Configuration Guide Configuring a Modem on the AUX Port for EXEC Dialin Connectivity, tech note Configuring Dialout Using a Modem on the AUX Port, sample configuration Connecting a SLIP/PPP Device to a Routers AUX Port, tech note Configuring AUX-to-AUX Port Async Backup with Dialer Watch, sample configuration Modem-Router Connection Guide, tech note
To view this document, you must have an account on Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at the login dialog box and follow the instructions that appear.
Technical Assistance
Description Technical Assistance Center (TAC) home page, containing 30,000 pages of searchable technical content, including links to products, technologies, solutions, technical tips, and tools. Registered Cisco.com users can log in from this page to access even more content. Link http://www.cisco.com/public/support/tac/home.shtml
20
OL-5593-01
Additional References
CCVP, the Cisco logo, and Welcome to the Human Network are trademarks of Cisco Systems, Inc.; Changing the Way We Work, Live, Play, and Learn is a service mark of Cisco Systems, Inc.; and Access Registrar, Aironet, Catalyst, CCDA, CCDP, CCIE, CCIP, CCNA, CCNP, CCSP, Cisco, the Cisco Certified Internetwork Expert logo, Cisco IOS, Cisco Press, Cisco Systems, Cisco Systems Capital, the Cisco Systems logo, Cisco Unity, Enterprise/Solver, EtherChannel, EtherFast, EtherSwitch, Fast Step, Follow Me Browsing, FormShare, GigaDrive, HomeLink, Internet Quotient, IOS, iPhone, IP/TV, iQ Expertise, the iQ logo, iQ Net Readiness Scorecard, iQuick Study, LightStream, Linksys, MeetingPlace, MGX, Networkers, Networking Academy, Network Registrar, PIX, ProConnect, ScriptShare, SMARTnet, StackWise, The Fastest Way to Increase Your Internet Quotient, and TransPath are registered trademarks of Cisco Systems, Inc. and/or its affiliates in the United States and certain other countries. All other trademarks mentioned in this document or Website are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (0711R)
Basic Software Configuration Using the Cisco IOS Command-Line Interface OL-5593-01
21
Additional References
22
OL-5593-01