dhcp.template 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 172.17.0.0 netmask 255.255.0.0 {
  17. option routers 172.17.0.1;
  18. option domain-name-servers 172.17.0.1;
  19. option subnet-mask 255.255.0.0;
  20. range dynamic-bootp 172.17.0.10 172.17.0.254;
  21. default-lease-time 21600;
  22. max-lease-time 43200;
  23. next-server $next_server;
  24. class "pxeclients" {
  25. match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
  26. if option pxe-system-type = 00:02 {
  27. filename "ia64/elilo.efi";
  28. } else if option pxe-system-type = 00:06 {
  29. filename "grub/grub-x86.efi";
  30. } else if option pxe-system-type = 00:07 {
  31. filename "grub/grub-x86_64.efi";
  32. } else if option pxe-system-type = 00:09 {
  33. filename "grub/grub-x86_64.efi";
  34. } else {
  35. filename "pxelinux.0";
  36. }
  37. }
  38. }
  39. #for dhcp_tag in $dhcp_tags.keys():
  40. ## group could be subnet if your dhcp tags line up with your subnets
  41. ## or really any valid dhcpd.conf construct ... if you only use the
  42. ## default dhcp tag in cobbler, the group block can be deleted for a
  43. ## flat configuration
  44. # group for Cobbler DHCP tag: $dhcp_tag
  45. group {
  46. #for mac in $dhcp_tags[$dhcp_tag].keys():
  47. #set iface = $dhcp_tags[$dhcp_tag][$mac]
  48. host $iface.name {
  49. #if $iface.interface_type == "infiniband":
  50. option dhcp-client-identifier = $mac;
  51. #else
  52. hardware ethernet $mac;
  53. #end if
  54. #if $iface.ip_address:
  55. fixed-address $iface.ip_address;
  56. #end if
  57. #if $iface.hostname:
  58. option host-name "$iface.hostname";
  59. #end if
  60. #if $iface.netmask:
  61. option subnet-mask $iface.netmask;
  62. #end if
  63. #if $iface.gateway:
  64. option routers $iface.gateway;
  65. #end if
  66. #if $iface.enable_gpxe:
  67. if exists user-class and option user-class = "gPXE" {
  68. filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
  69. } else if exists user-class and option user-class = "iPXE" {
  70. filename "http://$cobbler_server/cblr/svc/op/gpxe/system/$iface.owner";
  71. } else {
  72. filename "undionly.kpxe";
  73. }
  74. #else
  75. filename "$iface.filename";
  76. #end if
  77. ## Cobbler defaults to $next_server, but some users
  78. ## may like to use $iface.system.server for proxied setups
  79. next-server $next_server;
  80. ## next-server $iface.next_server;
  81. }
  82. #end for
  83. }
  84. #end for