Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fjperez opened this issue Jun 9, 2021 · 6 comments
Open

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

fjperez opened this issue Jun 9, 2021 · 6 comments

Comments

@fjperez
Copy link

fjperez commented Jun 9, 2021

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.

@chkp-royl
Copy link
Contributor

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

@fjperez
Copy link
Author

fjperez commented Jun 10, 2021

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!

@chkp-royl
Copy link
Contributor

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

@fjperez
Copy link
Author

fjperez commented Jun 17, 2021

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.

@russellstrei
Copy link

russellstrei commented Sep 7, 2021

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

@chkp-royl
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants