temp_dhcp.template 3.0 KB

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