Infoblox’s global team of threat hunters uncovers a DNS operation with the ability to bypass traditional security measures and control the Great Firewall of China. Read about “Muddling Meerkat” and the many other threat actors discovered by Infoblox Threat Intel here.

API Examples

Reply

REST API call - Getting subnet from IP

Techie
Posts: 10
2825     0

Is there a WAPI REST API call to get the subnet for an IP address?

 

Thanks in advance.

Re: REST API call - Getting subnet from IP

[ Edited ]
Moderator
Moderator
Posts: 293
2825     0

Yes, request the ipv4address object, and ask for the network field:

 

curl -k1 -u admin:infoblox -X GET 'https://gm.example.com/wapi/v2.11/ipv4address?ip_address=192.168.2.1&_return_fields=network'

which returns:

[
    {
        "_ref": "ipv4address/Li5pcHY0X2FkZHJlc3MkMTkyLjE2OC4yLjEvMA:192.168.2.1", 
        "network": "192.168.2.0/24"
    }
]

Re: REST API call - Getting subnet from IP

Techie
Posts: 10
2825     0

Thank you @MattR for the prompt response!

Showing results for 
Search instead for 
Did you mean: 

Recommended for You