Cisco Cisco ASA 5580 Adaptive Security Appliance Leaflet

Page of 904
 
33-31
Cisco ASA Series 
일반적인 작업 CLI 구성 가이드
 
33 
장     소프트웨어 및 구성 
  
구성 또는 기타 파일 백업 및 복원
시작하기 전에
ASA 
구성의 백업 및 복원에 스크립트를 사용하려면 먼저 다음 작업을 수행합니다.
Expect 
모듈로 Perl을 설치합니다.
ASA
에 연결할 수 있는 SSH 클라이언트를 설치합니다.
ASA
에서 백업 사이트에 파일을 보낼 수 있도록 TFTP 서버를 설치합니다.
또 다른 방법은 상용 툴을 사용하는 것입니다. 이 스크립트의 로직을 그 툴에 적용하면 됩니다.
스크립트 실행
백업 및 복원 스크립트를 실행하려면 다음 단계를 수행합니다.
절차
1
단계
시스템의 임의의 위치에 스크립트 파일을 다운로드하거나 잘라내어 붙여넣습니다.
2
단계
명령줄에 Perl scriptname을 입력합니다. 여기서 scriptname은 스크립트 파일의 이름입니다.
3
단계
Enter 
키를 누릅니다.
4
단계
시스템에서 각 옵션에 대한 값을 묻습니다. 또는 Perl scriptname 명령을 입력할 때 옵션에 대한 
값을 입력한 다음 Enter 키를 누르는 방법도 있습니다. 어느 쪽이든 스크립트에서는 각 옵션에 대
한 값을 입력해야 합니다.
5
단계
스크립트가 실행되기 시작하고 생성되는 명령을 출력합니다. 이는 CLI의 기록이 됩니다. 이 CLI
를 추후 복원에 사용할 수 있습니다. 이는 파일 한두 개만 복원하려는 경우 특히 유용합니다.
샘플 스크립트
#!/usr/bin/perl
#Description: The objective of this script is to show how to back up 
configurations/extensions. 
# It currently backs up the running configuration, all extensions imported via "import 
webvpn" command, the CSD configuration XML file, and the DAP configuration XML file.
#Requirements: Perl with Expect, SSH to the ASA, and a TFTP server.
#Usage: backupasa -option option_value
#       -h: ASA hostname or IP address
#       -u: User name to log in via SSH
#       -w: Password to log in via SSH
#       -e: The Enable password on the security appliance
#       -p: Global configuration mode prompt
#       -s: Host name or IP address of the TFTP server to store the configurations
#       -r: Restore with an argument that specifies the file name. This file is produced 
during backup. 
#If you don't enter an option, the script will prompt for it prior to backup.
#
#Make sure that you can SSH to the ASA.
use Expect;
use Getopt::Std;
#global variables
%options=();
$restore = 0; #does backup by default
$restore_file = '';