Static allocation of IP Address

Hi I am new to MAAS, after installing maas and PXE booting the devices, I have defined the each host in a DHCP snippet with global scope. For each machine they are getting the right static IP address I have defined but as I deploy the machines they change the address. How can I preserve the static IPs I define in the global config

host xxx { hardware ethernet xx; fixed-address 128.x.x.x; }

For context I have turned on managed allocations of IP addresses, and reserved a dynamic range(where MAAS does the allocation).

Hey @hussainahmad welcome to the community :slight_smile:

Have you changed the IP address mode in the machine? You can edit it from here

In particular

  1. You can set a static ip with MAAS
  2. if you set the IP mode to DHCP then your snippet will do the job as well

Thanks for the quick response. How can I automate the this for all the machines so each time the autoassigning, automatically gets an address from the DHCP server ?

Still even after assigning MAAS managed DHCP the server gets the wrong IP address after deployment and the one that I have described in the config file is changed.

MAAS uses two IP ranges for commissioning and one for deployments, you can read more about these ranges here. Could you double check that you have reserved the ranges properly?

I am currently using a dynamic reserved range which is in the range 128.xx.xx.110 -120, and then adding a snippet to customize machines for static allocation in the range (11-36) on the same subnet. Although I am not reserving this range for the machines. If I dont reserve the range would maas allocate a machine in this range or the IP address even when I have described the MAC–>IP settings in the snippet ?

Could you try the following:

  1. add a reserved range from 11 to 36
  2. commission the machine (it should use an ip from the dynamic range)
  3. change the IP model to DHCP
  4. deploy

It should use the mapping you provided in the DHCP snippet. Let me know if it works

Should I add DHCP snippet to the global setting or the per subnet setting, I would like to PXE boot the machine from the same IP address (11-36) so I have added snippets for static allocation on both the global(get the same IP for PXE) and subnet level(so when I deploy the machine it gets the same address) , that is why I have reserve the dynamic range (11-36). I have tried the above and it works but how will the this config work ?

I think you should be good with the subnet one. Could you confirm that?