|
|
This chapter describes how to work with switch configuration files on the Catalyst 6000 family switches.
This chapter consists of these sections:
Creating configuration files can aid in the configuration of your switch. Configuration files can contain some or all the commands needed to configure one or more switches. For example, you might want to download the same configuration file to several switches that have the same hardware configuration so that they have identical module and port configurations.
Use the following guidelines when creating a configuration file:
When creating a configuration file, you must list commands in a logical way so that the system can respond appropriately. One method of creating a configuration file is as follows:
Step 1 Download an existing configuration from a switch.
Step 2 Open the configuration file in a text editor, such as vi or emacs on UNIX or Notepad on a PC.
Step 3 Extract the portion of the configuration file with the desired commands and save it in a new file. Make sure the file begins with the word begin on a line by itself and ends with the word end on a line by itself.
Step 4 Copy the configuration file to the appropriate TFTP directory on the workstation (usually /tftpboot on a UNIX workstation).
Step 5 Make sure the permissions on the file are set to world-read.
This example shows an example configuration file. This file could be used to set the Domain Name System (DNS) configuration on multiple switches.
begin ! #dns set ip dns server 172.16.10.70 primary set ip dns server 172.16.10.140 set ip dns enable set ip dns domain corp.com end
You can configure the switch using configuration files you create or download from another switch. In addition, you can store configuration files on Flash devices on hardware that supports the Flash file system, and you can configure the switch using a configuration stored on a Flash device.
These sections describe how to configure the switch using configuration files downloaded from a TFTP server or stored on a Flash device:
Before you begin downloading a configuration file using TFTP, do the following:
tftp dgram udp wait root /usr/etc/in.tftpd in.tftpd -p -s /tftpboot
tftp 69/udp
Use this procedure to configure the switch using a configuration file downloaded from a TFTP server:
Step 1 Copy the configuration file to the appropriate TFTP directory on the workstation.
Step 2 Log into the switch through the console port or a Telnet session.
Step 3 Configure the switch using the configuration file downloaded from the TFTP server with the copy tftp config command. Specify the IP address or host name of the TFTP server and the name of the file to download.
The configuration file downloads and the commands are executed as the file is parsed line-by-line.
This example shows how to configure the switch using a configuration file downloaded from a TFTP server:
Console> (enable) copy tftp config IP address or name of remote host []? 172.20.52.3 Name of file to copy from []? dns-config.cfg Configure using tftp:dns-config.cfg (y/n) [n]? y / Finished network download. (134 bytes) >> >> set ip dns server 172.16.10.70 primary 172.16.10.70 added to DNS server table as primary server. >> set ip dns server 172.16.10.140 172.16.10.140 added to DNS server table as backup server. >> set ip dns enable DNS is enabled >> set ip dns domain corp.com Default DNS domain name set to corp.com Console> (enable)
Use this procedure to configure a switch using a configuration file stored on a Flash device in the Flash file system:
Step 1 Log into the switch through the console port or a Telnet session.
Step 2 Locate the configuration file using the cd and dir commands (for more information, see "Working With the Flash File System").
Step 3 Configure the switch using the configuration file stored on the Flash device using the copy file-id config command.
The commands are executed as the file is parsed line-by-line.
This example shows how to configure the switch using a configuration file stored on a Flash device:
Console> (enable) copy slot0:dns-config.cfg config Configure using slot0:dns-config.cfg (y/n) [n]? y Finished network download. (134 bytes) >> >> set ip dns server 172.16.10.70 primary 172.16.10.70 added to DNS server table as primary server. >> set ip dns server 172.16.10.140 172.16.10.140 added to DNS server table as backup server. >> set ip dns enable DNS is enabled >> set ip dns domain corp.com Default DNS domain name set to corp.com Console> (enable) Console> (enable)
These sections describe how to upload the running configuration or a configuration file stored on a Flash device to a TFTP server:
Before you attempt to upload a configuration file to a TFTP server, do the following:
tftp dgram udp wait root /usr/etc/in.tftpd in.tftpd -p -s /tftpboot
tftp 69/udp
Use this procedure to upload a configuration file from a switch to a TFTP server for storage:
Step 1 Log into the switch through the console port or a Telnet session.
Step 2 Upload the switch configuration to the TFTP server with the copy config tftp command. Specify the IP address or host name of the TFTP server and the destination filename.
The file is uploaded to the TFTP server.
This example shows how to upload the running configuration to a TFTP server for storage:
Console> (enable) copy config tftp IP address or name of remote host []? 172.20.52.3 Name of file to copy to []? cat6000_config.cfg Upload configuration to tftp:cat6000_config.cfg, (y/n) [n]? y ..... .......... ....... .......... ........... .. / Configuration has been copied successfully. Console> (enable)
Remote copy protocol (rcp) provides another method of downloading, uploading, and copying configuration files between remote hosts and the switch. Unlike TFTP which uses User Datagram Protocol (UDP), a connectionless protocol, rcp uses Transmission Control Protocol (TCP), which is connection-oriented.
To use rcp to copy files, the server from or to which you will be copying files must support rcp. The rcp copy commands rely on the rsh server (or daemon) on the remote system. To copy files using rcp, you do not need to create a server for file distribution, as you do with TFTP. You need only to have access to a server that supports the remote shell (rsh). (Most UNIX systems support rsh.) Because you are copying a file from one place to another, you must have read permission on the source file and write permission on the destination file. If the destination file does not exist, rcp creates it for you.
These sections describe how to download a configuration file from an rcp server to the running configuration or to a Flash device:
Before you begin downloading a configuration file using rcp, do the following:
Use this procedure to configure a Catalyst 6000 family switch using a configuration file downloaded from an rcp server:
Step 1 Copy the configuration file to the appropriate rcp directory on the workstation.
Step 2 Log into the switch through the console port or a Telnet session.
Step 3 Configure the switch using the configuration file downloaded from the rcp server using the copy rcp config command. Specify the IP address or host name of the rcp server and the name of the file to download.
The configuration file downloads and the commands are executed as the file is parsed line-by-line.
This example shows how to configure a Catalyst 6000 family switch using a configuration file downloaded from an rcp server:
Console> (enable) copy rcp config IP address or name of remote host []? 172.20.52.3 Name of file to copy from []? dns-config.cfg Configure using rcp:dns-config.cfg (y/n) [n]? y / Finished network download. (134 bytes) >> >> set ip dns server 172.16.10.70 primary 172.16.10.70 added to DNS server table as primary server. >> set ip dns server 172.16.10.140 172.16.10.140 added to DNS server table as backup server. >> set ip dns enable DNS is enabled >> set ip dns domain corp.com Default DNS domain name set to corp.com Console> (enable)
These sections describe how to upload the running configuration or a configuration file stored on a Flash device to an rcp server:
Before you attempt to upload a configuration file to an rcp server, do the following:
Use this procedure to upload a configuration file from a switch to an rcp server for storage:
Step 1 Log into the switch through the console port or a Telnet session.
Step 2 Upload the switch configuration to the rcp server using the copy config rcp command. Specify the IP address or host name of the rcp server and the destination filename.
The file is uploaded to the rcp server.
This example shows how to upload the running configuration on a Catalyst 6000 family switch to an rcp server for storage:
Console> (enable) copy config rcp IP address or name of remote host []? 172.20.52.3 Name of file to copy to []? cat6000_config.cfg Upload configuration to rcp:cat6000_config.cfg, (y/n) [n]? y ..... .......... ....... .......... ........... .. / Configuration has been copied successfully. Console> (enable)
To clear the configuration on the entire switch, perform this task in privileged mode:
| Task | Command |
|---|---|
Clear the switch configuration. | clear config all |
This example shows how to clear the configuration for the entire switch:
Console> (enable) clear config all This command will clear all configuration in NVRAM. This command will cause ifIndex to be reassigned on the next system startup. Do you want to continue (y/n) [n]? y ........ ............................. System configuration cleared. Console> (enable)
To clear the configuration on an individual module, perform this task in privileged mode:
| Task | Command |
|---|---|
Clear the configuration for a specific module. | clear config mod_num |
This example shows how to clear the configuration on a specific module:
Console> (enable) clear config 2 This command will clear module 2 configuration. Do you want to continue (y/n) [n]? y ............................. Module 2 configuration cleared. Console> (enable)
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Posted: Mon Feb 21 15:59:05 PST 2000
Copyright 1989 - 2000©Cisco Systems Inc.