Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Gabriele_Di_Gia
Participant

import R80.X policy pack by perl script import_policy_pack.pl

Dear CheckMates I create a perl script that helps me to import an R80.X policy from an CSV file exported from my R80.10 management upgradaded from R77.30.

the most important thing is that you must export an csv file from R80.X smartconsole following this example:

No.,Type,Name,Source,Destination,VPN,Services & Applications,Content,Time,Action,Track,Install On,Comments

Comments can be un-exported..

and delete the first 2 rows ( the file must start with the rule n1)

copy the script and the file exported on a TMP folder

create a directory called "file_import"

open the perl script "import_policy_pack.pl" and under "print CREA_RULES "prova" modify prova with the name of your layer od insert a variable.

then you can exec "./import_policy_pack.pl  file_exported.csv"

it creates 4 files into directory "file_import":

1 creare_regole.csv - the first file to be executed (read inside the file creare_regole.csv the USAGE)

2 add_obj_destinations.csv

3 add_obj_sources.csv

4 add_services.csv

these files popolate the "destination" - "source" , and "services"

NB.. the exported file can't contains INLINE LAYERS.

2 Replies
ab-cyber
Explorer
Explorer

Hi guys,

I have tried to do as explained and the error I get is that the file doesn't exist even I'm in the working directory. It looks like there is no pearl interpreter. I have Check_Point_R80.40_T294 fresh installed on a VM in VMware Workstation, 8GB RAm, 2 CPU 8Cores, 60GB HDD.

then I have copied via Mobaxterm the desired csv file and the extracted import_policy_pack.pl file under /tmp/file_import.

By runnig the "./import_policy_pack.pl" policy-td.csv" I end up with a ">" where nothing happens. What should I do?


[Expert@SMS-template:0]# "./import_policy_pack.pl" policy-td.csv"
>
> ^C

I have changed the number of quotes and spaces and place, but I get this:

[Expert@SMS-template:0]# "./import_policy_pack.pl" "policy-td.csv"

-bash: ./import_policy_pack.pl: /usr/bin/perl: bad interpreter: No such file or directory
[Expert@SMS-template:0]# "./import_policy_pack.pl" policy-td.csv
-bash: ./import_policy_pack.pl: /usr/bin/perl: bad interpreter: No such file or directory
[Expert@SMS-template:0]# ""./import_policy_pack.pl" policy-td.csv"
-bash: ./import_policy_pack.pl policy-td.csv: No such file or directory
[Expert@SMS-template:0]# " ./import_policy_pack.pl policy-td.csv"
-bash: ./import_policy_pack.pl policy-td.csv: No such file or directory
[Expert@SMS-template:0]# "./import_policy_pack.pl policy-td.csv"
-bash: ./import_policy_pack.pl policy-td.csv: No such file or directory
[Expert@SMS-template:0]# ls-la
-bash: ls-la: command not found
[Expert@SMS-template:0]# ls -la
total 1880
drwxrwx--- 2 admin root 56 Aug 24 15:40 .
drwxrwxrwt 8 admin root 4096 Aug 24 15:46 ..
-rwxr-xr-x 1 admin root 2742 Aug 24 11:46 import_policy_pack.pl
-rw-rw---- 1 admin root 1909823 Aug 24 11:50 policy-td.csv

Please let me know what I am doing wrong here.

Cheers!

Adrian

0 Kudos
PhoneBoy
Admin
Admin

We do not include a perl interpreter on the Check Point management.
I believe this must be run on another system.
For something you can run on the management itself that serves a similar purpose: https://community.checkpoint.com/t5/API-CLI-Discussion/CLI-API-Example-for-exporting-importing-and-d... 

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events