1

I'm trying to execute SNMP-Get request on Checkpoint to get IP address of a route with OID .1.3.6.1.4.1.2620.1.6.51.1.2. Here we can see that syntax of this field is SYNTAX IpAddress. However, when I execute snmpget I receive an Integer value:

SNMPv2-SMI::enterprises.2620.1.6.51.1.2.1.0 = INTEGER: 50594820

What can be the problem? Or is it possible to decode this value?

2

IP addresses are integers (whole numbers). IPv4 addresses are 32-bit integers, and IPv6 addresses are 128-bit integers.

I assume that this is for an IPv4 address. To look at it as a dotted decimal address, take the binary 32 bits of the integer:

00000011000001000000010000000100

separate the octets with decimals:

00000011.00000100.00000100.00000100

and convert each octet to decimal:

3.4.4.4

You should always do IP address manipulation in binary. See How do you calculate the prefix, network, subnet, and host numbers?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.