temp_dhcp.template 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # ******************************************************************
  2. # Cobbler managed dhcpd.conf file
  3. #
  4. # generated from cobbler dhcp.conf template ($date)
  5. # Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
  6. # in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
  7. # overwritten.
  8. #
  9. # ******************************************************************
  10. ddns-update-style interim;
  11. allow booting;
  12. allow bootp;
  13. ignore client-updates;
  14. set vendorclass = option vendor-class-identifier;
  15. option pxe-system-type code 93 = unsigned integer 16;
  16. subnet subnet_mask netmask net_mask {
  17. option subnet-mask net_mask;
  18. range dynamic-bootp start end;
  19. default-lease-time 21600;
  20. max-lease-time 43200;
  21. next-server $next_server;
  22. #insert the static DHCP leases for configuration here
  23. class "pxeclients" {
  24. match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
  25. if option pxe-system-type = 00:02 {
  26. filename "ia64/elilo.efi";
  27. } else if option pxe-system-type = 00:06 {
  28. filename "grub/grub-x86.efi";
  29. } else if option pxe-system-type = 00:07 {
  30. filename "grub/grub-x86_64.efi";
  31. } else if option pxe-system-type = 00:09 {
  32. filename "grub/grub-x86_64.efi";
  33. } else {
  34. filename "pxelinux.0";
  35. }
  36. }
  37. }
  38. #for dhcp_tag in $dhcp_tags.keys():
  39. ## group could be subnet if your dhcp tags line up with your subnets
  40. ## or really any valid dhcpd.conf construct ... if you only use the
  41. ## default dhcp tag in cobbler, the group block can be deleted for a
  42. ## flat configuration
  43. # group for Cobbler DHCP tag: $dhcp_tag
  44. group {
  45. #for mac in $dhcp_tags[$dhcp_tag].keys():
  46. #set iface = $dhcp_tags[$dhcp_tag][$mac]
  47. host $iface.name {
  48. #if $iface.interface_type == "infiniband":
  49. option dhcp-client-identifier = $mac;
  50. #else
  51. hardware ethernet $mac;
  52. #end if
  53. #if $iface.ip_address:
  54. fixed-address $iface.ip_address;
  55. #end if
  56. #if $iface.hostname:
  57. option host-name "$iface.hostname";
  58. #end if
  59. #if $iface.netmask:
  60. option subnet-mask $iface.netmask;
  61. #end if
  62. #if $iface.gateway:
  63. option routers $iface.gateway;
  64. #end if
  65. #if $iface.enable_gpxe:
  66. if exists user-class and option user-class = "gPXE" {
  67. filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
  68. } else if exists user-class and option user-class = "iPXE" {
  69. filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
  70. } else {
  71. filename "undionly.kpxe";
  72. }
  73. #else
  74. filename "$iface.filename";
  75. #end if
  76. ## Cobbler defaults to $next_server, but some users
  77. ## may like to use $iface.system.server for proxied setups
  78. next-server $next_server;
  79. ## next-server $iface.next_server;
  80. }
  81. #end for
  82. }
  83. #end for