Reply

Export a list of all subnets in /24 from all IPAM Networks

kizza88
Techie
Posts: 3
1591     0

Hi All,

 

I' am trying to get a list of all subnets in /24 format from all networks within IPAM. I have a large number of  networks which are /23, /22 and /21 and I need to extract a csv list as shown below (example network 10.0.0.0/22) .

 

Network

10.0.0.0/24

10.0.1.0/24

10.0.2.0/24

10.0.3.0/24

 

Thanks in advance.

 

 

Re: Export a list of all subnets in /24 from all IPAM Networks

Adviser
Posts: 100
1592     0

Hello,

 

You can search for networks based on their netmask.

Here is the WAPI call

https://grid-master/wapi/v2.7/network?network~=.0/24

Here is a sample curl command.

curl -k -u admin:Infoblox -X GET "https://grid-master/wapi/v2.7/network?network~=.0/24"

Hope this helps,

Krishna Vasudevan

Re: Export a list of all subnets in /24 from all IPAM Networks

kizza88
Techie
Posts: 3
1592     0

Hi Krishna,

 

Thanks for the reply.

 

The sample code will only return networks configured to /24 and doesn't return networks configured to /23, /22 and /21.

 

What I' am looking for is a list of all /24 networks and also some way of extracting all /24 ranges within /23, /22 and /21.So if I have a network 10.0.0.0/22 in IPAM, I want the script to output the below data.

 

10.0.0.0

10.0.1.0

10.0.2.0

10.0.3.0

 

Thanks.

Re: Export a list of all subnets in /24 from all IPAM Networks

Adviser
Posts: 100
1592     0

Hello,

 

For regular expression searches, only the IPv4 Address portion is supported. Searches for the CIDR portion is always an exact match.

 

To get the /24 within a network container, you can pass on the container information in the WAPI call as below.

curl -k -u admin:infoblox -X GET "https://grid-master/wi/v2.7/network?network~=.0/24&network_container=10.0.0.0/22"
Showing results for 
Search instead for 
Do you mean 

Recommended for You

Businesses are investing heavily into securing company resources from cyber-attacks form cybercrimin