Reply

Best practices for reserving ranges then adding hosts

Techie
Posts: 3
319     0

Hi,

I've read through lots of posts but not seen exactly what I'm looking for.

I need to reserve ranges for services. So when people reserve a new network they can't take one that is already reserved and they know not to steal a /28 from a reserved /24. I then need to automate assigning the next unused IP within that range for servers that come online.
I tired using the DHCP reservation as it leaves the range reserved at range level but the IPs unused. This disables the next IP function apparently within the range so I couldn't add a host using netx IP.

So what is the best practice for reserving a network at range level for a service but allowing IPs free IPs within that range to be assigned automatically?

Re: Best practices for reserving ranges then adding hosts

Adviser
Posts: 173
320     0

Hi,

 

This is what you can do:

  1. Create a /24 network, say 10.10.10.0/24
  2. Create a reservation range using all the IPs in the network, 10.10.10.1 - 10.10.10.254
  3. When you run a "next_available_network"or "next_available_ip" call against the network, it will return with an empty response.
  4. For servers that need to be allocated IP addresses from this reserved range, issue the "next_available_ip" call against the range, like below:
    API to get the range reference:
    curl -k -u <uname>:<pwd> -X GET 'https://grid-master/wapi/v2.10/range?network=10.10.10.0/24'
    Sample output:
    [
        {
            "_ref": "range/ZG5zLmRoY3BfcmFuZ2UkMTAuMTAuMTAuMS8xMC4xMC4xMC4yNTQvLy8wLw:10.10.10.1/10.10.10.254/default",
            "end_addr": "10.10.10.254",
            "network": "10.10.10.0/24",
            "network_view": "default",
            "start_addr": "10.10.10.1"
        }
    ]
    
    API to get next available IP within the range:
    curl -k -u <uname>:<pwd> -X POST 'https://grid-master/wapi/v2.10/range/ZG5zLmRoY3BfcmFuZ2UkMTAuMTAuMTAuMS8xMC4xMC4xMC4yNTQvLy8wLw:10.10.10.1/10.10.10.254/default?_function=next_available_ip'
    Sample output:
    {
        "ips": [
            "10.10.10.1"
        ]
    }
    

Hope this is helpful,

Regards,

Krishna

Showing results for 
Search instead for 
Did you mean: 

Recommended for You