Udemyセール開催中!(〜4/1まで)

【Paloalto】ピアの機器(HA)と設定コンフィグを同期する方法【CLI】

当ブログは広告リンクを含みます。
  • URLをコピーしました!
目次

【Paloalto】ピアの機器と同期する方法

paloalto(PA-200)で検証を行っています。
今回はPaloalto(PA-200)で、HA構成でActive(正系)機器からPassive(副系、Active機器に対してのピア)機器へ設定コンフィグを同期する方法(CLI)をまとめていきます!

  • 機種はPA-200
  • OSのバージョンはsw-version: 8.0.19
  • 構成はActive/Passiveを想定

【CLI】ピアの機器と同期する方法

↓CLIでActive(正系)機器からPassive(副系、Active機器に対してのピア)機器へ設定コンフィグを同期するコマンドです。初期構築でHAを組んだ後に正系から副系にコンフィグを同期したい時に便利なコマンドです。

###Active機器、オペレーションモード###
request high-availability sync-to-remote running-config

【CLI】実行結果

↓Active(正系)機器にログインし、コマンドを入力します。

test-user@PA-200-first(active)> request high-availability sync-to-remote running-config 
Executing this command will overwrite the candidate configuration on the peer and trigger a commit on the peer. Do you want to continue(y/n)? (y or n) 
HA synchronization job has been queued on peer. Please check job status on peer. 
test-user@PA-200-first(active)>

↓コンフィグ同期後のHAステータスで以下であることを確認。

###理想のステータス###
Configuration Synchronization:
Enabled: yes
Running Configuration: synchronized 

以下、出力結果

admin@PA-200-first(active)> show high-availability state 
Group 10: 
  Mode: Active-Passive 
  Local Information: 
    Version: 1 
    Mode: Active-Passive 
    State: active (last 30 minutes) 
    Device Information: 
      Management IPv4 Address: 192.168.2.150/24 
      Management IPv6 Address: 
    HA1 Control Links Joint Configuration: 
      Encryption Enabled: no 
    Election Option Information: 
      Priority: 100 
      Preemptive: no 
    Version Compatibility: 
      Software Version: Mismatch 
      Application Content Compatibility: Match 
      Anti-Virus Compatibility: Match 
      Threat Content Compatibility: Match 
      VPN Client Software Compatibility: Match 
      Global Protect Client Software Compatibility: Match 
  Peer Information: 
    Connection status: up 
    Version: 1 
    Mode: Active-Passive 
    State: passive (last 10 minutes) 
    Device Information: 
      Management IPv4 Address: 192.168.2.151/24 
      Management IPv6 Address: 
      Connection up; Primary HA1 link 
      Connection up 
    Election Option Information: 
      Priority: 200 
      Preemptive: no 
  Configuration Synchronization: 
    Enabled: yes 
    Running Configuration: synchronized 
admin@PA-200-first(active)>

「Running Configuration: not synchronized 」の場合

「Running Configuration: not synchronized 」と表示される場合は、コンフィグ同期が正常にできておりません。理由は「Out-of-sync Reason」で表示されているはずです。

自分の場合は以下のような出力でした。両機器のコンフィグ差分を確認すると、Passive機器に不要な設定(差分)があったので、それを削除したら無事「Running Configuration: synchronized 」になりました。

「Running Configuration: synchronized 」のステータスの場合、Active(正系)機器でcommitすればPassive(副系)に設定がコンフィグ同期されます。

###コンフィグ同期がうまくできていなかった###

test-user@PA-200-first(active)> show high-availability state 

(省略)

  Configuration Synchronization: 
    Enabled: yes 
    Running Configuration: not synchronized 
      Out-of-sync Reason: Failure to complete config sync 
test-user@PA-200-first(active)>
###以下コンフィグの差分があったので削除したら、コンフィグ同期ステータスが「synchronized」になった###

test-user@PA-200-second(passive)# run show config diff 
 set config devices localhost.localdomain network profiles monitor-profile default threshold 5 
 set config devices localhost.localdomain network profiles monitor-profile default action wait-recover 
 set config devices localhost.localdomain network virtual-router 
-set config devices localhost.localdomain network ike gateway 
-set config devices localhost.localdomain network tunnel ipsec 
-set config devices localhost.localdomain network tunnel global-protect-gateway 
-set config devices localhost.localdomain network tunnel global-protect-site-to-site 
 set config devices localhost.localdomain deviceconfig system ack-login-banner yes 
 set config devices localhost.localdomain deviceconfig system ip-address 192.168.2.151 
 set config devices localhost.localdomain deviceconfig system netmask 255.255.255.0 
[edit] 

test-user@PA-200-second(passive)# commit 
WARNING: The running configuration is not currently synchronized to the HA peer, and therefore, this commit will only be applied to the local device. 
Please synchronize the peers by running 'request high-availability sync-to-remote running-config' first. 
Would you like to proceed with commit? (y or n) 
Commit job 7 is in progress. Use Ctrl+C to return to command prompt 
......................55%.....65%75%...98%.................100% 
Configuration committed successfully 

まとめ

最後にまとめになります!

  • 「request high-availability sync-to-remote running-config」は初期構築でHAを組んだ後に正系から副系にコンフィグを同期したい時に便利なコマンド!
  • 「Running Configuration: not synchronized 」の場合は、両系のコンフィグ差分をなくそう!

以上!

AWSエンジニアへの転職を目指すなら!

実務ベースのCI/CDパイプライン作成まで学べるAWSスクールでAWSエンジニアを目指そう!

目次