Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 

IP ranges for countries from GeoProtection (new version)

HeikoAnkenbrand
Champion Champion
Champion

ipgl123.JPG
This script lists all country entries from the file ip2country. csv and displays the countries sorted for R80.10.
The country code can then be insert. For the selected country all IP Ranges are displayed.

So you can find all IP range, which are blocked by GeoProtection for a country.

_Val__0-1605787951901.png

 

 

Script:

#!/bin/bash
dec2ip() {
local ip dec=$@
delim=""
for e in {3..0}
do
((octet = dec / (256 ** e) ))
((dec -= octet * 256 ** e))
ip+=$delim$octet
delim=.
done
printf '%s' "$ip"
}

...;
TO ACCESS CHECKMATES TOOLBOX it's simple and free

Disclaimer: Check Point does not provide maintenance services or technical or customer support for third party content provided on this Site, including in CheckMates Toolbox. See also our Third Party Software Disclaimer.




4 Replies

HeikoAnkenbrand
Champion Champion
Champion

I would like to extend the script so that a firewall object is created automatically. Firewall range objects and then a group of all range objects.

This allows you to use regional country settings in firewall rules.

Regards,

Heiko

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free


Norbert_Bohusch
Advisor

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 -> Dynamic Objects in R80.10)

With that one would have the possibility to use dynamic objects with predefined names like "Geo_Protection_<Country>" or whatever to use them in the policy.

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free


HeikoAnkenbrand
Champion Champion
Champion

Good idea!

If I have some time, I will extend the script:-)

Regards,

Heiko

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free


hong_jungil
Participant

Have you developed this further yet?

;
TO ACCESS CHECKMATES TOOLBOX it's simple and free