Subnet management (deb/2.9/CLI)

The topic of subnet management pertains to whether or not MAAS is in full control of a subnet. When a subnet is managed, MAAS handles all aspects of IP address allocation. This process includes DHCP leases and assigned static addresses. Typically MAAS would have one managed subnet, but any additional subnets can be unmanaged. This arrangement allows for more control over which subnet gets used for DHCP and which ones do not. Additionally, as detailed below, an unmanaged subnet treats reserved IP ranges differently, and in a way that some administrators find more intuitive.

Seven questions you may have:

  1. What are managed subnets?
  2. What are unmanaged subnets?
  3. What is IP address tracking?
  4. How do I control subnet management
  5. How do I determine a fabric ID to use in other CLI subnet calls?
  6. How do I set a default gateway with the CLI?
  7. How do i set the DNS server with the CLI?

Managed subnets

When you enable management for a subnet, MAAS will:

  1. Lease addresses for DHCP from a reserved dynamic IP range
  2. Assign static addresses not included in a reserved IP range, typically via ‘Auto assign’ IP allocation mode for a node.

See Concepts and terms for an explanation of the two kinds of reserved IP ranges MAAS uses and Post-commission configuration for information on IP allocation modes.

Unmanaged subnets

When management is disabled for a subnet, the definition of a reserved IP range differs from the managed mode. Here, a reserved IP range tells MAAS to only allocate addresses from this range (via ‘Auto assign’). Also, DHCP will never lease addresses from an unmanaged subnet.

Controlling subnet management

By default, MAAS manages subnets in your configuration, but it is easy to change this.

To enable or disable subnet management:

maas $PROFILE subnet update $SUBNET_CIDR managed=false|true

For example, to disable:

maas $PROFILE subnet update 192.168.1.0/24 managed=false

You can use the subnet’s ID in place of the CIDR address.

Determine fabric ID

To determine a fabric ID based on a subnet address:

FABRIC_ID=$(maas $PROFILE subnet read $SUBNET_CIDR \
    | grep fabric | cut -d ' ' -f 10 | cut -d '"' -f 2)

This may come in handy when you need a fabric ID for other CLI calls.

Set a default gateway

To set the default gateway for a subnet:

maas $PROFILE subnet update $SUBNET_CIDR gateway_ip=$MY_GATEWAY

Set a DNS server

To set the DNS server for a subnet:

maas $PROFILE subnet update $SUBNET_CIDR dns_servers=$MY_NAMESERVER

IP address tracking

MAAS will keep track of all assigned addresses, regardless of whether they come from managed or unmanaged subnets.