Reply
Highlighted

How to get IPv6 subnets based on Infoblox REST API

kzhu_1
Techie
Posts: 8
3735     0

Post SERVER-ADDRESS/wapi/v1.0/network?network=2400:fe80::/32

but could not get the information of IPv6 subnet. Do anyone have any idea?

 

 

Getting a list of all IPv6 subnets

Adviser
Posts: 132
3736     0

You can get a list of all IPv6 subnets using a URL like

https://gm.example.com/wapi/v2.1/ipv6network

(Change the grid master name and the WAPI version number to match your system.)

For example, a curl command like the following will return a list of all IPv6 subnets displayed in XML format:

curl --tlsv1 --insecure --user 'admin:infoblox' 'https://gm.example.com/wapi/v2.1/ipv6network?_return_type=xml'

(If you'd like the list nicely formatted use _return_type=xml-pretty instead of _return_type=xml.) I have not tried this myself, but I believe that you can take the output from the above command and import it directly into Microsoft Excel for Windows.

Note that the command above assumes that you have only a single network view. If you have more than one network view and you want to get a list of IPv6 networks in a non-default network view then you have to specify the exact network view you want the list for. For example, if you want all IPv6 networks in the network view "view1" then you would use a command like the following:

curl --tlsv1 --insecure --user 'admin:infoblox' 'https://gm.example.com/wapi/v2.1/ipv6network?network_view=view1&_return_type=xml'

Also, the commands above return only "leaf" network objects, that is, networks that can directly contain DHCP ranges. If you want to return a list of networks that can contain other networks (network containers), substitute networkcontainer for network in the command:

 

curl --tlsv1 --insecure --user 'admin:infoblox' 'https://gm.example.com/wapi/v2.1/ipv6networkcontainer?_return_type=xml'

Did not work

kzhu_1
Techie
Posts: 8
3736     0

Hi,

 Have a test, but it did not work, and two issues occur.

1, Version 2.1 is not supoorted.

2, There is no "ipv6network" command

 

Try an earlier WAPI version

Adviser
Posts: 132
3736     0

WAPI version 2.1 is the version supported in NIOS 7.1. If you have an earlier version of NIOS then you should use the WAPI version associated with that NIOS version (or an earlier version). Here are the WAPI versions supported in the various NIOS versions (I've omitted some WAPI versions associated with NIOS patch releases):

WAPI  NIOS
1.0   6.6 
1.1   6.7
1.2   6.8
1.3   6.9 LD
1.4   6.10
1.5   6.11 LD
1.6   6.11
1.7   6.12
2.0   7.0
2.1   7.1
2.2   7.2

The ipv6network and ipv6networkcontainer objects were supported all the way back in WAPI version 1.0, so a command like the following should work in NIOS 6.6 or later:

curl --tlsv1 --insecure --user 'admin:infoblox' 'https://gm.example.com/wapi/v1.0/ipv6network'

Re: Getting a list of all IPv6 subnets

Anonymous
Not applicable
Posts: 9
3736     0

Hey,

 

Is there any way to get a list for both of them at the same time ? IPv6 and IPV4 without making 2 calls ?

Re: Getting a list of all IPv6 subnets

Adviser
Posts: 40
3736     0

Yes - you can use the object body request capability introduced in WAPI 2.1.  

 

E.g.

 

curl -k1 -u ibuser -H "Content-Type: application/json" -X POST https://[gridmaster]/wapi/v2.1/request -d '

[

    {

        "method": "GET",

        "object": "network"

},

    {

        "method": "GET",

        "object": "ipv6network"

}

]'

Showing results for 
Search instead for 
Do you mean 

Recommended for You