Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

API & Integration

Reply
Highlighted
Accepted Solution

Find subnet given device IP

Techie
Posts: 1
2364     0

Hi,

 

I'm doing a piece of work to locate a bunch of devices across our network. I have a list of IP addresses but don't have the masks associated with each device.

With the mask I can soon determine which subnet the device is on and where it is in our network.

 

Is anyone able to suggest a method of using the API to return the subnet or mask for a given IP as per the data held in InfoBlox?

 

Andy.

Highlighted

Re: Find subnet given device IP

Adviser
Posts: 200
2364     0
You can use the “contains_address” query to find the network (and mask) that any given IP belongs to in the database. Look at the network object in the WAPI or PAPI documentation to see information on its usage. I think that’s what you’re looking for.
Highlighted

Re: Find subnet given device IP

Adviser
Posts: 417
2364     0

via - REST api

https://infoblox_IP/wapi/v2.3.1/network?network~=3.1.1.1&_return_fields%2B=network

 

Returns

network: "3.1.1.128/25"


Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh
Highlighted

Re: Find subnet given device IP

Techie
Posts: 3
2364     0

Isn't that just a string search? The host address 3.1.1.1 is not actually in the network 3.1.1.128/25.

That network contains host addresses in the range 3.1.1.128 - 3.1.1.255.

Showing results for 
Search instead for 
Do you mean 

Recommended for You