MAAS × LXD

06 · Networking and DHCP

We will create a dynamic IP range on your lab subnet and enable MAAS DHCP on the untagged VLAN. This is essential for PXE and deployment.

Identify your subnet and fabric

maas admin subnets read | jq -r '.[] | [.name, .cidr, .vlan.fabric_id, .vlan.id] | @tsv' | column -t

Create a dynamic IP range

maas admin ipranges create type=dynamic start_ip=192.168.123.190 end_ip=192.168.123.253

Enable DHCP on the untagged VLAN

# find your rack hostname
maas admin rack-controllers read | jq -r '.[].hostname'
# enable DHCP (example uses fabric 2 and rack 'wintermute')
maas admin vlan update 2 untagged dhcp_on=true primary_rack=wintermute

Why this matters

MAAS uses DHCP to hand out addresses during commissioning and deployment. Without a dynamic range, DHCP cannot be enabled.

Avoid conflicts

Do not run another DHCP server on the same VLAN. If your router serves DHCP there, use a separate lab VLAN or disable the router DHCP.