Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 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
- #
- # No global DHCP snippets defined
- #
- # Failover Peers
- #
- failover peer "failover-vlan-5002" {
- secondary;
- address 10.22.5.20;
- peer address 10.22.5.22;
- max-response-delay 60;
- max-unacked-updates 10;
- load balance max seconds 3;
- }
- #
- # Networks
- #
- shared-network vlan-5002 {
- subnet 10.22.5.0 netmask 255.255.255.0 {
- ignore-client-uids true;
- next-server 10.22.5.20;
- option subnet-mask 255.255.255.0;
- option broadcast-address 10.22.5.255;
- option domain-name-servers 10.22.5.20;
- option domain-name "maas.example.com";
- option domain-search "maas.example.com";
- option routers 10.22.5.1;
- option ntp-servers 10.22.5.20, 10.22.5.22;
- #
- # Bootloaders
- #
- if option arch = 00:00 and
- option user-class = "iPXE" {
- # ipxe
- filename "http://10.22.5.20:5248/ipxe.cfg";
- } elsif option arch = 00:00 {
- # pxe
- filename "lpxelinux.0";
- option path-prefix "http://10.22.5.20:5248/";
- if exists dhcp-parameter-request-list {
- # Always send the PXELINUX option (path-prefix)
- option dhcp-parameter-request-list = concat(
- option dhcp-parameter-request-list,d2);
- }
- } elsif option arch = 00:07 {
- # uefi_amd64
- filename "bootx64.efi";
- } elsif option arch = 00:09 {
- # uefi_amd64
- filename "bootx64.efi";
- } elsif option arch = 00:0f {
- # uefi_amd64_http
- filename "http://10.22.5.20:5248/bootx64.efi";
- option vendor-class-identifier "HTTPClient";
- } elsif option arch = 00:10 {
- # uefi_amd64_http
- filename "http://10.22.5.20:5248/bootx64.efi";
- option vendor-class-identifier "HTTPClient";
- } elsif option arch = 00:0B {
- # uefi_arm64
- filename "grubaa64.efi";
- } elsif option arch = 00:0C {
- # open-firmware_ppc64el
- filename "bootppc64.bin";
- } elsif option arch = 00:0E {
- # powernv
- filename "pxelinux.0";
- option path-prefix "ppc64el/";
- } elsif option arch = 00:1F {
- # s390x
- filename "boots390x.bin";
- option path-prefix "s390x/";
- } else {
- # pxe
- filename "lpxelinux.0";
- option path-prefix "http://10.22.5.20:5248/";
- if exists dhcp-parameter-request-list {
- # Always send the PXELINUX option (path-prefix)
- option dhcp-parameter-request-list = concat(
- option dhcp-parameter-request-list,d2);
- }
- }
- #
- # Subnet DHCP snippets
- #
- # No DHCP snippets defined for subnet
- pool {
- failover peer "failover-vlan-5002";
- range 10.22.5.200 10.22.5.240;
- }
- }
- }
- shared-network vlan-5003 {
- subnet 10.22.4.0 netmask 255.255.255.0 {
- ignore-client-uids true;
- option subnet-mask 255.255.255.0;
- option broadcast-address 10.22.4.255;
- option domain-name-servers 10.22.5.20;
- option domain-name "maas.example.com";
- option domain-search "maas.example.com";
- option routers 10.22.4.1;
- option ntp-servers 10.22.5.20;
- #
- # Subnet DHCP snippets
- #
- # No DHCP snippets defined for subnet
- pool {
- range 10.22.4.200 10.22.4.240;
- }
- }
- }
- shared-network vlan-5004 {
- subnet 10.22.0.0 netmask 255.255.254.0 {
- ignore-client-uids true;
- option subnet-mask 255.255.254.0;
- option broadcast-address 10.22.1.255;
- option domain-name-servers 10.22.5.20;
- option domain-name "maas.example.com";
- option domain-search "maas.example.com";
- option routers 10.22.0.1;
- option ntp-servers 10.22.5.20;
- #
- # Subnet DHCP snippets
- #
- # No DHCP snippets defined for subnet
- pool {
- range 10.22.0.50 10.22.0.100;
- }
- pool {
- range 10.22.1.0 10.22.1.150;
- }
- }
- }
- shared-network vlan-5010 {
- subnet 10.25.14.0 netmask 255.255.255.0 {
- ignore-client-uids true;
- option subnet-mask 255.255.255.0;
- option broadcast-address 10.25.14.255;
- option domain-name-servers 10.22.5.20;
- option domain-name "maas.example.com";
- option domain-search "maas.example.com";
- option routers 10.25.14.1;
- option ntp-servers 10.22.5.20;
- #
- # Subnet DHCP snippets
- #
- # No DHCP snippets defined for subnet
- pool {
- range 10.25.14.50 10.25.14.100;
- }
- }
- }
- shared-network vlan-5013 {
- subnet 10.22.8.0 netmask 255.255.255.0 {
- ignore-client-uids true;
- option subnet-mask 255.255.255.0;
- option broadcast-address 10.22.8.255;
- option domain-name-servers 10.10.10.1, 10.10.10.2;
- option domain-name "maas.example.com";
- option domain-search "maas.example.com";
- option routers 10.22.8.1;
- option ntp-servers 10.22.5.20;
- #
- # Subnet DHCP snippets
- #
- # No DHCP snippets defined for subnet
- pool {
- range 10.22.8.200 10.22.8.240;
- }
- }
- }
- shared-network vlan-5014 {
- subnet 10.10.14.0 netmask 255.255.255.0 {
- ignore-client-uids true;
- option subnet-mask 255.255.255.0;
- option broadcast-address 10.10.14.255;
- option domain-name-servers 10.10.10.1, 10.10.10.2;
- option domain-name "maas.example.com";
- option domain-search "maas.example.com";
- option routers 10.10.14.1;
- option ntp-servers 10.22.5.20;
- #
- # Subnet DHCP snippets
- #
- # No DHCP snippets defined for subnet
- pool {
- range 10.10.14.11 10.10.14.200;
- }
- }
- }
- #all hosts here removed..
- #
- # 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(
- "/usr/sbin/maas-dhcp-helper", "notify",
- "--action", "commit", "--mac", clhw,
- "--ip-family", "ipv4", "--ip", clip,
- "--lease-time", cllt, "--hostname", clht,
- "--socket", "/var/lib/maas/dhcpd.sock");
- }
- on expiry {
- set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
- set clip = binary-to-ascii(10, 8, ".", leased-address);
- execute(
- "/usr/sbin/maas-dhcp-helper", "notify",
- "--action", "expiry", "--mac", clhw,
- "--ip-family", "ipv4", "--ip", clip,
- "--socket", "/var/lib/maas/dhcpd.sock");
- }
- on release {
- set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
- set clip = binary-to-ascii(10, 8, ".", leased-address);
- execute(
- "/usr/sbin/maas-dhcp-helper", "notify",
- "--action", "release", "--mac", clhw,
- "--ip-family", "ipv4", "--ip", clip,
- "--socket", "/var/lib/maas/dhcpd.sock");
- }
- omapi-port 7911;
- key omapi_key {
- algorithm HMAC-MD5;
- secret "secret";
- };
- omapi-key omapi_key;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement