- Products
- Learn
- Local User Groups
- Partners
- More
What’s New in Device Diagnostics?
Dec 2nd @ 5pm CET / 11am EST
Check Point Live Patch in Practice
Dec 9nd @ 5pm CET / 11am EST
CPX is Back!
Join us in Las Vegas, Vienna, and/or Bangkok!
Check Point Named a Leader
The Forrester Wave:
Enterprise Firewall Solutions, Q4 2026
CheckMates Go:
Security Management Improvements
Is there a Check Point tool to easily convert hexadecimal values to IP addresses on the CLI?
I use the following lines in scripts:
hexaddr=$(echo 12cd34ef)
ipaddr=$(printf "%d." $(echo $hexaddr | sed 's/../0x& /g' | tr ' ' '\n' | tac) | sed 's/\.$/\n/')
echo $ipaddr
Is there an easier way?
Regards
I think, this is a shortest command that I found with google:
printf '%d.%d.%d.%d\n' $(echo $ip | sed 's/../0x& /g')

THX
Its not on the Check Point CLI, but you can do this in the Windows command line.
C:\Users\Roman>ping 0x12
Ping wird ausgeführt für 0.0.0.18 mit 32 Bytes Daten:
C:\Users\Roman>ping 0x12cd34ef
Ping wird ausgeführt für 18.205.52.239 mit 32 Bytes Daten:
Great idea, but not much shorter than the original command.
ping -c 1 -w 1 0x12cdd3ef |grep "("| sed -r 's/([^\.]*)\) .*/\1/'| sed -r 's/([^\.]*)\) .*/\1/'|cut -c18-

Regards,
What about using BC and GETHOSTIP as an alternative?
HEX=`tr [:lower:] [:upper:] <<< 6c302b66` | C=`echo "ibase=16;${HEX}" | bc` ; gethostip -d $C

I think, this is a shortest command that I found with google:
printf '%d.%d.%d.%d\n' $(echo $ip | sed 's/../0x& /g')

THX
You could trade the additional echo process for additional File IO by using here-string.
printf '%d.%d.%d.%d\n' $(sed 's/../0x& /g' <<<$ip)
nice, thx
Why are you using tac in your command ? This invert the IP digits. As in your example, 12cd34ef = 18.205.52.239, but if I use your command line, the result is 239.52.205.18 (inverted). If I remove the tac, the result is correct. E.g.: 18.205.52.239
(Double checked with https://www.browserling.com/tools/hex-to-ip)
Why not just:
Just create a /bin/hex2ip with:
[ -z $1 ] && echo "Please specify an IP in HEX" && exit
echo " HEX '`echo 00000000$1 | tail -c 9`' IP = `printf "%d." $(echo 00000000$1 | tail -c 9 | sed 's/../0x& /g' | tr ' ' '\n') | sed 's/\.$/\n/'`"
And why not a /bin/ip2hex:
[ -z $1 ] && echo "Please specify an IP" && exit
echo " IP '$1' in HEX = `echo 00000000$(printf "%x" $(echo $1 | sed 's/\./ /g')) | tail -c 9`"
Example:
hex2ip 12cd34ef Will return:
HEX '12cd34ef' IP = 18.205.52.239
ip2hex 18.205.52.239 Will return:
IP '18.205.52.239' in HEX = 12cd34ef
Maxim
Enjoy!
THX,
Heiko
Leaderboard
Epsum factorial non deposit quid pro quo hic escorol.
| User | Count |
|---|---|
| 1 | |
| 1 |
Thu 03 Dec 2026 @ 10:00 AM (SGT)
Securing the Modern Workspace: Beyond Email and Endpoint SecurityThu 03 Dec 2026 @ 11:00 AM (EST)
Email Agent Hijacking: repensar la seguridad del correo en la era de la IAThu 03 Dec 2026 @ 11:00 AM (EST)
Under the Hood: Check Point Cloud Firewall for Nutanix - How to Secure your AI WorkloadsWed 09 Dec 2026 @ 10:00 AM (CET)
2026 in Review, 2027 in Preview: Why Endpoint Is the Next Chapter of Workspace SecurityWed 09 Dec 2026 @ 11:00 AM (EST)
Closing the Exposure Window: Check Point Live Patch in PracticeFri 11 Dec 2026 @ 10:00 AM (CET)
Check Mates Live Netherlands: #51: Check Point SmartConsoile extensiesThu 03 Dec 2026 @ 10:00 AM (SGT)
Securing the Modern Workspace: Beyond Email and Endpoint SecurityThu 03 Dec 2026 @ 11:00 AM (EST)
Email Agent Hijacking: repensar la seguridad del correo en la era de la IAThu 03 Dec 2026 @ 11:00 AM (EST)
Under the Hood: Check Point Cloud Firewall for Nutanix - How to Secure your AI WorkloadsWed 09 Dec 2026 @ 10:00 AM (CET)
2026 in Review, 2027 in Preview: Why Endpoint Is the Next Chapter of Workspace SecurityWed 09 Dec 2026 @ 11:00 AM (EST)
Closing the Exposure Window: Check Point Live Patch in PracticeFri 11 Dec 2026 @ 10:00 AM (CET)
Check Mates Live Netherlands: #51: Check Point SmartConsoile extensiesAbout CheckMates
Learn Check Point
Advanced Learning
WE SECURE YOUR AI TRANSFORMATION