Subnet¶
The subnet object defines the configuration of a single subnet for the DHCP server to process. Multiple subnets are allowed. The subnet can be attached to a local interface on DRP or relayed to DRP via a DHCP relay.
Fields¶
Field | Definition |
---|---|
ActiveEnd | ActiveEnd is the last non-reserved IP address we will hand non-reserved leases from. required: true swagger:strfmt ipv4 |
ActiveLeaseTime | ActiveLeaseTime is the default lease duration in seconds we will hand out to leases that do not have a reservation. required: true |
ActiveStart | ActiveStart is the first non-reserved IP address we will hand non-reserved leases from. required: true swagger:strfmt ipv4 |
AllocateEnd | AllocateEnd is the last IP address we will hand out on allocation calls 0.0.0.0/unset means last address in CIDR swagger:strfmt ipv4 |
AllocateStart | AllocateStart is the first IP address we will hand out on allocation calls 0.0.0.0/unset means first address in CIDR swagger:strfmt ipv4 |
Description | Description is a string for providing a simple description |
Documentation | Documentation is a string for providing additional in depth information. |
Enabled | Enabled indicates if the subnet should hand out leases or continue operating leases if already running. required: true |
Meta | Meta contains the meta data of the object. The type of this field is a key / value map/dictionary. The key type is string. The value type is also string. The general content of the field is undefined and can be an arbritary store. There are some common known keys: color - The color the UX uses when displaying icon - The icon the UX uses when displaying * title - The UX uses this for additional display information. Often the source of the object. Specific Object types use additional meta data fields. These are described at: https://docs.rackn.io/stable/redirect/?ref=rs_object_metadata |
Name | Name is the name of the subnet. Subnet names must be unique required: true |
NextServer | NextServer is the address of the next server in the DHCP/TFTP/PXE chain. You should only set this if you want to transfer control to a different DHCP or TFTP server. required: true swagger:strfmt ipv4 |
OnlyReservations | OnlyReservations indicates that we will only allow leases for which there is a preexisting reservation. required: true |
Options | Additional options to send to DHCP clients |
Options/Code | Code is a DHCP Option Code. required: true |
Options/Value | Value is a text/template that will be expanded and then converted into the proper format for the option code required: true |
Params | Params holds the values of parameters on the object. The field is a key / value store of the parameters. The key is the name of a parameter. The key is of type string. The value is the value of the parameter. The type of the value is defined by the parameter object. If the key doesn't reference a parameter, the type of the object can be anything. The system will enforce the named parameter's value's type. Go calls the "anything" parameters as "interface {}". Hence, the type of this field is a map[string]interface{}. |
Pickers | Pickers is list of methods that will allocate IP addresses. Each string must refer to a valid address picking strategy. The current ones are: "none", which will refuse to hand out an address and refuse to try any remaining strategies. "hint", which will try to reuse the address that the DHCP packet is requesting, if it has one. If the request does not have a requested address, "hint" will fall through to the next strategy. Otherwise, it will refuse to try any remaining strategies whether or not it can satisfy the request. This should force the client to fall back to DHCPDISCOVER with no requsted IP address. "hint" will reuse expired leases and unexpired leases that match on the requested address, strategy, and token. "nextFree", which will try to create a Lease with the next free address in the subnet active range. It will fall through to the next strategy if it cannot find a free IP. "nextFree" only considers addresses that do not have a lease, whether or not the lease is expired. "mostExpired" will try to recycle the most expired lease in the subnet's active range. All of the address allocation strategies do not consider any addresses that are reserved, as lease creation will be handled by the reservation instead. We will consider adding more address allocation strategies in the future. required: true |
PrefixParameter | PrefixParameter a string that should be the beginning of a set of option-based parameters |
Profiles | Profiles is an array of profiles to apply to this object in order when looking for a parameter during rendering. |
Proxy | Proxy indicates if the subnet should act as a proxy DHCP server. If true, the subnet will not manage ip addresses but will send offers to requests. It is an error for Proxy and Unmanaged to be true. required: true |
ReservedLeaseTime | ReservedLeasTime is the default lease time we will hand out to leases created from a reservation in our subnet. required: true |
SkipDAD | SkipDAD will cause the DHCP server to skip duplicate address detection via ping testing when in discovery phase. Only set this if you know nothing in this subnet will ever have address conflicts with any other system. |
Strategy | Strategy is the leasing strategy that will be used determine what to use from the DHCP packet to handle lease management. required: true |
Subnet | Subnet is the network address in CIDR form that all leases acquired in its range will use for options, lease times, and NextServer settings by default required: true pattern: ^([0-9]+.){3}[0-9]+/[0-9]+$ |
Unmanaged | Unmanaged indicates that dr-provision will never send boot-related options to machines that get leases from this subnet. If false, dr-provision will send whatever boot-related options it would normally send. It is an error for Unmanaged and Proxy to both be true. required: true |
The subnet object defines the configuration of a single subnet for the DHCP server to process. Multiple subnets are allowed. The subnet can represent a local subnet attached to a local interface (broadcast subnet) to DRP or a subnet that is being forwarded or relayed (relayed subnet) to DRP.
The subnet is uniquely identified by its Name
field. The subnet defines a CIDR-based range with a specific subrange to hand out for nodes that do not have explicit reservations (the ActiveStart
thru ActiveEnd
fields). The subnet also defines the NextServer
field in the PXE chain. This is usually an IP associated with DRP, but if the provisioner is disabled, this can be any next hop server. The lease times for both reserved and unreserved clients as specified with the ReservedLeaseTime
and ActiveLeaseTime
fields. The subnet can also me marked as only working for explicitly reserved nodes using the ReservedOnly
field.
Options¶
The subnet also allows for the specification of DHCP options to be sent to clients. These can be overridden by a reservation's specific options.
Some common options are:
Type | # | Description |
---|---|---|
IP | 3 | Default Gateway |
IP | 6 | DNS Server |
IP | 15 | Domain Name |
String | 67 | Next Boot File - e.g. ipxe.pxe |
Note
Golang template expansion also works in these fields. This can be used to make custom request-based reply options.
For example, this value in the Next Boot File option (67) will return a file based upon what type of machine is booting. If the machine supports, iPXE then an iPXE boot image is sent, if the system is marked for legacy bios, then ipxe.pxe is returned, otherwise return a 64-bit UEFI iPXE boot loader:
The data element for the template expansion as represented by the .
above is a map of strings indexed by an integer. The integer is the option number from the DHCP request's incoming options. The IP addresses and other data fields are converted to a string form (dotted quads or base 10 numerals).
Note
Option 67 is optional. When using DRP as the DHCP server, it will generate a bootfile like the above template expansion.
The final elements of a subnet are the Strategy
and Pickers
options. These are described in the DRP API JSON description. They define how a node should be identified (Strategy
), and the algorithm for picking addresses (Pickers
). The strategy can only be set to MAC
currently. This will use the MAC address of the node as its DHCP identifier. Others may show up in time.
Pickers¶
The Pickers
field defines an ordered list of methods to determine the address to hand out. Currently, this will default to hint
, nextFree
, and mostExpired
. The following options are available for the list.
Field | Description |
---|---|
hint |
Try to reuse the address that the DHCP packet is requesting if it has one. If the request does not have a requested address, hint will fall through to the next strategyx, otherwise, it will refuse to try any reamining strategies whether or not it can satisfy the request. This should force the client to fall back to DHCPDISCOVER with no requsted IP address. hint will reuse expired leases and unexpired leases that match on the requested address, strategy, and token. |
nextFree |
Within the subnet's pool of active IPs, choose the next free making sure to loop over all addresses before reuse. It will fall through to the next strategy if it cannot find a free IP. It only considers addresses that do not have a lease, whether or not the lease is expired. |
mostExpired |
If no free address is available, use the most expired address first. |
none |
Do not hand out an address and refuse to try any remaining strategies. |
All of the address allocation strategies do not consider any addresses that are reserved, as lease creation will be handled by the reservation instead.