<?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 IP ranges for countries from GeoProtection (new version) in Scripts</title>
    <link>https://community.checkpoint.com/t5/Scripts/IP-ranges-for-countries-from-GeoProtection-new-version/m-p/39667#M572</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ipgl123.JPG" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9444iB217DB541A6CADFF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ipgl123.JPG" alt="ipgl123.JPG" /&gt;&lt;/span&gt;&lt;BR /&gt;This script lists all country entries from the file ip2country. csv and displays the countries sorted for R80.10. &lt;BR /&gt;The country code can then be insert. For the selected country all IP Ranges are displayed.&lt;/P&gt;
&lt;P&gt;So you can find all IP range, which are blocked by GeoProtection for a country.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="_Val__0-1605787951901.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/9115iBA62B7C1F6835918/image-size/medium?v=v2&amp;amp;px=400" role="button" title="_Val__0-1605787951901.png" alt="_Val__0-1605787951901.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="width: auto; height: auto;" class="image-1 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/63799_pastedImage_1.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Script:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;#!/bin/bash&lt;BR /&gt;dec2ip() {&lt;BR /&gt;local ip dec=$@&lt;BR /&gt;delim=""&lt;BR /&gt;for e in {3..0}&lt;BR /&gt;do&lt;BR /&gt;((octet = dec / (256 ** e) ))&lt;BR /&gt;((dec -= octet * 256 ** e))&lt;BR /&gt;ip+=$delim$octet&lt;BR /&gt;delim=.&lt;BR /&gt;done&lt;BR /&gt;printf '%s' "$ip"&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;echo count CN country name&lt;BR /&gt;echo ----------------------------------------------------&lt;BR /&gt;more /opt/CPrt-R80/conf/ip2country.csv | awk '{print $6 " " $7} ' FS=',' | sort | uniq -c |sed 's/"//g'&lt;BR /&gt;read -p "Please insert country : " name&lt;BR /&gt;echo Find network with country : $name&lt;BR /&gt;if [ "$name" != "" ]&lt;BR /&gt;then&lt;BR /&gt;more /opt/CPrt-R80/conf/ip2country.csv |grep $name &amp;gt; _temp.txt&lt;BR /&gt;declare -i index&lt;BR /&gt;index=0&lt;BR /&gt;for i in $(cat _temp.txt ); do&lt;BR /&gt;ip123=$( echo $i |grep $name | awk '{print $1}' FS=',' |sed 's/"//g')&lt;BR /&gt;net123=$( echo $i |grep $name | awk '{print $2}' FS=',' |sed 's/"//g')&lt;BR /&gt;if [ "$ip123" != "" ]&lt;BR /&gt;then&lt;BR /&gt;# echo $ip123&lt;BR /&gt;index=$index+1&lt;BR /&gt;printf '%s' "$name $index # "&lt;BR /&gt;dec2ip $ip123&lt;BR /&gt;# echo $net123&lt;BR /&gt;printf '%s' " - "&lt;BR /&gt;dec2ip $net123&lt;BR /&gt;printf '%s\n' ""&lt;BR /&gt;fi&lt;BR /&gt;done;&lt;BR /&gt;fi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Version:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #000000; background-color: transparent; font-weight: 200; text-decoration: none; font-size: 28px;"&gt;&amp;nbsp;&lt;SPAN style="font-size: 15px;"&gt;+ version 0.4 06-02-2018 - bug fix&lt;BR /&gt;&amp;nbsp; + version 0.5 09-03-2018 - bug fix&lt;BR /&gt;&amp;nbsp; + version 0.6 18-03-2018 - new feature &lt;BR /&gt;&amp;nbsp; + new version 0.9 06-04-2018 - new feature &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Mar 2026 08:22:48 GMT</pubDate>
    <dc:creator>HeikoAnkenbrand</dc:creator>
    <dc:date>2026-03-31T08:22:48Z</dc:date>
    <item>
      <title>IP ranges for countries from GeoProtection (new version)</title>
      <link>https://community.checkpoint.com/t5/Scripts/IP-ranges-for-countries-from-GeoProtection-new-version/m-p/39667#M572</link>
      <description>62</description>
      <pubDate>Tue, 31 Mar 2026 08:22:48 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/IP-ranges-for-countries-from-GeoProtection-new-version/m-p/39667#M572</guid>
      <dc:creator>HeikoAnkenbrand</dc:creator>
      <dc:date>2026-03-31T08:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Bash script to show IP ranges for countrys from GeoProtection (new version)</title>
      <link>https://community.checkpoint.com/t5/Scripts/IP-ranges-for-countries-from-GeoProtection-new-version/m-p/39668#M573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to extend the script so that a firewall object is created automatically.&amp;nbsp;Firewall range objects and then a group of all range objects.&lt;/P&gt;&lt;P&gt;This allows you to use regional country settings in firewall rules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="" data-containerid="-1" data-containertype="-1" data-objectid="55229" data-objecttype="3" href="https://community.checkpoint.com/people/h.ank2614aef2-c5d1-3f73-bbbd-45c59b9e2728"&gt;Heiko&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Mar 2018 09:31:30 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/IP-ranges-for-countries-from-GeoProtection-new-version/m-p/39668#M573</guid>
      <dc:creator>HeikoAnkenbrand</dc:creator>
      <dc:date>2018-03-10T09:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Bash script to show IP ranges for countrys from GeoProtection (new version)</title>
      <link>https://community.checkpoint.com/t5/Scripts/IP-ranges-for-countries-from-GeoProtection-new-version/m-p/39669#M574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An even better idea would be to combine the ip2country.csv and the efforts for automatically updated dynamic cloud services (like O365, which is in EA -&amp;gt;&amp;nbsp;&lt;A href="https://community.checkpoint.com/docs/DOC-2339"&gt;Dynamic Objects in R80.10&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;With that one would have the possibility to use dynamic objects with predefined names like "Geo_Protection_&amp;lt;Country&amp;gt;" or whatever to use them in the policy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 14:03:56 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/IP-ranges-for-countries-from-GeoProtection-new-version/m-p/39669#M574</guid>
      <dc:creator>Norbert_Bohusch</dc:creator>
      <dc:date>2018-03-15T14:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Bash script to show IP ranges for countrys from GeoProtection (new version)</title>
      <link>https://community.checkpoint.com/t5/Scripts/IP-ranges-for-countries-from-GeoProtection-new-version/m-p/39670#M575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good idea!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have some time, I will extend the script:-)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="" data-containerid="-1" data-containertype="-1" data-objectid="55229" data-objecttype="3" href="https://community.checkpoint.com/people/h.ank2614aef2-c5d1-3f73-bbbd-45c59b9e2728"&gt;Heiko&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2018 14:20:44 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/IP-ranges-for-countries-from-GeoProtection-new-version/m-p/39670#M575</guid>
      <dc:creator>HeikoAnkenbrand</dc:creator>
      <dc:date>2018-03-15T14:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Bash script to show IP ranges for countrys from GeoProtection (new version)</title>
      <link>https://community.checkpoint.com/t5/Scripts/IP-ranges-for-countries-from-GeoProtection-new-version/m-p/39671#M576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you developed this further yet?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2018 13:15:03 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/IP-ranges-for-countries-from-GeoProtection-new-version/m-p/39671#M576</guid>
      <dc:creator>hong_jungil</dc:creator>
      <dc:date>2018-03-20T13:15:03Z</dc:date>
    </item>
  </channel>
</rss>

