5
=========================
7
=========================
11
This feature is available in MAAS versions 2.0 and above. Modifications made
12
directly to dhcpd.conf.template or dhcpd6.conf.template are no longer
15
MAAS allows customizing dhcpd.conf and dhcpd6.conf through the use of DHCP
16
snippets. DHCP snippets are user defined dhcpd.conf configuration options which
17
are inserted into /var/lib/maas/dhcpd.conf and /var/lib/maas/dhcpd6.conf by
18
MAAS. Custom dhcpd.conf configuration options can be inserted either globally,
19
on a subnet, or on a node. For information about dhcpd.conf options refer to
20
the dhcpd.conf man or info page.
22
Creating a DHCP Snippet
23
-----------------------
25
Administrators can create DHCP Snippets over the API using the following command:::
27
$ maas <profile> dhcpsnippets create name=<DHCP Snippet Name> value=<valid DHCP configuration options>
29
The name of the DHCP snippet will be added to /var/lib/maas/dhcpd.conf and
30
/var/lib/maas/dhcpd6.conf as a comment above the value. Optionally a
31
description can also be specified as such::
33
$ maas <profile> dhcpsnippets create name=<DHCP Snippet Name> value=<valid DHCP configuration options> description=<DHCP Snippet description>
38
If no subnet or node is specified, the DHCP Snippet will be considered global.
39
A global DHCP Snippet is a configuration option which is applied to all VLANS,
40
subnets, and nodes. The global_snippet flag can also be used to force a DHCP
41
Snippet to be global::
43
$ maas <profile> dhcpsnippets create name=<DHCP Snippet Name> value=<valid DHCP configuration options> global_snippet=true
48
DHCP Snippets can be applied only to a specific subnet as follows::
50
$ maas <profile> dhcpsnippets create name=<DHCP Snippet Name> value=<valid DHCP configuration options> subnet=<subnet id or cidr>
55
DHCP Snippets can be applied only to a specific node. When a node is specified,
56
each snippet will be added to the host entry for each interface. A node can be
57
specified as follows::
59
$ maas <profile> dhcpsnippets create name=<DHCP Snippet Name> value=<valid DHCP configuration options> node=<system_id or hostname>
61
DHCP Snippet Enablement
62
^^^^^^^^^^^^^^^^^^^^^^^
64
DHCP Snippets can be turned off by using the enabled flag option as follows::
66
$ maas <profile> dhcpsnippets create name=<DHCP Snippet Name> value=<valid DHCP configuration options> enabled=false
71
To list all DHCP Snippets use the following command::
73
$ maas <profile> dhcpsnippets read
75
To list a particular DHCP Snippet use the following command.::
77
$ maas <profile> dhcpsnippet read <DHCP Snippet id or name>
79
Updating a DHCP Snippet
80
-----------------------
82
Administrators can update the DHCP Snippet attributes using the following
85
$ maas <profile> dhcpsnippet update <DHCP Snippet id or name> <options>
87
DHCP Snippet Value History
88
--------------------------
90
MAAS stores the complete history of changes made to the DHCP Snippet's
91
value. MAAS only uses the latest revision of the value when writing
98
Reverting a value will result in all later versions being deleted!
100
The revert operation allows the user to revert to a previous value. When
101
specifying what to revert to the user can either provide the value id or a
102
negative number representing how many revivisions to go back::
104
$ maas <profile> dhcpsnippet revert <DHCP Snippet id or name> to=<value id or negative number>
106
Deleting a DHCP Snippet
107
-----------------------
109
Administrators can delete a DHCP Snippet using the following command::
111
$ maas <profile> dhcpsnippet delete <DHCP Snippet id or name>