<?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 Simple one-liner to add multiple networks in series in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Simple-one-liner-to-add-multiple-networks-in-series/m-p/38836#M2332</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H2&gt;Overview&lt;/H2&gt;&lt;P&gt;Add many networks to management database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Description&lt;/H2&gt;&lt;P&gt;Just a simple BASH one-liner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Instructions&lt;/H2&gt;&lt;P&gt;In BASH run (change as needed):&lt;/P&gt;&lt;P&gt;for x in `seq 0 255`; do echo add network name "studentnet-$x" subnet "10.$x.16.0" subnet-mask "255.255.248.0" tags students &amp;gt;&amp;gt; students.txt&amp;nbsp; ; done&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy students.txt to your windows desktop and open it in the CLI window in SmartConsole:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="run.PNG" class="image-1 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/53161_run.PNG" style="width: 620px; height: 308px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let the file execute and then you can publish your changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you also want to add the created networks to a group you can follow the above example with the following one-liner:&lt;/P&gt;&lt;P&gt;for x in `seq 0 255`; do echo set network name studentnet-$x groups "StudentsGroup" &amp;gt;&amp;gt; studentsgroup.txt&amp;nbsp; ; done&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Code Version&lt;/H2&gt;&lt;P&gt;Code version 0.0.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Tested on version&lt;/H2&gt;&lt;P&gt;R80, API version 1.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-size: 13px; color: #ff0000;"&gt;&lt;STRONG&gt;NOTICE: &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.6667px; color: #999999;"&gt;&lt;STRONG&gt;By using this sample code you agree to terms and conditions in this &lt;A href="https://community.checkpoint.com/docs/DOC-1042"&gt;Not authorized to view the specified document 1042&lt;/A&gt;​&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 May 2016 20:00:34 GMT</pubDate>
    <dc:creator>Daniel_Husand</dc:creator>
    <dc:date>2016-05-30T20:00:34Z</dc:date>
    <item>
      <title>Simple one-liner to add multiple networks in series</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Simple-one-liner-to-add-multiple-networks-in-series/m-p/38836#M2332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H2&gt;Overview&lt;/H2&gt;&lt;P&gt;Add many networks to management database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Description&lt;/H2&gt;&lt;P&gt;Just a simple BASH one-liner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Instructions&lt;/H2&gt;&lt;P&gt;In BASH run (change as needed):&lt;/P&gt;&lt;P&gt;for x in `seq 0 255`; do echo add network name "studentnet-$x" subnet "10.$x.16.0" subnet-mask "255.255.248.0" tags students &amp;gt;&amp;gt; students.txt&amp;nbsp; ; done&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copy students.txt to your windows desktop and open it in the CLI window in SmartConsole:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="run.PNG" class="image-1 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/53161_run.PNG" style="width: 620px; height: 308px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let the file execute and then you can publish your changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you also want to add the created networks to a group you can follow the above example with the following one-liner:&lt;/P&gt;&lt;P&gt;for x in `seq 0 255`; do echo set network name studentnet-$x groups "StudentsGroup" &amp;gt;&amp;gt; studentsgroup.txt&amp;nbsp; ; done&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Code Version&lt;/H2&gt;&lt;P&gt;Code version 0.0.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Tested on version&lt;/H2&gt;&lt;P&gt;R80, API version 1.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-size: 13px; color: #ff0000;"&gt;&lt;STRONG&gt;NOTICE: &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.6667px; color: #999999;"&gt;&lt;STRONG&gt;By using this sample code you agree to terms and conditions in this &lt;A href="https://community.checkpoint.com/docs/DOC-1042"&gt;Not authorized to view the specified document 1042&lt;/A&gt;​&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: center;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2016 20:00:34 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Simple-one-liner-to-add-multiple-networks-in-series/m-p/38836#M2332</guid>
      <dc:creator>Daniel_Husand</dc:creator>
      <dc:date>2016-05-30T20:00:34Z</dc:date>
    </item>
  </channel>
</rss>

