<?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 mgmt_cli set simple-gateway  removing existing interface on gateway in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/125875#M6132</link>
    <description>&lt;P&gt;Hi Team.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After fetching the topology ,i am trying to change the topology settings, of newly created interfaces&amp;nbsp; by using set simple gateway command but its removing&amp;nbsp; all the existing interfaces.&lt;/P&gt;&lt;P&gt;is there any way to change topology settings of interfaces ,without affecting existing interfaces , all things we are doing api/mgmt cli commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Aathi&lt;/P&gt;</description>
    <pubDate>Fri, 06 Aug 2021 12:29:25 GMT</pubDate>
    <dc:creator>Aathi</dc:creator>
    <dc:date>2021-08-06T12:29:25Z</dc:date>
    <item>
      <title>mgmt_cli set simple-gateway  removing existing interface on gateway</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/125875#M6132</link>
      <description>&lt;P&gt;Hi Team.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After fetching the topology ,i am trying to change the topology settings, of newly created interfaces&amp;nbsp; by using set simple gateway command but its removing&amp;nbsp; all the existing interfaces.&lt;/P&gt;&lt;P&gt;is there any way to change topology settings of interfaces ,without affecting existing interfaces , all things we are doing api/mgmt cli commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Aathi&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 12:29:25 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/125875#M6132</guid>
      <dc:creator>Aathi</dc:creator>
      <dc:date>2021-08-06T12:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli set simple-gateway  removing existing interface on gateway</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/125891#M6133</link>
      <description>&lt;P&gt;Version/JHF level?&lt;BR /&gt;A precise example might help also.&lt;BR /&gt;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/37502"&gt;@Omer_Kleinstern&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 16:31:14 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/125891#M6133</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2021-08-06T16:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli set simple-gateway  removing existing interface on gateway</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/125894#M6135</link>
      <description>&lt;P&gt;Actually, not necessary as it appears this is documented, expected behavior.&lt;BR /&gt;”&lt;SPAN&gt;When a gateway is updated with a new interfaces, the existing interfaces are removed.”&lt;BR /&gt;See:&amp;nbsp;&lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/#cli/set-simple-gateway~v1.8" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/APIs/#cli/set-simple-gateway~v1.8&lt;/A&gt;&lt;BR /&gt;Which means if you use the API to change the setting on one interface, you need to define the settings for all of the ones you want to keep.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Whether this should be the behavior is a separate question, of course.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 16:48:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/125894#M6135</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2021-08-06T16:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli set simple-gateway  removing existing interface on gateway</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/125902#M6136</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/7"&gt;@PhoneBoy&lt;/a&gt;&amp;nbsp;already mentioned, you always have to specify all interfaces at once. IMHO you have two possibilities now:&lt;/P&gt;&lt;P data-unlink="true"&gt;1. You can use the API endpoint &lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/#cli/get-interfaces~v1.8" target="_self"&gt;get-interfaces&lt;/A&gt;, which does pretty the same as the "Get interfaces" button in the GUI and use the "use-defined-by-routes" parameter in addition, which tells the firewall to define the topology according to the routing table (which is in most cases a good idea). This happens dynamically every second.&lt;/P&gt;&lt;P data-unlink="true"&gt;2. You always set the complete list of interfaces the gateway has. You can do that for example through the api. First, you fetch the interfaces object of the gateway object with &lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/#cli/show-simple-gateway~v1.8" target="_self"&gt;show-simple-gateway:&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;mgmt_cli -r true show-simple-gateway name &amp;lt;object-name&amp;gt; --format json | jq '.interfaces'&lt;/LI-CODE&gt;&lt;P data-unlink="true"&gt;Now you can edit the necessary parameters and push back the changes with &lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/#cli/set-simple-gateway~v1.8" target="_blank"&gt;set-simple-gateway&lt;/A&gt;. Unfortunately it is not possible to push back the complete object as you get it from the API, as there are several parameters, which set-simple-gateway does not accept (or ignore).&lt;/P&gt;&lt;P data-unlink="true"&gt;You also can use an automation tool like Ansible to define your objects, but believe me: This can be really painful, as there is really much room for improvement for the Check Point Ansible collection, as well as for the API itself.&lt;/P&gt;&lt;P data-unlink="true"&gt;Cheers,&lt;BR /&gt;Thomas&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 18:21:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/125902#M6136</guid>
      <dc:creator>Thomas-Marko</dc:creator>
      <dc:date>2021-08-06T18:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli set simple-gateway  removing existing interface on gateway</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/126131#M6140</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/16993"&gt;@Thomas-Marko&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/7"&gt;@PhoneBoy&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;i have tried the first option ,still getting error while installing the policy. please find the attached error and hotfix details.&lt;/P&gt;&lt;P&gt;we are not willing to use option 2 as its risky and we need to run it on production env.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 17:57:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/126131#M6140</guid>
      <dc:creator>Aathi</dc:creator>
      <dc:date>2021-08-09T17:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli set simple-gateway  removing existing interface on gateway</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/126165#M6142</link>
      <description>&lt;P&gt;Security Zones require topology to be defined, as described here:&amp;nbsp;&lt;A href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk124292" target="_blank"&gt;https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk124292&lt;/A&gt;&lt;BR /&gt;Which means you either don't use Zones or you define the interface topology.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which brings us back to actually making set-interfaces work the way you want.&lt;BR /&gt;Unfortunately, if you use the API to set the settings for one interface, you have to set them all, as stated in the documentation.&lt;BR /&gt;While&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/16993"&gt;@Thomas-Marko&lt;/a&gt;&amp;nbsp;makes an excellent point about set-simple-gateway not returning everything about the gateway object (particularly the parts that don't have API support), I believe everything related to the interfaces does have API support.&lt;BR /&gt;That means the approach should work in this case.&lt;/P&gt;
&lt;P&gt;And yes, I understand your concerns about using this in production, but this is why you test your code on something that is not your production environment first.&lt;BR /&gt;You can use the Demo Mode servers for this, so no need to spin up your own VM:&amp;nbsp;&lt;A href="https://community.checkpoint.com/t5/API-CLI-Discussion/Using-SmartConsole-Demo-Mode-Server-for-API-testing/m-p/122863" target="_blank"&gt;https://community.checkpoint.com/t5/API-CLI-Discussion/Using-SmartConsole-Demo-Mode-Server-for-API-testing/m-p/122863&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 19:48:54 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/126165#M6142</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2021-08-09T19:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli set simple-gateway  removing existing interface on gateway</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/127307#M6151</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/7"&gt;@PhoneBoy&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/16993"&gt;@Thomas-Marko&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any other way to resolve this issue.&lt;/P&gt;&lt;P&gt;in our env we are having 50+ interfaces,we cant recreate using set-simple gateway command.&lt;/P&gt;&lt;P&gt;why the first option is not working which Thomas mentioned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 08:29:08 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/127307#M6151</guid>
      <dc:creator>Aathi</dc:creator>
      <dc:date>2021-08-18T08:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli set simple-gateway  removing existing interface on gateway</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/127319#M6153</link>
      <description>&lt;P&gt;Please use the API call&amp;nbsp;&lt;STRONG&gt;gateways-and-servers&lt;/STRONG&gt;&amp;nbsp;with &lt;STRONG&gt;details-level full&amp;nbsp;&lt;/STRONG&gt;which will give you all information about all gateways and servers. Set format in JSON, and them slice and dice as you wish. Ping if you need any help.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 13:30:14 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/127319#M6153</guid>
      <dc:creator>Art_Zalenekas</dc:creator>
      <dc:date>2021-08-18T13:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli set simple-gateway  removing existing interface on gateway</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/127324#M6154</link>
      <description>&lt;P&gt;Please provide a screenshot of the gateway object interface settings where you’ve attempted to defined the topology by routes and are getting the originally referenced policy installation error.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 13:47:36 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/127324#M6154</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2021-08-18T13:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli set simple-gateway  removing existing interface on gateway</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/127488#M6157</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;hmm, maybe I do not understand the question correctly, but to achieve what you request as far as I understand it, you can simply do the following:&lt;/P&gt;&lt;P&gt;1. Read the existing object by issuing a &lt;STRONG&gt;POST&lt;/STRONG&gt; request to the endpoint &lt;STRONG&gt;show-simple-gateway&lt;/STRONG&gt;. You will get the data for your existing object. One part of this data is the "interfaces" array.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"interfaces": [
        {
            "name": "eth0",
            "ipv4-address": "192.168.201.2",
            "ipv4-network-mask": "255.255.255.0",
            "ipv4-mask-length": 24,
            "ipv6-address": "",
            "comments": "",
            "color": "black",
            "icon": "NetworkObjects/network",
            "topology": "automatic",
            "topology-automatic-calculation": "internal",
            "topology-settings": {
                "ip-address-behind-this-interface": "not defined",
                "interface-leads-to-dmz": false
            },
            "anti-spoofing": false,
            "security-zone": false
        },
        {
            "name": "eth1",
            "ipv4-address": "192.168.200.2",
            "ipv4-network-mask": "255.255.255.0",
            "ipv4-mask-length": 24,
            "ipv6-address": "",
            "comments": "",
            "color": "black",
            "icon": "NetworkObjects/network",
            "topology": "automatic",
            "topology-automatic-calculation": "internal",
            "topology-settings": {
                "ip-address-behind-this-interface": "not defined",
                "interface-leads-to-dmz": false
            },
            "anti-spoofing": false,
            "security-zone": false
        }
    ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Add a new interface if needed or make your changes to the existing ones and &lt;STRONG&gt;remove the "icon" and "topology-automatic-calculation" properties&lt;/STRONG&gt; from the existing objects as &lt;STRONG&gt;they are not accepted by the api&lt;/STRONG&gt; (@checkpoint: Can you please just ignore such properties? It would make life much easier, when working with api result objects).&lt;/P&gt;&lt;P&gt;In my example I made some changes and added a new interface to my existing gateway and sent a &lt;STRONG&gt;POST&lt;/STRONG&gt; to the endpoint &lt;STRONG&gt;set-simple-gateway&lt;/STRONG&gt; with the following data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
    "uid": "6e39115e-c236-41c6-b768-b56ccd056014",
    "interfaces": [
        {
            "name": "eth0",
            "ipv4-address": "192.168.201.2",
            "ipv4-network-mask": "255.255.255.0",
            "ipv4-mask-length": 24,
            "ipv6-address": "",
            "comments": "",
            "color": "black",
            "topology": "automatic",
            "topology-settings": {
                "ip-address-behind-this-interface": "network defined by the interface ip and net mask",
                "interface-leads-to-dmz": true
            },
            "anti-spoofing": true,
            "security-zone": true,
            "security-zone-settings": {
                "specific-zone": "DMZZone"
            }
        },
        {
            "name": "eth1",
            "ipv4-address": "192.168.200.2",
            "ipv4-network-mask": "255.255.255.0",
            "ipv4-mask-length": 24,
            "ipv6-address": "",
            "comments": "",
            "color": "black",
            "topology": "automatic",
            "topology-settings": {
                "ip-address-behind-this-interface": "not defined",
                "interface-leads-to-dmz": false
            },
            "anti-spoofing": false,
            "security-zone": false
        },
        {
            "name": "eth2",
            "ipv4-address": "192.168.203.2",
            "ipv4-network-mask": "255.255.255.0",
            "ipv4-mask-length": 24,
            "topology": "external",
            "anti-spoofing": true,
            "security-zone": true,
            "security-zone-settings": {
                "specific-zone": "ExternalZone"
            }
        }
    ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;And I got back an http/200 with all my changes applied:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
    "uid": "6e39115e-c236-41c6-b768-b56ccd056014",

---SNIP---

    "interfaces": [
        {
            "name": "eth0",
            "ipv4-address": "192.168.201.2",
            "ipv4-network-mask": "255.255.255.0",
            "ipv4-mask-length": 24,
            "ipv6-address": "",
            "comments": "",
            "color": "black",
            "icon": "NetworkObjects/network",
            "topology": "automatic",
            "topology-automatic-calculation": "internal",
            "topology-settings": {
                "ip-address-behind-this-interface": "not defined",
                "interface-leads-to-dmz": false
            },
            "anti-spoofing": true,
            "anti-spoofing-settings": {
                "action": "prevent"
            },
            "security-zone": true,
            "security-zone-settings": {
                "auto-calculated": false,
                "specific-zone": "DMZZone"
            }
        },
        {
            "name": "eth1",
            "ipv4-address": "192.168.200.2",
            "ipv4-network-mask": "255.255.255.0",
            "ipv4-mask-length": 24,
            "ipv6-address": "",
            "comments": "",
            "color": "black",
            "icon": "NetworkObjects/network",
            "topology": "automatic",
            "topology-automatic-calculation": "internal",
            "topology-settings": {
                "ip-address-behind-this-interface": "not defined",
                "interface-leads-to-dmz": false
            },
            "anti-spoofing": false,
            "security-zone": false
        },
        {
            "name": "eth2",
            "ipv4-address": "192.168.203.2",
            "ipv4-network-mask": "255.255.255.0",
            "ipv4-mask-length": 24,
            "ipv6-address": "",
            "comments": "",
            "color": "black",
            "icon": "NetworkObjects/network",
            "topology": "external",
            "anti-spoofing": true,
            "anti-spoofing-settings": {
                "action": "prevent"
            },
            "security-zone": true,
            "security-zone-settings": {
                "auto-calculated": false,
                "specific-zone": "ExternalZone"
            }
        }
    ],

--- SNIP ---
   
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I think that's that what you want to achieve, right?&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Thomas&lt;/P&gt;</description>
      <pubDate>Sun, 22 Aug 2021 04:39:40 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-set-simple-gateway-removing-existing-interface-on/m-p/127488#M6157</guid>
      <dc:creator>Thomas-Marko</dc:creator>
      <dc:date>2021-08-22T04:39:40Z</dc:date>
    </item>
  </channel>
</rss>

