cancel
Showing results for 
Search instead for 
Did you mean: 
Post a Question
Neil_ZInk
Copper

Changing NAT settings via API

Jump to solution

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

Re: Changing NAT settings via API

Jump to solution

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

4 Replies
Vladimir
Pearl

Re: Changing NAT settings via API

Jump to solution

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
Copper

Re: Changing NAT settings via API

Jump to solution

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. 

Re: Changing NAT settings via API

Jump to solution

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
Copper

Re: Changing NAT settings via API

Jump to solution

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