Juniper Configuration Backup

2024. 10. 27. 23:35·Network/Juniper Basic
  • Juniper는 'Configuration Save' 또는 'Configuration Rollback'으로 Configuration Backup 가능

1. Configuration Save

1) Configuration Save

  • 'save [filename.cfg]' 명령을 이용하여 Configuration 저장 가능
더보기
root@vMX1# save CONFIGURATION-BACKUP.cfg 
Wrote 40 lines of configuration to 'CONFIGURATION-BACKUP.cfg'

[edit]
root@vMX1> file show CONFIGURATION-BACKUP.cfg 
## Last changed: 2024-09-14 05:39:02 UTC
version 18.2R1.9;
system {
    root-authentication {
        encrypted-password "$6$QVOviCo/$yK1/xeaOLt8BO1mMcotP6wGgSqqdtdzhv4PuilG85QtUEVIGCujSn7rTewuu7ECQx5.JMGUoKy9OsCOulWi3Y1"; ## SECRET-DATA
    }
    host-name vMX1;
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
    processes {
        dhcp-service {
            traceoptions {
                file dhcp_logfile size 10m;
                level all;
                flag packet;
            }
        }
    }
}
interfaces {
    fxp0 {
        unit 0 {
            family inet {
                dhcp {
                    vendor-id Juniper-vmx-VM66D79FC7CC;
                }
            }
        }
    }
}
  • 'show | display set | save [filename.cfg]' 명령을 이용하여 'set' 기반 Configuration 저장 가능
더보기
root@vMX1# show | display set | save CONFIGURATION-BACKUP-SET.cfg 
Wrote 12 lines of output to 'CONFIGURATION-BACKUP-SET.cfg'

[edit]
root@vMX1> file show CONFIGURATION-BACKUP-SET.cfg 
set version 18.2R1.9
set system root-authentication encrypted-password "$6$QVOviCo/$yK1/xeaOLt8BO1mMcotP6wGgSqqdtdzhv4PuilG85QtUEVIGCujSn7rTewuu7ECQx5.JMGUoKy9OsCOulWi3Y1"
set system host-name vMX1
set system syslog user * any emergency
set system syslog file messages any notice
set system syslog file messages authorization info
set system syslog file interactive-commands interactive-commands any
set system processes dhcp-service traceoptions file dhcp_logfile
set system processes dhcp-service traceoptions file size 10m
set system processes dhcp-service traceoptions level all
set system processes dhcp-service traceoptions flag packet
set interfaces fxp0 unit 0 family inet dhcp vendor-id Juniper-vmx-VM66D79FC7CC
  • 'save' 명령을 이용하여 저장한 File은 '/root/' Directory에 저장
더보기
root@vMX1> file list 

/root/:
.cshrc@ -> /packages/mnt/os-runtime/root/.cshrc
.login@ -> /packages/mnt/os-runtime/root/.login
.profile@ -> /packages/mnt/os-runtime/root/.profile
CONFIGURATION-BACKUP.cfg
  • 'save' 명령을 이용하여 저장한 File을 FTP와 같은 프로토콜을 이용하여 PC로 복사 가능
  • 'show | compare [filename]' 명령을 이용하여 Configuration 비교 가능

 

2) Load Override

  • 'load override' 작업 시, 현재 'Candidate Configuration'이 'Backup File'로 완전히 변경
  • 현재 'Candidate Configuration'을 Discard 하고 'Backup File'의 Configuration을 Load

 

3) Load Replace

  • 장비의 일부 'Candidate Configuration'을 변경하려면 'replace' 옵션을 사용
  • 'replace' Option은 변경 중인 항목을 정확하게 제어하려는 경우에 유용하게 사용
  • 'load replace'는 load된 File에 추가한 'replace' Tag를 탐색하므로 'replace' Option이 작동하기 위해 File에 'replace' Tag가 필요
  • 'replace' Tag를 검색하고 'Candidate Configuration을 삭제하고 File에 있는 Configuration으로 변경
  • 'replace' Tag가 없는 상태에서 'replace' 작업을 수행하는 경우, 'replace' 작업은 'merge' 작업으로 실행

 

4) Load Merge

  • 'load merge' 작업은 저장된 파일을 'Candidate Configuration'과 병합
  • 'load merge'는 특정 Section에 New Configuration을 추가할 때 유용
  • 'Condidate Configuration'과 'File Configuration'에 충돌하는 문이 있는 경우, 'File Configuration'이 더 우선

 

 

