ExportImportPolicyPackage icon indicating copy to clipboard operation
ExportImportPolicyPackage copied to clipboard

NAT rules are not exported with latest version (2021 June)

Open fjperez opened this issue 3 years ago • 6 comments

Dear all, I have just downloaded last version. It runs well, but for some reason, NAT rules are not exported (all NAT rules are manual rules). SMS has R80.40 JHF Take 94.

Python version is 2.7.9.

Have you any clue about this issue? Exported policy package is imported to other SMS, except NAT rules.

Kind regards.

fjperez avatar Jun 09 '21 14:06 fjperez

Hi @fjperez , Do you see NAT layer file in the export .tar.gz file? If not, you need to run export again with '--nat' flag set to True. Please let me know if it solve your issue.

Thanks, Roy

chkp-royl avatar Jun 09 '21 14:06 chkp-royl

Hi Roy. I dont see NAT layer in export .tar.gz file. How can I set --nat flag to True?

Thanks again for your help!

fjperez avatar Jun 10 '21 09:06 fjperez

There are two options:

  1. If you run tool with CLI command, you need to add parameter '--nat True' to your command.
  2. If you do it manually make sure after menu is printed that 'Export NAT layers = True' like in the picture below: image

Regards, Roy

chkp-royl avatar Jun 10 '21 15:06 chkp-royl

dear Roy For some reason, I cannot see export nat layers on Main menu. How can I check my script version? I suspect is not the same that you show.

fjperez avatar Jun 17 '21 08:06 fjperez

I am seeing the same issue. Downloaded the script via GitHub today 9/7/2021.

I have the following output:

Export Access-Control layers = True Export NAT layers = True Export Threat-Prevention layers = True Export HTTPS Inspection layers = True Output-file name = None

Exporting NAT policy

Getting information from show-nat-rulebase

Retrieved 50 out of 103 rules (48%)

Retrieved 100 out of 103 rules (97%)

Traceback (most recent call last): File "C:\Python37\ExportImportPolicyPackage\import_export_package.py", line 61, in export_package(client, args) File "C:\Python37\ExportImportPolicyPackage\exporting\export_package.py", line 65, in export_package nat_data_dict, nat_unexportable_objects = export_nat_rulebase(show_package.data["name"], client) File "C:\Python37\ExportImportPolicyPackage\exporting\export_nat_rulebase.py", line 13, in export_nat_rulebase rulebase_rules, general_objects = get_query_nat_rulebase_data(client, {"package": package}) File "C:\Python37\ExportImportPolicyPackage\exporting\export_objects.py", line 194, in get_query_nat_rulebase_data rulebase_items[len(rulebase_items) - 1]["rulebase"].extend(non_empty_rulebase_items[0]["rulebase"]) KeyError: 'rulebase'

C:\Python37\ExportImportPolicyPackage>python --version Python 3.7.9

russellstrei avatar Sep 07 '21 17:09 russellstrei

Hi @russellstrei , Thanks for finding this issue, it seems like bug in the tool. In order to investigate and reproduce this issue, please send API logs by run 'api status -s' on management machine and send the tar.gz file to [email protected]. We plan to deliver a fix for that in the next version of the tool.

Regards, Roy

chkp-royl avatar Sep 12 '21 12:09 chkp-royl