Maas and network configuration

The problem is that although I already have an external dns/dhcp server, MAAS assigns a new ip to the machine during the commissioning and deployment process. After deployment, it finishes with “static” settings in the /netplan/50-cloud-init.yml network configuration file. At this stage, I would like to set “renderer: NetworkManager” and “dhcp4:true” parameters for the related interface, but I have not been successful.

1- Why MAAS is changing the ip address of the machines in a subnet that is not authoritative?

2- How can I set the network configuration I want at the end of the deployment? I wrote a cloud-init script as below but it does not apply it after deployment.

version: 2
renderer: NetworkManager
dhcp4: true


Hi @elperro,

As you might know the configuration with external DHCP servers is not officially supported by MAAS. Btw, have you tried changing the IP settings of the machine?

Yes when i changed the setting all is good ,but the real problem is that “MAAS” takes the IP already assigned to another machine in the subnet and assigns it to the machine it is going to commission.

have you reserved the ip range according to the doc?

Thanks, I solved this problem with reserved IP. How can I make the statically assigned network settings in the remaining 50-cloud-init.yaml file as dhcp4: true automatically during the deployment process so after deployment, the machine gets its IP from external dhcp.

Could you please rephrase the question? Isn’t the machine already obtaining its IP address from your DHCP server?

No, MAAS finishes the deployment with static IP settings in the /etc/netplan/50-cloud-init.yaml file.

To summarize:
I set IP range, MAAS can assign ip to machines after for deployment.

1- For example client1: is the address registered in DHCP.

2- MAAS assigns IP when it starts PXE boot for deployment.

3- Deployment finishes and the 50-cloud-init.yml file contains the statically set IP address I need to change this setting manually.

4- When I remove the static settings in the yaml file and enter
“dhcp4:true” and
“renderer: NetworkManager” parameters, it works as I want.

Thank you. I solved the problem with “cloud-init”.
Here is my solution:

  - 'echo "network:" > /etc/netplan/50-cloud-init.yaml'
  - 'echo "  version: 2" >> /etc/netplan/50-cloud-init.yaml'
  - 'echo "  renderer: NetworkManager" >> /etc/netplan/50-cloud-init.yaml'
  - 'echo "  ethernets:" >> /etc/netplan/50-cloud-init.yaml'
  - 'for iface in $(ls /sys/class/net/ | grep -E "eth|eno|enp"); do echo "    $iface:" >> /etc/netplan/50-cloud-init.yaml; echo "      dhcp4: true" >> /etc/netplan/50-cloud-init.yaml; done'
  - 'netplan apply'
1 Like