2. Configuration Rollback

  • Juniper는 기본적으로 Configuration 저장 시, 자동으로 Rollback 파일을 생성
  • Commit 한 시점을 기록하여 특정 시간에 적용된 Configuration으로 Rollback 가능
  • Rollback 시, Active Configuration을 변경하는 것이 아니라 Candidate Configuration을 변경
  • 'rollback' 또는 'rollback 0' 입력 시,  Candidate Configuration이 마지막으로 'commit'을 입력한 시점으로 변경
  • Rollback 파일은 최대 50까지 생성 가능
    • 50개가 넘을 시, 오래된 것부터 순차적으로 제거
  • 'show | compare rollback 5' 입력 시, 현재 Candidate Configuration과 Rollback 5 파일의 Configuration을 비교
    • 추가되거나 제거되는 Configuration 확인 가능
더보기
root@vMX1# show | compare rollback 5   
[edit interfaces]
+   ge-0/0/0 {
+       unit 0 {
+           family bridge {
+               interface-mode trunk;
+               vlan-id-list [ 10 20 ];
+           }
+       }
+   }
+   ge-0/0/1 {
+       unit 0 {
+           family bridge {
+               interface-mode access;
+               vlan-id 10;
+           }
+       }
+   }
+   ge-0/0/2 {
+       unit 0 {
+           family bridge {
+               interface-mode access;
+               vlan-id 20;
+           }
+       }                               
+   }

[edit]
  • 'commit comment [text]' 명령을 이용하면 저장되는 파일에 원하는 Comment 입력 가능
    • 'show system commit' 명령을 이용하여 저장할 때 입력한 Comment 확인 가능
더보기
root@vMX1# commit comment ROLLBACK-TEST 
commit complete

[edit]
root@vMX1# run show system commit          
0   2024-09-13 05:07:28 UTC by root via cli
    ROLLBACK-TEST
1   2024-09-05 08:15:27 UTC by root via cli
2   2024-09-05 08:09:13 UTC by root via cli
3   2024-09-05 08:00:42 UTC by root via cli
4   2024-09-05 08:00:23 UTC by root via cli
5   2024-09-05 07:49:15 UTC by root via cli

 

 

3. Configuration Text File Save

  • 단순히 CLI 입력 시, Log를 수집하는 방식
  • Ex) show configuration | display set | no-more 

 

저작자표시 비영리 변경금지 (새창열림)

'Network > Juniper Basic' 카테고리의 다른 글

Juniper Packet Capture(pcap)  (0) 2025.05.17
Juniper Monitor Traffic  (0) 2025.05.15
Juniper Traceoption(debug)  (0) 2025.05.01
Juniper Interface Types and Naming  (2) 2024.10.25
Juniper Candidate vs Active Configuration  (0) 2024.10.23
Juniper CLI Mode  (0) 2024.10.21
'Network/Juniper Basic' 카테고리의 다른 글
  • Juniper Monitor Traffic
  • Juniper Traceoption(debug)
  • Juniper Interface Types and Naming
  • Juniper Candidate vs Active Configuration
ant-choi의 네트워크
ant-choi의 네트워크
안녕하세요. 네트워크 엔지니어로 근무하고 있는 직장인 입니다. 2024.08.26부터 새로운 버전으로 블로그를 개설하였습니다. 제가 스터디한 내용이나 회사에서 업무 진행 시, 필요한 내용들을 정리하여 업로드 하는 것을 목표로 하고 있습니다. 오류가 있거나 피드백이 있으신 분들은 댓글 남겨주시면 감사하겟습니다.
  • ant-choi의 네트워크
    ant-choi의 네트워크
    ant-choi의 네트워크
  • 전체
    오늘
    어제
    • 분류 전체보기 (141) N
      • Network (124) N
        • Juniper Software (0)
        • Juniper Basic (7)
        • Emulator (24)
        • Network Basic (11)
        • ARP, ICMP (14)
        • VLAN (22)
        • STP (0)
        • VRRP (11)
        • Link Aggregation (10)
        • MC-LAG (0)
        • Switching, Routing Basic (15)
        • DHCP (10) N
        • OSPF (0)
        • BGP (0)
        • Routing Instance (0)
        • VXLAN (0)
        • Issue (0)
      • Office (5)
        • Office 공통 (1)
        • Excel (1)
        • Power Point (1)
        • Word (2)
        • Outlook (0)
      • 기타 (12)
        • Windows (1)
        • Browser (4)
        • Tistory (7)
        • Notion (0)
        • Application (0)
  • 블로그 메뉴

    • hELLO· Designed By정상우.v4.10.3
    ant-choi의 네트워크
    Juniper Configuration Backup
    상단으로

    티스토리툴바