Udemyで最大90%オフの超お得セールが限定開催中!!(20-24日まで)

【Juniper,SRX】deactivate(無効化)しているPolicyをソートして確認する方法【CLI】

目次

deactivate(無効化)しているPolicyを確認する方法

あわせて読みたい
【Juniper,SRX】Policyをdeactivate(無効化)する設定方法【CLI】 【【Juniper,SRX】Policyをdeactivateする設定方法【CLI】】 暫定的にポリシーを無効化したい、けれどもポリシーは削除したくないという時があると思います。その際に、...

↑で暫定的にポリシーを無効化する設定をまとめました。

今度は、Juniper SRXでdeactivate(無効化)しているPolicyをソートして確認するCLI設定コマンドをまとめていきます。

複数のポリシーを作成しており一部は有効化、一部は無効化している状況で、無効化しているポリシーだけを確認する際に役立ったコマンドです。

【前提】複数のポリシーが設定されている

set security policies from-zone untrust to-zone trust policy test_deny match source-address any
set security policies from-zone untrust to-zone trust policy test_deny match destination-address any
set security policies from-zone untrust to-zone trust policy test_deny match application any
set security policies from-zone untrust to-zone trust policy test_deny then deny
deactivate security policies from-zone untrust to-zone trust policy test_deny

set security policies from-zone untrust to-zone trust policy test_deny2 match source-address any
set security policies from-zone untrust to-zone trust policy test_deny2 match destination-address any
set security policies from-zone untrust to-zone trust policy test_deny2 match application any
set security policies from-zone untrust to-zone trust policy test_deny2 then deny


set security policies from-zone untrust to-zone trust policy test_deny3 match source-address any
set security policies from-zone untrust to-zone trust policy test_deny3 match destination-address any
set security policies from-zone untrust to-zone trust policy test_deny3 match application any
set security policies from-zone untrust to-zone trust policy test_deny3 then deny
deactivate security policies from-zone untrust to-zone trust policy test_deny3

前提として複数のポリシーが設定されている、かつ、有効化されているポリシーと無効化されているポリシーが混在していることとします。

今回の例の場合では、test_deny2が有効化されており、test_deny1とtest_deny3は無効化されているとします。

deactivateしている対象ポリシーの確認

jcluser@vSRX-addr-0# show | match inactive      
            inactive: policy test_deny {
            inactive: policy test_deny3 {

[edit]

show | match inactive コマンドで「 inactive」と表示されているポリシーのみを抽出して確認できます。

jcluser@vSRX-addr-0# show | display set | match deactivate                     
deactivate security policies from-zone untrust to-zone trust policy test_deny
deactivate security policies from-zone untrust to-zone trust policy test_deny3

[edit]

set形式で表示させると「inactive」ではなく、「deactivate」と表示されます。
show | display set | match deactivate コマンドで「deactivate」と表示されているポリシーのみを抽出して確認できます。

まとめ

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

  • deactivate(無効化)しているPolicyをソートして確認するコマンド
  • show | match inactive
  • show | display set | match deactivate

deactivate(無効化)されているポリシーを確認した後に、activate(有効化)する手順は↓にまとめております。

あわせて読みたい
【Juniper,SRX】Policyをactivate(有効化)する設定方法【CLI】 【【Juniper,SRX】Policyをactivateする方法【CLI】】 https://nokonokonetwork.com/juniper/srx_cli_command_deactivate_policy.html ↑で暫定的にポリシーを無効化する...

以上!

目次