<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Adding network object via mgmt_cli tool in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Adding-network-object-via-mgmt-cli-tool/m-p/31301#M1892</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Much appreciated Kim, thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Feb 2019 10:22:05 GMT</pubDate>
    <dc:creator>Nick_Doropoulos</dc:creator>
    <dc:date>2019-02-08T10:22:05Z</dc:date>
    <item>
      <title>Adding network object via mgmt_cli tool</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Adding-network-object-via-mgmt-cli-tool/m-p/31298#M1889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to&amp;nbsp;&lt;A class="link-titled" href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/add-network~v1.1%20" title="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/add-network~v1.1%20"&gt;Check Point - Management API reference&lt;/A&gt;&amp;nbsp;, below are the mandatory parameters for adding a network object:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/78245_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/78246_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And below is the result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/78247_pastedImage_4.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I can see, I haven't made a mistake in the syntax while the ip-address parameter is not even on the list among the mandatory arguments shown above. What's more, I have also used the "subnet4", "ip-address" and "ipv4-address" keywords without having any luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anybody had issues with this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2019 08:54:37 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Adding-network-object-via-mgmt-cli-tool/m-p/31298#M1889</guid>
      <dc:creator>Nick_Doropoulos</dc:creator>
      <dc:date>2019-02-07T08:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Adding network object via mgmt_cli tool</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Adding-network-object-via-mgmt-cli-tool/m-p/31299#M1890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nicholas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created the following script with the purpose of what you want to achieve.&lt;/P&gt;&lt;P&gt;Basically your error is related to the command&amp;nbsp;&lt;STRONG&gt;nat-settings.auto-rule "true"&amp;nbsp;&lt;/STRONG&gt; which fails.. I am not sure this is necessary. Leave it out if you don't need it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this can help you on your way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can test below code&amp;nbsp; by&lt;/P&gt;&lt;P&gt;1) open ssh to SMS server&lt;/P&gt;&lt;P&gt;2) vi &amp;lt;name of the script file.sh&amp;gt;&lt;/P&gt;&lt;P&gt;3) press 'i' for insert&lt;/P&gt;&lt;P&gt;4) right click to paste code in to file&lt;/P&gt;&lt;P&gt;5) press ESC&amp;nbsp;&lt;/P&gt;&lt;P&gt;6) press ':' and 'w' and 'q' for write and exist vi&lt;/P&gt;&lt;P&gt;7) chmod +x &amp;lt;name of script file.sh&amp;gt;&lt;/P&gt;&lt;P&gt;8)&lt;/img&gt; ./&amp;lt;name of script file.sh&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Running the script will guide you what you need to do next.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/78255_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see it is now created.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/78256_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---- start script Network.sh -------&lt;BR /&gt;#/bin/bash&lt;/P&gt;&lt;P&gt;#########################################################################&lt;BR /&gt;# script created by Kim Moberg, Eurowind Energy A/S - February 7th 2019&lt;BR /&gt;#&lt;BR /&gt;#########################################################################&lt;/P&gt;&lt;P&gt;# Clear screen&lt;BR /&gt;clear&lt;/P&gt;&lt;P&gt;########################################################################&lt;BR /&gt;# Login to the API server, and save session to file id.txt&lt;BR /&gt;# Remeber when running the script setting the username and password&lt;BR /&gt;# without saving the password in the script file.&lt;BR /&gt;#&lt;BR /&gt;#######################################################################&lt;/P&gt;&lt;P&gt;# ask for credentials from user&lt;BR /&gt;echo "Please enter your username and password"&lt;BR /&gt;read -p "Enter username and press [ENTER]: " USER&lt;BR /&gt;read -s -p "Enter password and press [ENTER]: " PASS&lt;BR /&gt;echo&lt;/P&gt;&lt;P&gt;mgmt_cli login user ${USER} password ${PASS} &amp;gt; id.txt&lt;/P&gt;&lt;P&gt;# in case of an error: print to screen the error message and abort&lt;BR /&gt;if [ $? -ne 0 ]; then&lt;BR /&gt; echo "Login command failed."&lt;BR /&gt; cat id.txt&lt;BR /&gt; exit 1&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;######################################################################&lt;BR /&gt;# Ask for user to define variables.&lt;BR /&gt;#&lt;BR /&gt;# Enter the name of the Network &lt;BR /&gt;# Enter subnet eg. 192.0.2.0 &lt;BR /&gt;# Enter subnet-mask eg. 255.255.255.0&lt;BR /&gt;#&lt;BR /&gt;#####################################################################&lt;BR /&gt;echo&lt;BR /&gt;echo "Please enter Network name and IP subnet address and subnet mask."&lt;BR /&gt;read -p "Enter Network Name eg. DMZ_Network [ENTER] : " NETWORKNAME&lt;BR /&gt;echo&lt;BR /&gt;echo "Please defind network"&lt;BR /&gt;read -p "Enter subnet eg. 192.0.2.0 [ENTER] : " SUBNET&lt;BR /&gt;read -p "Enter subnet-mask eg. 255.255.255.0 [ENTER] : " SUBNETMASK&lt;BR /&gt;echo&lt;/P&gt;&lt;P&gt;networkname="${NETWORKNAME}"&lt;/P&gt;&lt;P&gt;mgmt_cli -s id.txt add network name $networkname subnet "${SUBNET}" subnet-mask "${SUBNETMASK}" comments "Auto generated network object with MGMT API"&lt;BR /&gt;mgmt_cli -s id.txt publish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#####################################################################&lt;BR /&gt;# Finalize publish all the changes. We must logout.&lt;BR /&gt;#&lt;BR /&gt;# The correct flow when working with management API -&lt;BR /&gt;# Login -&amp;gt; work -&amp;gt; publish/discard -&amp;gt; logout&lt;BR /&gt;#&lt;BR /&gt;#####################################################################&lt;BR /&gt;mgmt_cli logout -s id.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;----end of script file-----&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Kim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2019 19:45:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Adding-network-object-via-mgmt-cli-tool/m-p/31299#M1890</guid>
      <dc:creator>Kim_Moberg</dc:creator>
      <dc:date>2019-02-07T19:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Adding network object via mgmt_cli tool</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Adding-network-object-via-mgmt-cli-tool/m-p/31300#M1891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again&lt;/P&gt;&lt;P&gt;If you need to use the nat-settings you should do&lt;/P&gt;&lt;P&gt;As you can see it is not enough to just add nat-settings.auto-rule true but you need too add all the other required fields too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is taken from the manual&lt;/P&gt;&lt;PRE class="" style="color: #191919; background: #efefef; border: 0px none; margin: 0px 0px 10px; padding: 9.5px;"&gt;mgmt_cli add network name "New Network 3" subnet "192.0.2.1" subnet-mask "255.255.255.0" nat-settings.auto-rule true nat-settings.method "static" nat-settings.hide-behind "ip-address" nat-settings.ip-address "192.0.2.1" nat-settings.install-on "All" --version 1.4 --format json&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the required fields to add nat-settings...&lt;/P&gt;&lt;PRE class="" style="color: #191919; background: #efefef; border: 0px none; margin: 0px 0px 10px; padding: 9.5px;"&gt;nat-settings.auto-rule true nat-settings.method "static" nat-settings.hide-behind "ip-address" nat-settings.ip-address "192.0.2.1" nat-settings.install-on "All"&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this could help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Kim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2019 19:52:16 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Adding-network-object-via-mgmt-cli-tool/m-p/31300#M1891</guid>
      <dc:creator>Kim_Moberg</dc:creator>
      <dc:date>2019-02-07T19:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Adding network object via mgmt_cli tool</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Adding-network-object-via-mgmt-cli-tool/m-p/31301#M1892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Much appreciated Kim, thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2019 10:22:05 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Adding-network-object-via-mgmt-cli-tool/m-p/31301#M1892</guid>
      <dc:creator>Nick_Doropoulos</dc:creator>
      <dc:date>2019-02-08T10:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Adding network object via mgmt_cli tool</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Adding-network-object-via-mgmt-cli-tool/m-p/31302#M1893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;You are welcome.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2019 19:27:08 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Adding-network-object-via-mgmt-cli-tool/m-p/31302#M1893</guid>
      <dc:creator>Kim_Moberg</dc:creator>
      <dc:date>2019-02-08T19:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Adding network object via mgmt_cli tool</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Adding-network-object-via-mgmt-cli-tool/m-p/66457#M4070</link>
      <description>Hey Kim,&lt;BR /&gt;&lt;BR /&gt;Thanks for helping lot of users..&lt;BR /&gt;is there way to change multiple objects name start like object1* Nat (installed on target setting using mgmt cli tool )&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Nov 2019 03:11:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Adding-network-object-via-mgmt-cli-tool/m-p/66457#M4070</guid>
      <dc:creator>Prashant_YADAV1</dc:creator>
      <dc:date>2019-11-04T03:11:21Z</dc:date>
    </item>
  </channel>
</rss>

