How to customise DHCP

*Errors or typos? Topics missing? Hard to read? Let us know.

Enable MAAS DHCP

  1. Navigate to Subnets > VLAN > Configure DHCP.
    2.Choose rack controller or relay to another VLAN.
  2. Set a Reserved dynamic range (optional).
  3. Save changes.

Create an IP range

  1. Select Subnets, choose a subnet, and Reserve range (dynamic or static).
  2. Enter Start and End IP addresses, then Save.

Edit, delete, or extend IP Range

  1. Edit or Delete: Go to Menu > Edit/Delete reserved range.
  2. Extend: Select Reserve dynamic range.

Enable DHCP

maas $PROFILE vlan update $FABRIC_ID $VLAN_TAG dhcp_on=True primary_rack=$PRIMARY_RACK_CONTROLLER

For high availability (HA):

maas $PROFILE vlan update $FABRIC_ID $VLAN_TAG dhcp_on=True primary_rack=$PRIMARY_RACK_CONTROLLER secondary_rack=$SECONDARY_RACK_CONTROLLER

Set a default gateway

maas $PROFILE subnet update $SUBNET_CIDR gateway_ip=$MY_GATEWAY

Set up a DHCP relay

  • UI:
    Navigate to Subnets > Relay DHCP, set target VLAN, Save.

  • CLI:

maas $PROFILE vlan update $FABRIC_ID $VLAN_VID_SRC relay_vlan=$VLAN_ID_TARGET

Manage DHCP snippets

  • UI:
    Add, edit, or delete snippets via Settings > DHCP snippets.

  • CLI:

maas $PROFILE dhcpsnippets create name=$NAME value=$CONFIG
maas $PROFILE dhcpsnippets read

Create IP Ranges (CLI)

  • Dynamic:
maas $PROFILE ipranges create type=dynamic start_ip=$START_IP end_ip=$END_IP
  • Reserved:
maas $PROFILE ipranges create type=reserved start_ip=$START_IP end_ip=$END_IP

DNS Records

  • A/AAAA records:
maas $PROFILE dnsresources create fqdn=$HOSTNAME.$DOMAIN ip_addresses=$IPV4/6_ADDRESS
  • CNAME:
maas $PROFILE dnsresource-records create fqdn=$HOSTNAME rrtype=cname rrdata=$ALIAS

Resolve common DHCP issues

  1. Network unreachable: Check external DHCP setup, static IP config, and netplan settings.
  2. DHCP service failures: Check logs, fix configs, restart MAAS services, clear proxy cache, verify settings, and repair the database.

Last updated 30 days ago.