<?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: IPCALC on CLI in General Topics</title>
    <link>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35601#M7520</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://s-media-cache-ak0.pinimg.com/originals/bd/3e/de/bd3edeafc2f2022333ed7381414f47bc.gif" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I always used netcalc websites to verify mask and network address!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Commands can look like all-in-one:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;# ipcalc -nmbp 192.168.1.34/28&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;NETMASK=255.255.255.240&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;PREFIX=28&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;BROADCAST=192.168.1.47&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;NETWORK=192.168.1.32&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works on Gaia and Splat, but not on IPSO.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Mar 2018 13:34:17 GMT</pubDate>
    <dc:creator>AlekseiShelepov</dc:creator>
    <dc:date>2018-03-14T13:34:17Z</dc:date>
    <item>
      <title>IPCALC on CLI</title>
      <link>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35600#M7519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This migt be old news for some but definitely new news for myself &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.checkpoint.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;Ever wondered to quickly calculate network address, broadcast or mask from a host? Usually it's the online ipcalc but it actually lives in your GW. Good for scripting etc.&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;## SHOW MASK&lt;BR /&gt;[Expert@vsx]# ipcalc -m 190.160.3.100/28&lt;BR /&gt;NETMASK=255.255.255.240&lt;BR /&gt;&lt;BR /&gt;## SHOW NETWORK ADDR&lt;BR /&gt;[Expert@vsx]# ipcalc -n 190.160.3.100/28&lt;BR /&gt;NETWORK=190.160.3.96&lt;BR /&gt;&lt;BR /&gt;## SHOW BROADCAST ADDR&lt;BR /&gt;[Expert@vsx]# ipcalc -b 190.160.3.100/28&lt;BR /&gt;BROADCAST=190.160.3.111‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 12:40:48 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35600#M7519</guid>
      <dc:creator>Kaspars_Zibarts</dc:creator>
      <dc:date>2018-03-14T12:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: IPCALC on CLI</title>
      <link>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35601#M7520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://s-media-cache-ak0.pinimg.com/originals/bd/3e/de/bd3edeafc2f2022333ed7381414f47bc.gif" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I always used netcalc websites to verify mask and network address!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Commands can look like all-in-one:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;# ipcalc -nmbp 192.168.1.34/28&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;NETMASK=255.255.255.240&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;PREFIX=28&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;BROADCAST=192.168.1.47&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal, monaco, monospace; font-size: 12px;"&gt;NETWORK=192.168.1.32&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works on Gaia and Splat, but not on IPSO.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 13:34:17 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35601#M7520</guid>
      <dc:creator>AlekseiShelepov</dc:creator>
      <dc:date>2018-03-14T13:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: IPCALC on CLI</title>
      <link>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35602#M7521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;had to learn it after 15 years of using ipcalc online haha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 13:59:20 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35602#M7521</guid>
      <dc:creator>Kaspars_Zibarts</dc:creator>
      <dc:date>2018-03-14T13:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: IPCALC on CLI</title>
      <link>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35603#M7522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like you stumbled upon &lt;A href="https://community.checkpoint.com/migrated-users/43803"&gt;Yuri Slobodyanyuk&lt;/A&gt;'s blog post: &lt;A class="link-titled" href="http://yurisk.info/2010/08/22/subnet-calculator-in-checkpoint/index.html" title="http://yurisk.info/2010/08/22/subnet-calculator-in-checkpoint/index.html"&gt;Subnet calculator in Checkpoint – yurisk.info&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2018 21:12:49 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35603#M7522</guid>
      <dc:creator>Danny</dc:creator>
      <dc:date>2018-03-14T21:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: IPCALC on CLI</title>
      <link>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35604#M7523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A colleague of mine wrote a python script on a similar topic, the argument it expects is an output of "ifconfig -a" on a firewall. You will get all the locally attached subnets on the firewall, this might be useful to give to your vulnerability scanner to be able to scan all the DMZ's off the firewall&lt;/P&gt;&lt;P&gt;/////////////&lt;/P&gt;&lt;P&gt;#!/usr/bin/python&lt;/P&gt;&lt;P&gt;import sys&lt;/P&gt;&lt;P&gt;input_name = sys.argv[1]&lt;/P&gt;&lt;P&gt;with open(input_name, "r") as f:&lt;BR /&gt; contents = f.readlines()&lt;/P&gt;&lt;P&gt;for i, item in enumerate(contents):&lt;BR /&gt; if "inet addr:" in item and "Mask:" in item:&lt;BR /&gt; interface = contents[i - 1].split()[0]&lt;BR /&gt; cidr = 0&lt;BR /&gt; ip_octets = ((item.split("inet addr:")[1]).split()[0]).split(".")&lt;BR /&gt; subnet_mask_octets = ((item.split("Mask:")[1]).split()[0]).split(".")&lt;BR /&gt; for j, item in enumerate(subnet_mask_octets):&lt;BR /&gt; if item == "255":&lt;BR /&gt; cidr += 8&lt;BR /&gt; continue&lt;/P&gt;&lt;P&gt;elif item == "254":&lt;BR /&gt; cidr += 7&lt;/P&gt;&lt;P&gt;elif item == "252":&lt;BR /&gt; cidr += 6&lt;/P&gt;&lt;P&gt;elif item == "248":&lt;BR /&gt; cidr += 5&lt;/P&gt;&lt;P&gt;elif item == "240":&lt;BR /&gt; cidr += 4&lt;/P&gt;&lt;P&gt;elif item == "224":&lt;BR /&gt; cidr += 3&lt;/P&gt;&lt;P&gt;elif item == "192":&lt;BR /&gt; cidr += 2&lt;/P&gt;&lt;P&gt;elif item == "128":&lt;BR /&gt; cidr += 1&lt;/P&gt;&lt;P&gt;octet_number = j&lt;BR /&gt; octet_value = 256 - int(item)&lt;BR /&gt; break&lt;/P&gt;&lt;P&gt;ip_octets[octet_number] = str(int(ip_octets[octet_number]) // octet_value * octet_value)&lt;/P&gt;&lt;P&gt;for j in range(octet_number + 1, 4):&lt;BR /&gt; ip_octets[j] = "0"&lt;/P&gt;&lt;P&gt;print "%s/%s %s" %(".".join(ip_octets), cidr, interface)&lt;/P&gt;&lt;P&gt;////&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 18:51:09 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35604#M7523</guid>
      <dc:creator>Gary_Lipets</dc:creator>
      <dc:date>2018-03-15T18:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: IPCALC on CLI</title>
      <link>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35605#M7524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Had no idea we had that utility on Gaia.&lt;/P&gt;&lt;P&gt;Quite useful &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.checkpoint.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 22:40:17 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35605#M7524</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2018-03-15T22:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: IPCALC on CLI</title>
      <link>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35606#M7525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Haha great, then I don't feel left out.. &lt;IMG src="https://community.checkpoint.com/legacyfs/online/checkpoint/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 06:19:18 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35606#M7525</guid>
      <dc:creator>Kaspars_Zibarts</dc:creator>
      <dc:date>2018-03-16T06:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: IPCALC on CLI</title>
      <link>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35607#M7526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used ipcalc (different program) on my local Mac for years not knowing that it also exists on the firewall gateways.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2018 09:47:18 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/IPCALC-on-CLI/m-p/35607#M7526</guid>
      <dc:creator>Oliver_Fink</dc:creator>
      <dc:date>2018-03-16T09:47:18Z</dc:date>
    </item>
  </channel>
</rss>

