Basic Software Configuration Using The Cisco IOS Command-Line Interface
Basic Software Configuration Using The Cisco IOS Command-Line Interface
Basic Software Configuration Using The 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
• Where to Go Next, page 19
• Additional References, page 20
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.
SUMMARY STEPS
1. enable
2. configure terminal
3. hostname name
4. Verify that the router prompt displays your new hostname.
5. end
DETAILED STEPS
Example:
Router# configure terminal
Step 3 hostname name Specifies or modifies the hostname for the network server.
Example:
Router(config)# hostname myrouter
Step 4 Verify that the router prompt displays your new —
hostname.
Example:
myrouter(config)#
Step 5 end (Optional) Returns to privileged EXEC mode.
Example:
myrouter# end
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. enable
2. configure terminal
3. enable password password
4. enable secret password
5. end
6. enable
7. end
DETAILED STEPS
Example:
Router# configure terminal
Example:
Router(config)# end
Step 6 enable Enables privileged EXEC mode.
• Verify that your new enable or enable secret password
Example: works.
Router> enable
Step 7 end (Optional) Returns to privileged EXEC mode.
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.
SUMMARY STEPS
1. enable
2. configure terminal
3. line console 0
4. exec-timeout minutes [seconds]
5. end
6. show running-config
7. 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
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 exec-timeout minutes [seconds] Sets the idle privileged EXEC timeout, which is the interval
that the privileged EXEC command interpreter waits until
user input is detected.
Example:
Router(config-line)# exec-timeout 0 0 • The example shows how to specify no timeout.
Step 5 end Returns to privileged EXEC mode.
Example:
Router(config-line)# end
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. enable
2. show ip interface brief
3. configure terminal
4. interface {fastethernet | gigabitethernet} 0/port
5. description string
6. ip address ip-address mask
7. no shutdown
8. end
9. show ip interface brief
DETAILED STEPS
Example:
Router# configure terminal
Step 4 interface {fastethernet | gigabitethernet} Specifies the Ethernet interface and enters interface
0/port configuration mode.
Note For information on interface numbering, see the
Example: quick start guide that shipped with your router.
Router(config)# interface fastethernet 0/1
Example:
Router(config)# interface gigabitethernet 0/0
Step 5 description string (Optional) Adds a description to an interface configuration.
• The description helps you remember what is attached to
Example: this interface. The description can be useful for
Router(config-if)# description FE int to 2nd troubleshooting.
floor south wing
Step 6 ip address ip-address mask Sets a primary IP address for an interface.
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
Example:
Router(config)# end
Step 9 show ip interface brief Displays a brief status of the interfaces that are configured
for IP.
Example: • Verify that the Ethernet interfaces are up and
Router# show ip interface brief configured correctly.
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.
IP Routing
IP routing is automatically enabled in the Cisco IOS software. If you choose to set up the router to bridge
rather than route IP datagrams, then you must disable IP routing. When IP routing is disabled, the router
will act as an IP end host for IP packets destined for or sourced by it, whether or not bridging is enabled
for those IP packets not destined for the device.
Note This task section does not apply when IP routing is disabled. To specify a default route when IP routing
is disabled, refer to the Configuring a Gateway of Last Resort Using IP Commands tech note.
Default Routes
A router might not be able to determine the routes to all other networks. To provide complete routing
capability, the common practice is to use some routers as smart routers and give the remaining routers
default routes to the smart router. (Smart routers have routing table information for the entire
internetwork.) These default routes can be passed along dynamically, or can be configured into the
individual routers.
Most dynamic interior routing protocols include a mechanism for causing a smart router to generate
dynamic default information that is then passed along to other routers.
Default Network
If a router has an interface that is directly connected to the specified default network, the dynamic
routing protocols running on the router will generate or source a default route. In the case of RIP, the
router will advertise the pseudonetwork 0.0.0.0. In the case of IGRP, the network itself is advertised and
flagged as an exterior route.
A router that is generating the default for a network also may need a default of its own. One way a router
can generate its own default is to specify a static route to the network 0.0.0.0 through the appropriate
device.
SUMMARY STEPS
1. enable
2. configure terminal
3. ip routing
4. ip route dest-prefix mask next-hop-ip-address [admin-distance] [permanent]
5. ip default-network network-number
or
ip route dest-prefix mask next-hop-ip-address
6. end
7. show ip route
DETAILED STEPS
Example:
Router# configure terminal
Step 3 ip routing Enables IP routing.
Example:
Router(config)# ip routing
Step 4 ip route dest-prefix mask next-hop-ip-address Establishes a static route.
[admin-distance] [permanent]
Example:
Router(config)# ip route 192.168.24.0
255.255.255.0 172.28.99.2
Step 5 ip default-network network-number Selects a network as a candidate route for computing the
or gateway of last resort.
ip route dest-prefix mask next-hop-ip-address
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
Example:
Router(config)# end
Step 7 show ip route Displays the current routing table information.
• Verify that the gateway of last resort is set.
Example:
Router# show ip route
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 13.
SUMMARY STEPS
1. enable
2. configure terminal
3. line vty line-number [ending-line-number]
4. password password
5. login
6. end
7. show running-config
8. From another network device, attempt to open a Telnet session to the router.
DETAILED STEPS
Example:
Router# configure terminal
Step 3 line vty line-number [ending-line-number] Starts the line configuration command collection mode for
the virtual terminal lines (vty) for remote console access.
Example: • Make sure that you configure all vty lines on your
Router(config)# line vty 0 4 router.
Note To verify the number of vty lines on your router, use
the line vty ? command.
Example:
Router(config-line)# password guessagain
Step 5 login Enables password checking at login.
Example:
Router(config-line)# login
Step 6 end Returns to privileged EXEC mode.
Example:
Router(config-line)# end
Step 7 show running-config Displays the running configuration file.
• Verify that you properly configured the virtual terminal
Example: lines for remote access.
Router# show running-config
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 15.
http://www.cisco.com/warp/public/471/mod-aux-exec.html
Configuring Dialout Using a Modem on the AUX Port, sample configuration
http://www.cisco.com/warp/public/471/mod-aux-dialout.html
Connecting a SLIP/PPP Device to a Router’s AUX Port, tech note
http://www.cisco.com/warp/public/701/6.html
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. enable
2. configure terminal
3. line aux 0
4. See the tech notes and sample configurations to configure the line for your particular
implementation of the AUX port.
DETAILED STEPS
Example:
Router# configure terminal
What to Do Next
Proceed to the “Verifying Network Connectivity” section on page 16.
Prerequisites
• Complete all previous configuration tasks in this document.
• The router must be connected to a properly configured network host.
SUMMARY STEPS
1. enable
2. ping [ip-address | hostname]
3. telnet {ip-address | hostname}
DETAILED STEPS
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
The following display shows sample output for the ping command when you ping the IP hostname
donald:
Router# ping donald
What to Do Next
Proceed to the “Saving Your Router Configuration” section on page 17.
SUMMARY STEPS
1. enable
2. copy running-config startup-config
DETAILED STEPS
What to Do Next
Proceed to the “Saving Backup Copies of Your Configuration and System Image” section on page 18.
SUMMARY STEPS
1. enable
2. copy nvram:startup-config {ftp: | rcp: | tftp:}
3. show flash:
4. copy flash: {ftp: | rcp: | tftp:}
DETAILED STEPS
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:
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 Documents—Additional 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.
Technical Assistance
Description Link
Technical Assistance Center (TAC) home page, http://www.cisco.com/public/support/tac/home.shtml
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.
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)