/usr/lib/python3/dist-packages/provisioningserver/templates/dhcp/dhcpd.conf.template is in python3-maas-provisioningserver 2.4.0~beta2-6865-gec43e47e6-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | # WARNING: Do not edit /var/lib/maas/dhcpd.conf yourself. MAAS will
# overwrite any changes made there. Instead, you can modify dhcpd.conf by
# using DHCP snippets over the API or through the web interface.
option arch code 93 = unsigned integer 16; # RFC4578
option path-prefix code 210 = text; #RFC5071
#
# Shorter lease time for PXE booting
#
class "PXE" {
match if substring (option vendor-class-identifier, 0, 3) = "PXE";
default-lease-time 30;
max-lease-time 30;
}
#
# Define lease time globally (can be overriden globally or per subnet
# with a DHCP snippet)
#
default-lease-time 600;
max-lease-time 600;
#
# Global DHCP snippets
#
{{if len(global_dhcp_snippets) == 0}}
# No global DHCP snippets defined
{{endif}}
{{for global_dhcp_snippet in global_dhcp_snippets}}
# Name: {{global_dhcp_snippet['name']}}
{{if global_dhcp_snippet['description'] != ''}}
# Description: {{global_dhcp_snippet['description'] | oneline}}
{{endif}}
{{global_dhcp_snippet['value']}}
{{endfor}}
#
# Bootloaders
#
{{bootloader}}
#
# Failover Peers
#
{{for failover_peer in failover_peers}}
failover peer "{{failover_peer["name"]}}" {
{{failover_peer["mode"]}};
address {{failover_peer["address"]}};
peer address {{failover_peer["peer_address"]}};
max-response-delay 60;
max-unacked-updates 10;
load balance max seconds 3;
{{if failover_peer["mode"] == "primary"}}
mclt 3600;
split 255;
{{endif}}
}
{{endfor}}
#
# Networks
#
{{for shared_network in shared_networks}}
shared-network {{shared_network["name"]}} {
{{for dhcp_subnet in shared_network["subnets"]}}
subnet {{dhcp_subnet['subnet']}} netmask {{dhcp_subnet['subnet_mask']}} {
ignore-client-uids true;
{{if dhcp_subnet.get('next_server')}}
next-server {{dhcp_subnet['next_server']}};
{{endif}}
option subnet-mask {{dhcp_subnet['subnet_mask']}};
option broadcast-address {{dhcp_subnet['broadcast_ip']}};
{{if dhcp_subnet.get('dns_servers')}}
option domain-name-servers {{dhcp_subnet['dns_servers'] | commalist}};
{{endif}}
option domain-name "{{dhcp_subnet['domain_name']}}";
{{if dhcp_subnet['search_list']}}
option domain-search {{dhcp_subnet['search_list'] | quoted_commalist}};
{{endif}}
{{if dhcp_subnet['router_ip']}}
option routers {{dhcp_subnet['router_ip']}};
{{endif}}
{{if dhcp_subnet['ntp_servers_ipv4']}}
option ntp-servers {{dhcp_subnet['ntp_servers_ipv4']}};
{{endif}}
{{if dhcp_subnet['ntp_servers_ipv6']}}
option dhcp6.sntp-servers {{dhcp_subnet['ntp_servers_ipv6']}};
{{endif}}
{{if shared_network['mtu'] and shared_network['mtu'] != 1500}}
option interface-mtu {{shared_network['mtu']}};
{{endif}}
#
# Subnet DHCP snippets
#
{{if len(dhcp_subnet['dhcp_snippets']) == 0}}
# No DHCP snippets defined for subnet
{{endif}}
{{for dhcp_snippet in dhcp_subnet['dhcp_snippets']}}
# Name: {{dhcp_snippet['name']}}
{{if dhcp_snippet['description'] != ''}}
# Description: {{dhcp_snippet['description'] | oneline}}
{{endif}}
{{for line in dhcp_snippet['value'].splitlines()}}
{{line}}
{{endfor}}
{{endfor}}
{{for pool in dhcp_subnet['pools']}}
pool {
{{if pool.get('failover_peer')}}
failover peer "{{pool['failover_peer']}}";
{{endif}}
range {{pool['ip_range_low']}} {{pool['ip_range_high']}};
}
{{endfor}}
}
{{endfor}}
}
{{endfor}}
#
# Hosts
#
{{for host in hosts}}
# {{host['host']}}
host {{host['mac'].replace(":", "-")}} {
#
# Node DHCP snippets
#
{{if len(host['dhcp_snippets']) == 0}}
# No DHCP snippets defined for host
{{endif}}
{{for dhcp_snippet in host['dhcp_snippets']}}
# Name: {{dhcp_snippet['name']}}
{{if dhcp_snippet['description'] != ''}}
# Description: {{dhcp_snippet['description'] | oneline}}
{{endif}}
{{for line in dhcp_snippet['value'].splitlines()}}
{{line}}
{{endfor}}
{{endfor}}
hardware ethernet {{host['mac']}};
fixed-address {{host['ip']}};
}
{{endfor}}
#
# Notify MAAS
#
on commit {
set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
set clip = binary-to-ascii(10, 8, ".", leased-address);
set cllt = binary-to-ascii(10, 32, "", encode-int(lease-time, 32));
set clht = pick-first-value(option host-name, "(none)");
execute(
"{{dhcp_helper}}", "notify",
"--action", "commit", "--mac", clhw,
"--ip-family", "ipv4", "--ip", clip,
"--lease-time", cllt, "--hostname", clht,
"--socket", "{{dhcp_socket}}");
}
on expiry {
set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
set clip = binary-to-ascii(10, 8, ".", leased-address);
execute(
"{{dhcp_helper}}", "notify",
"--action", "expiry", "--mac", clhw,
"--ip-family", "ipv4", "--ip", clip,
"--socket", "{{dhcp_socket}}");
}
on release {
set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
set clip = binary-to-ascii(10, 8, ".", leased-address);
execute(
"{{dhcp_helper}}", "notify",
"--action", "release", "--mac", clhw,
"--ip-family", "ipv4", "--ip", clip,
"--socket", "{{dhcp_socket}}");
}
omapi-port 7911;
key omapi_key {
algorithm HMAC-MD5;
secret "{{omapi_key}}";
};
omapi-key omapi_key;
|