Cisco commands secugenius
Configuration File
Management Commands
This chapter provides
detailed descriptions of commands used to manage configuration files in Cisco
IOS Release 12.2. Configuration files contain the set of commands used to
customize the function of the Cisco IOS software.
For configuration
information and examples, refer to the "Managing Configuration
Files" chapter in the Release 12.2 Cisco IOS
Configuration Fundamentals Configuration Guide.
Cisco platforms
generally use one of three different Flash memory file system types. Some
commands are supported on only one or two file system types. This chapter
notes commands that are not supported on all file system types.
Some commands found in
this chapter in previous releases of this book have been replaced. Older
commands generally continue to provide the same functionality in the current
release, but are no longer documented. Support for the older version of these
commands may already be removed on your system, or may be removed in a future
Cisco IOS software release.
For more information
about these command replacements, see the description of the Cisco IOS File System
(IFS) in the "Using the Cisco IOS File System" chapter in the
Release 12.2 Cisco IOS Configuration Fundamentals Configuration
Guide.
Executing this command
has no effect on the system. Using this command will not generate CLI errors;
the boot buffersize command syntax is still allowed to be entered
at the CLI and in configuration files in order to accommodate existing
configuration scripts used by customers.
To specify the device
and filename of the configuration file from which the router configures
itself during initialization (startup), use the boot config global configuration
command. This command is only available on Class A file system platforms. To
remove the specification, use the no form of this command.
You set the
CONFIG_FILE environment variable in the current running memory when you use
the boot configcommand. This variable specifies the configuration
file used for initialization (startup). The configuration file must be an
ASCII file located in either NVRAM or Flash memory.
![]()
Note
![]()
The software displays
an error message and does not update the CONFIG_FILE environment variable in
the following situations:
•
![]()
The router uses the
NVRAM configuration during initialization when the CONFIG_FILE environment
variable does not exist or when it is null (such as at first-time startup).
If the software detects a problem with NVRAM or the configuration it
contains, the device enters setup mode. See the "Setup Command" chapter in this
publication for more information on the setup command facility.
When you use the no form of this command,
the router returns to using the default NVRAM configuration file as the
startup configuration.
In the following
example, the first line specifies that the router should use the
configuration file named router-config located in internal Flash memory to
configure itself during initialization. The third line copies the
specification to the startup configuration, ensuring that this specification
will take effect upon the next reload.
The following example
instructs a Cisco 7500 series router to use the configuration file named
router-config located on the Flash memory card inserted in the second PCMCIA
slot of the RSP card during initialization. The third line copies the
specification to the startup configuration, ensuring that this specification
will take effect upon the next reload.
To specify the host-specific configuration
file to be used at the next system startup, use the boot host global configuration
command. To restore the host configuration filename to the default, use the no form of this command.
If you do not specify
a filename using this command, the router uses its
configured host name to request a configuration file from a remote server. To
form the configuration filename, the router converts its name to all
lowercase letters, removes all domain information, and appends -confg or -config.
This command instructs
the system to "Boot using network configuration file x," where x is the filename
specified in the remote-url argument. This command specifies the remote
location and filename of the network configuration file to be used at the
next system startup, as well as the protocol to be used to obtain the file.
When booting from a
network server, routers ignore routing information, static IP routes, and
bridging information. As a result, intermediate routers are responsible for
handling FTP, rcp, or TFTP requests. Before booting from a network server,
verify that a server is available by using the ping command.
Use the service config command to enable the
loading of the specified configuration file at reboot time. Without this
command, the router ignores the boot network command and uses the
configuration information in NVRAM. If the configuration information in NVRAM
is invalid or missing, the service config command is enabled
automatically.
The network server will attempt to load two configuration files
from remote hosts. The first is the network configuration file containing
commands that apply to all network servers on a network. Use the boot networkcommand to identify
the network configuration file. The second is the host configuration file
containing commands that apply to one network server in particular. Use the boot host command to identify
the host configuration file.
Note
![]() With Cisco IOS Release 12.3(2)T , 12.3(1)B, and later, you no longer have to specify the service config command for the boot host or boot network command to be active. If you specify both the no service config command and the boot host command, the router attempts to find the specified host configuration file. The service config command can also be used without the boot host or boot network command. If you do not specify host or network configuration filenames, the router uses the default configuration files. The default network configuration file is network-confg. The default host configuration file is host-confg, where host is the hostname of the router. If the Cisco IOS software cannot resolve its hostname, the default host configuration file is router-confg.
The rcp software
requires that a client send the remote username on each rcp request to the
network server. If the server has a directory structure (such as UNIX
systems), the rcp implementation searches for the configuration files
starting in the directory associated with the remote username.
When you load a
configuration file from a server using rcp, the Cisco IOS software sends
the first valid username in the following list:
![]()
Note
![]()
The FTP protocol requires a client to send a remote username and
password on each FTP request to a server. The username and password must be
associated with an account on the FTP server. If the server has a directory
structure, the configuration file or image copied from the directory
associated with the username on the server. Refer to the documentation for
your FTP server for more details.
When you load a
configuration file from a server using FTP, the Cisco IOS software sends
the first valid username in the following list:
3.
![]()
To change the default name of the network
configuration file from which to load configuration commands, use theboot
network global configuration command. To restore the network
configuration filename to the default, use the no form of this command.
This command instructs
the system to "Boot using network configuration file x," where x is the filename
specified in the remote-url argument. This command specifies the remote
location and filename of the network configuration file to be used at the
next system startup, as well as the protocol to be used to obtain the file.
When booting from a
network server, routers ignore routing information, static IP routes, and
bridging information. As a result, intermediate routers are responsible for
handling FTP, rcp, or TFTP requests. Before booting from a network server,
verify that a server is available by using the ping command.
Use the service config command to enable the
loading of the specified configuration file at reboot time. Without this
command, the router ignores the boot network command and uses the
configuration information in NVRAM. If the configuration information in NVRAM
is invalid or missing, the service config command is enabled
automatically.
The network server will attempt to load two configuration files
from remote hosts. The first is the network configuration file containing
commands that apply to all network servers on a network. Use the boot networkcommand to identify
the network configuration file. The second is the host configuration file
containing commands that apply to one network server in particular. Use the boot host command to identify
the host configuration file.
Note
![]() With Cisco IOS Release 12.3(2)T , 12.3(1)B, and later, you no longer have to specify the service config command for the boot host or boot network command to be active. If you specify both the no service config command and the boot host command, the router attempts to find the specified host configuration file. The service config command can also be used without the boot host or boot network command. If you do not specify host or network configuration filenames, the router uses the default configuration files. The default network configuration file is network-confg. The default host configuration file is host-confg, where host is the hostname of the router. If the Cisco IOS software cannot resolve its hostname, the default host configuration file is router-confg.
The rcp software
requires that a client send the remote username on each rcp request to the
network server. If the server has a directory structure (such as UNIX
systems), the rcp implementation searches for the configuration files
starting in the directory associated with the remote username.
When you load a
configuration file from a server using rcp, the Cisco IOS software sends
the first valid username in the following list:
![]()
Note
![]()
The FTP protocol requires a client to send a remote username and
password on each FTP request to a server. The username and password must be
associated with an account on the FTP server. If the server has a directory
structure, the configuration file or image copied from the directory
associated with the username on the server. Refer to the documentation for
your FTP server for more details.
When you load a
configuration file from a server using FTP, the Cisco IOS software sends
the first valid username in the following list:
3.
![]()
The following example
changes the network configuration filename to bridge_9.1 and uses the default
broadcast address:
The following example
changes the network configuration filename to bridge_9.1, specifies that rcp
is to be used as the transport mechanism, and gives 172.16.1.111 as the IP
address of the server on which the network configuration file resides:
To clear the parse cache
entries and hit/miss statistics stored for the Parser Cache feature, use the clear parser
cache command in privileged EXEC mode.
The Parser Cache
feature optimizes the parsing (translation and execution) of Cisco IOS
software configuration command lines by remembering how to parse recently
encountered command lines, decreasing the time required to process large
configuration files.
The clear parser cache command will free the
system memory used by the Parser Cache feature and will erase the hit/miss
statistics stored for the output of the show parser statistics EXEC command. This
command is only effective when the Parser Cache feature is enabled.
To enter global
configuration mode or to configure the system from the system memory, use the configure terminal privileged EXEC
command.
Use this command to
enter global configuration mode. Note that commands in this mode are written
to the running configuration file as soon as you enter them (using the Enter
key or Carriage Return).
After you enter the configure command, the system
prompt changes from <router-name># to <router-name>(config)#, indicating that
the router is in global configuration mode. To leave global configuration mode
and return to the privileged EXEC prompt, type end or press Ctrl-Z.
To view the changes to
the configuration you have made, use the more system:running-config command orshow
running-config command in EXEC mode.
On all platforms
except Class A Flash file system platforms, this command executes the
commands located in in the configuration file in NVRAM (the "startup
configuration file").
On Class A Flash file
system platforms, if you specify the configure memory command, the router
executes the commands pointed to by the CONFIG_FILE environment variable. The CONFIG_FILE
environment variable specifies the location of the configuration file that
the router uses to configure itself during initialization. The file can be
located in NVRAM or any of the Flash file systems supported by the platform.
When the CONFIG_FILE
environment variable specifies NVRAM, the router executes the NVRAM
configuration only if it is an entire configuration, not a distilled version.
A distilled configuration is one that does not contain access lists.
To view the contents
of the CONFIG_FILE environment variable, use the show bootvar EXEC command. To
modify the CONFIG_FILE environment variable, use the boot config command and then save
your changes by issuing the copy system:running-config nvram:startup-config command.
After you enter the configure terminal command, the system
prompt changes from <router-name># to <router-name>(config)#, indicating that
the router is in global configuration mode. To leave global configuration
mode and return to the privileged EXEC prompt, use the end command.
In the following
example, a router is configured from the configuration file in the memory
location pointed to by the CONFIG_FILE environment variable:
The configure overwrite-network has been replaced by
the copy {ftp-url | rcp-url | tftp-url} nvram:startup-configcommand. See the
description of the copy command in the "Cisco IOS File System Commands" chapter for more
information.
To reenable the Cisco
IOS software parser cache after disabling it, use the parser cache global configuration
command. To disable the parser cache, use the no form of this command.
The Parser Cache
feature optimizes the parsing (translation and execution) of Cisco IOS
software configuration command lines by remembering how to parse recently
encountered command lines, decreasing the time required to process large
configuration files.
The parser cache is
enabled by default. However, if you wish to disable the parser cache, you may
do so using the no parser cache command in global configuration mode. To
reenable the parser cache after it has been disabled, use the parser cache command.
When the no parser cache is issued, the command
line appears in the running configuration file. However, if the parser cache
is reenabled, no command line appears in the running configuration file.
To compress startup
configuration files, use the service
compress-config global configuration command. To disable compression, use the no form of this command.
After you configure
the service compress-config command, the router will compress
configuration files every time you save a configuration to the startup
configuration. For example, when you enter the copy
system:running-config nvram:startup-config command, the running
configuration will be compressed before storage in NVRAM.
One way to determine
whether a configuration file will be compressed enough to fit into NVRAM is
to use a text editor to enter the configuration, then use the UNIX compress command to check the
compressed size. To get a closer approximation of the compression ratio, use
the UNIX compress -b12 command.
Once the configuration
file has been compressed, the router functions normally. At boot time, the
system recognizes that the configuration file is compressed, uncompresses it,
and proceeds normally. A partition nvram:startup-config command uncompresses
the configuration before displaying it.
To disable compression
of the configuration file, enter configuration mode and specify the no service
compress-config command. Then, exit global configuration mode and enter the copy
system:running-config nvram:startup-config command. The router
displays an OK message if it is able to write the uncompressed configuration
to NVRAM. Otherwise, the router displays an error message indicating that the
configuration is too large to store. If the configuration file is larger than
the physical NVRAM, the following message is displayed:
When the file is
truncated, commands at the end of the file are erased. Therefore, you will
lose part of your configuration. To truncate and save the configuration, type Y. To not truncate and
not save the configuration, typeN.
To enable autoloading
of configuration files from a network server, use the service config global configuration
command. To restore the default, use the no form of this command.
Disabled, except on
systems without NVRAM or with invalid or incomplete information in NVRAM. In
these cases, autoloading of configuration files from a network server is
enabled automatically.
Usually, the service
config command is used in conjunction with the boot host or boot network command. You must
enter the service config command to enable the router to automatically
configure the system from the file specified by the boot host or boot network command.
With IOS software
versions 12.3(2)T , 12.3(1)B, and later, you no longer have to specify the
service config command for the boot host or boot network command to be active.
If you specify both the no service config command and the boot host command, the router
attempts to find the specified host configuration file. The service config
command can also be used without the boot host or boot network command. If you do not
specify host or network configuration filenames, the router uses the default
configuration files. The default network configuration file is network-confg.
The default host configuration file is host-confg, where host is the hostname
of the router. If the Cisco IOS software cannot resolve its hostname, the
default host configuration file is router-confg.
In the following
example, a router is configured to autoload the default network and host configuration
files. Because no boot host or boot network commands are specified, the router uses the broadcast address to
request the files from a TFTP server.
The following example
changes the network configuration filename to bridge_9.1, specifies that rcp
is to be used as the transport mechanism, and gives 172.16.1.111 as the IP
address of the server on which the network configuration file resides:
The show configuration command has been
replaced by the show startup-config and more nvram:startup-config commands. See the
description of the more command in the "Cisco IOS File System Commands"chapter for more
information.
To display the
composite results of all the configuration commands that apply to an
interface, including commands that come from sources such as static
templates, dynamic templates, dialer interfaces, and authentication,
authorization, and accounting (AAA) per-user attributes, use the show derived-config command in privileged
EXEC mode.
Configuration commands
can be applied to an interface from sources such as static templates, dynamic
templates bound by resource pooling, dialer interfaces, AAA per-user
attributes and the configuration of the physical interface. The show derived-config command displays all
the commands that apply to an interface.
The output for the show derived-config command is nearly
identical to that of the show running-configcommand. It differs when the configuration for
an interface is derived from a template, a dialer interface, or some per-user
configuration. In those cases, the commands derived from the template, dialer
interface, and so on, will be displayed for the affected interface.
If the same command is
configured differently in two different sources that apply to the same
interface, the command coming from the source that has the highest precedence
will appear in the display.
The following examples
show sample output for the show running-config and show derived-config commands for serial
interface 0:23 and dialer interface 0. The output of the show running-config and show derived-configcommands is the same
for dialer interface 0 because none of the commands that apply to that
interface are derived from any sources other than the configuration of the
dialer interface. The output for the show running-config and show derived-config commands for serial
interface 0:23 differs because some of the commands that apply to serial
interface 0:23 come from dialer interface 0.
The show file command has been
replaced by the more command. See the description of the more command in the "Cisco IOS File System Commands" chapter for more
information.
To displays statistics
about the last configuration file parsed and the status of the Parser Cache
feature, use the show parser statistics command in privileged EXEC mode.
•
![]()
•
![]()
The Parser Cache
feature optimizes the parsing (translation and execution) of Cisco IOS
software configuration command lines by remembering how to parse recently
encountered command lines, decreasing the time required to process large
configuration files.
In this example, the
Parser Cache feature is disabled, but shows the hit/miss statistics for the
two commands issued while the parser cache was last enabled.
In the following
example the show parser statistics command is used to compare the parse-time of a
large configuration file with the Parser Cache feature disabled and enabled.
In this example, a configuration file with 1484 access list commands is
loaded into the running configuration.
These results show an
improvement to the load time for the same configuration file from
1272 milliseconds (ms) to 820 ms when the Parser Cache feature was
enabled. As indicated in the "hits" field of the show command output, 1460
commands were able to be parsed more efficiently by the parser cache.
To display the
contents of the currently running configuration file or the configuration for
a specific class map, interface, map class, policy map, or virtual circuit
(VC) class, use the show running-config command in privileged EXEC mode.
The show
running-config command without any arguments or keywords displays the entire
contents of the running configuration file.
The show running-config command is technically a command alias of the more
system:running-configcommand. Although more commands are recommended (due to their uniform
structure across platforms and their expandable syntax), the show running-config command remains
enabled to accommodate its widespread use, and to allow typing shortcuts such
as show run.
The show
running-config interface command is useful when there are multiple interfaces
and you want to look at the configuration of a specific interface.
The linenum keyword causes line
numbers to be displayed in the output. This option is useful for identifying
a particular portion of a very large configuration.
The following example
shows the configuration for Ethernet interface 0/0. Line numbers are
displayed in the output.
The following example
shows how to set line numbers in the command output, and then use the output
modifier to start the display at line 10:
To display only
map-class configuration information from the running configuration file, use
the show running-config map-class privileged EXEC
command.
show running-config map-class [atm [map-class-name]
| dialer [map-class-name]| frame-relay [map-class-name]]
Use the show running-config
map-class command to display the following information from the running
configuration file:
The following output
examples assume that a user has configured 2 Frame Relay map classes named
"cir60" and "cir70," 1 ATM map class named
"vc100," and 1 dialer map class named "dialer1."
To display the
contents of the configuration file that will be used at the next system
startup, use the show startup-config or more nvram:startup-config command in Privileged
EXEC mode.
The show startup-config command displays the
contents of NVRAM (if present and valid) or displays the configuration file
pointed to by the CONFIG_FILE environment variable.
As with all show commands, you can
specify the output you are interested in more precisely using the pipe (|)
option combined with the begin, include, and exclude keywords. For more information on these options, see the
documentation of the more begin, more exclude, more include, show begin, show exclude, and show includecommands.
In Cisco IOS Release 12.0 the show startup-config command was deprecated
in favor of themore nvram:startup-config command. Although more commands are
recommended (due to their uniform structure across platforms and their expandable
syntax), the show startup-config command remains enabled to accommodate its
widespread use, and to allow typing shortcuts such as show start.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
© 1992-2010 Cisco Systems, Inc. All rights reserved.
|
0 comments: