Advertisement
Guest User

Untitled

a guest
Aug 7th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.95 KB | None | 0 0
  1. # WARNING: Do not edit /var/lib/maas/dhcpd.conf yourself. MAAS will
  2. # overwrite any changes made there. Instead, you can modify dhcpd.conf by
  3. # using DHCP snippets over the API or through the web interface.
  4.  
  5. option arch code 93 = unsigned integer 16; # RFC4578
  6. option path-prefix code 210 = text; #RFC5071
  7.  
  8. #
  9. # Shorter lease time for PXE booting
  10. #
  11. class "PXE" {
  12. match if substring (option vendor-class-identifier, 0, 3) = "PXE";
  13. default-lease-time 30;
  14. max-lease-time 30;
  15. }
  16.  
  17. #
  18. # Define lease time globally (can be overriden globally or per subnet
  19. # with a DHCP snippet)
  20. #
  21. default-lease-time 600;
  22. max-lease-time 600;
  23.  
  24. #
  25. # Global DHCP snippets
  26. #
  27. # No global DHCP snippets defined
  28.  
  29. #
  30. # Failover Peers
  31. #
  32. failover peer "failover-vlan-5002" {
  33. secondary;
  34. address 10.22.5.20;
  35. peer address 10.22.5.22;
  36. max-response-delay 60;
  37. max-unacked-updates 10;
  38. load balance max seconds 3;
  39. }
  40.  
  41. #
  42. # Networks
  43. #
  44. shared-network vlan-5002 {
  45. subnet 10.22.5.0 netmask 255.255.255.0 {
  46. ignore-client-uids true;
  47. next-server 10.22.5.20;
  48. option subnet-mask 255.255.255.0;
  49. option broadcast-address 10.22.5.255;
  50. option domain-name-servers 10.22.5.20;
  51. option domain-name "maas.example.com";
  52. option domain-search "maas.example.com";
  53. option routers 10.22.5.1;
  54. option ntp-servers 10.22.5.20, 10.22.5.22;
  55. #
  56. # Bootloaders
  57. #
  58. if option arch = 00:00 and
  59. option user-class = "iPXE" {
  60. # ipxe
  61. filename "http://10.22.5.20:5248/ipxe.cfg";
  62. } elsif option arch = 00:00 {
  63. # pxe
  64. filename "lpxelinux.0";
  65. option path-prefix "http://10.22.5.20:5248/";
  66. if exists dhcp-parameter-request-list {
  67. # Always send the PXELINUX option (path-prefix)
  68. option dhcp-parameter-request-list = concat(
  69. option dhcp-parameter-request-list,d2);
  70. }
  71. } elsif option arch = 00:07 {
  72. # uefi_amd64
  73. filename "bootx64.efi";
  74. } elsif option arch = 00:09 {
  75. # uefi_amd64
  76. filename "bootx64.efi";
  77. } elsif option arch = 00:0f {
  78. # uefi_amd64_http
  79. filename "http://10.22.5.20:5248/bootx64.efi";
  80. option vendor-class-identifier "HTTPClient";
  81. } elsif option arch = 00:10 {
  82. # uefi_amd64_http
  83. filename "http://10.22.5.20:5248/bootx64.efi";
  84. option vendor-class-identifier "HTTPClient";
  85. } elsif option arch = 00:0B {
  86. # uefi_arm64
  87. filename "grubaa64.efi";
  88. } elsif option arch = 00:0C {
  89. # open-firmware_ppc64el
  90. filename "bootppc64.bin";
  91. } elsif option arch = 00:0E {
  92. # powernv
  93. filename "pxelinux.0";
  94. option path-prefix "ppc64el/";
  95. } elsif option arch = 00:1F {
  96. # s390x
  97. filename "boots390x.bin";
  98. option path-prefix "s390x/";
  99. } else {
  100. # pxe
  101. filename "lpxelinux.0";
  102. option path-prefix "http://10.22.5.20:5248/";
  103. if exists dhcp-parameter-request-list {
  104. # Always send the PXELINUX option (path-prefix)
  105. option dhcp-parameter-request-list = concat(
  106. option dhcp-parameter-request-list,d2);
  107. }
  108. }
  109.  
  110. #
  111. # Subnet DHCP snippets
  112. #
  113. # No DHCP snippets defined for subnet
  114. pool {
  115. failover peer "failover-vlan-5002";
  116. range 10.22.5.200 10.22.5.240;
  117. }
  118. }
  119. }
  120. shared-network vlan-5003 {
  121. subnet 10.22.4.0 netmask 255.255.255.0 {
  122. ignore-client-uids true;
  123. option subnet-mask 255.255.255.0;
  124. option broadcast-address 10.22.4.255;
  125. option domain-name-servers 10.22.5.20;
  126. option domain-name "maas.example.com";
  127. option domain-search "maas.example.com";
  128. option routers 10.22.4.1;
  129. option ntp-servers 10.22.5.20;
  130.  
  131. #
  132. # Subnet DHCP snippets
  133. #
  134. # No DHCP snippets defined for subnet
  135. pool {
  136. range 10.22.4.200 10.22.4.240;
  137. }
  138. }
  139. }
  140. shared-network vlan-5004 {
  141. subnet 10.22.0.0 netmask 255.255.254.0 {
  142. ignore-client-uids true;
  143. option subnet-mask 255.255.254.0;
  144. option broadcast-address 10.22.1.255;
  145. option domain-name-servers 10.22.5.20;
  146. option domain-name "maas.example.com";
  147. option domain-search "maas.example.com";
  148. option routers 10.22.0.1;
  149. option ntp-servers 10.22.5.20;
  150.  
  151. #
  152. # Subnet DHCP snippets
  153. #
  154. # No DHCP snippets defined for subnet
  155. pool {
  156. range 10.22.0.50 10.22.0.100;
  157. }
  158. pool {
  159. range 10.22.1.0 10.22.1.150;
  160. }
  161. }
  162. }
  163. shared-network vlan-5010 {
  164. subnet 10.25.14.0 netmask 255.255.255.0 {
  165. ignore-client-uids true;
  166. option subnet-mask 255.255.255.0;
  167. option broadcast-address 10.25.14.255;
  168. option domain-name-servers 10.22.5.20;
  169. option domain-name "maas.example.com";
  170. option domain-search "maas.example.com";
  171. option routers 10.25.14.1;
  172. option ntp-servers 10.22.5.20;
  173.  
  174. #
  175. # Subnet DHCP snippets
  176. #
  177. # No DHCP snippets defined for subnet
  178. pool {
  179. range 10.25.14.50 10.25.14.100;
  180. }
  181. }
  182. }
  183. shared-network vlan-5013 {
  184. subnet 10.22.8.0 netmask 255.255.255.0 {
  185. ignore-client-uids true;
  186. option subnet-mask 255.255.255.0;
  187. option broadcast-address 10.22.8.255;
  188. option domain-name-servers 10.10.10.1, 10.10.10.2;
  189. option domain-name "maas.example.com";
  190. option domain-search "maas.example.com";
  191. option routers 10.22.8.1;
  192. option ntp-servers 10.22.5.20;
  193.  
  194. #
  195. # Subnet DHCP snippets
  196. #
  197. # No DHCP snippets defined for subnet
  198. pool {
  199. range 10.22.8.200 10.22.8.240;
  200. }
  201. }
  202. }
  203. shared-network vlan-5014 {
  204. subnet 10.10.14.0 netmask 255.255.255.0 {
  205. ignore-client-uids true;
  206. option subnet-mask 255.255.255.0;
  207. option broadcast-address 10.10.14.255;
  208. option domain-name-servers 10.10.10.1, 10.10.10.2;
  209. option domain-name "maas.example.com";
  210. option domain-search "maas.example.com";
  211. option routers 10.10.14.1;
  212. option ntp-servers 10.22.5.20;
  213.  
  214. #
  215. # Subnet DHCP snippets
  216. #
  217. # No DHCP snippets defined for subnet
  218. pool {
  219. range 10.10.14.11 10.10.14.200;
  220. }
  221. }
  222. }
  223.  
  224. #all hosts here removed..
  225.  
  226. #
  227. # Notify MAAS
  228. #
  229. on commit {
  230. set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
  231. set clip = binary-to-ascii(10, 8, ".", leased-address);
  232. set cllt = binary-to-ascii(10, 32, "", encode-int(lease-time, 32));
  233. set clht = pick-first-value(option host-name, "(none)");
  234. execute(
  235. "/usr/sbin/maas-dhcp-helper", "notify",
  236. "--action", "commit", "--mac", clhw,
  237. "--ip-family", "ipv4", "--ip", clip,
  238. "--lease-time", cllt, "--hostname", clht,
  239. "--socket", "/var/lib/maas/dhcpd.sock");
  240. }
  241. on expiry {
  242. set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
  243. set clip = binary-to-ascii(10, 8, ".", leased-address);
  244. execute(
  245. "/usr/sbin/maas-dhcp-helper", "notify",
  246. "--action", "expiry", "--mac", clhw,
  247. "--ip-family", "ipv4", "--ip", clip,
  248. "--socket", "/var/lib/maas/dhcpd.sock");
  249. }
  250. on release {
  251. set clhw = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
  252. set clip = binary-to-ascii(10, 8, ".", leased-address);
  253. execute(
  254. "/usr/sbin/maas-dhcp-helper", "notify",
  255. "--action", "release", "--mac", clhw,
  256. "--ip-family", "ipv4", "--ip", clip,
  257. "--socket", "/var/lib/maas/dhcpd.sock");
  258. }
  259.  
  260. omapi-port 7911;
  261. key omapi_key {
  262. algorithm HMAC-MD5;
  263. secret "secret";
  264. };
  265. omapi-key omapi_key;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement