Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Neil_ZInk
Collaborator
Jump to solution

Changing NAT settings via API

Dear CheckMates

 

I am trying to batch out large number of NAT changes on existing objects.  CLI command looks like:

 

set host name "NatTest" nat-settings.auto-rule "true" nat-settings.ip-address "X.X.X.X" nat-settings.method "hide" nat-settings.install-on "checkPointCluster"

 

I tried using Batch method with following CSV.

name,nat-settings.auto-rule ,nat-settings.ip-address ,nat-settings.method ,nat-settings.install-on

NatTest,TRUE,x.x.x.x,hide,checkPointCluster

The Batch method did not like NAT settings:

 

C:\Program Files (x86)\CheckPoint\SmartConsole\R80.10\PROGRAM>mgmt_cli.exe -m x.x.x.x -d x.x.x.x set host --batch \scripts\nattest.csv --ignore-errors false --debug on

Username:

Password:

Line 2: code: "generic_err_invalid_parameter"

message: "Parameter [auto-rule] value is not valid (full path: nat-settings.auto-rule)"

 

Can you make these kinds of changes via batch mode?  If not, is there another method?

 

Thanks

0 Kudos
1 Solution

Accepted Solutions
Andrew_Gillmore
Participant

Try changing the "TRUE" in your CSV to lowercase.
I was able to replicate the issue and switching to lowercase seems to have fixed it.

-Andrew

View solution in original post

4 Replies
Vladimir
Champion
Champion

Is it possible, that the reason for failure is that these rules are automatically created? If this is the case, then you'll have to change the object properties, rather than Nat rules.

0 Kudos
Neil_ZInk
Collaborator

This CLI command works:

set host name "NatTest" nat-settings.auto-rule "true" nat-settings.ip-address "X.X.X.X" nat-settings.method "hide" nat-settings.install-on "checkPointCluster"

the batch process does not. 

Andrew_Gillmore
Participant

Try changing the "TRUE" in your CSV to lowercase.
I was able to replicate the issue and switching to lowercase seems to have fixed it.

-Andrew

Neil_ZInk
Collaborator

it was two things

1.  TRUE to lower case  (thanks Andrew)

2. my header columns in CSV had an extra space.

thanks for all the responses 

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events