ISC-DHCP-SERVER iPXE

DHCP

/etc/dhcp/dhcpd.conf

allow booting;
allow bootp;

option domain-name "klg.edu";
option domain-name-servers 192.168.1.193;
option option-128 code 128=string;
option option-128 code 129=text;
option rfc3442-classless-static-routes code 121 = array of integer 8;
option ms-classless-static-routes code 249 = array of integer 8;

option space pxelinux;
option pxelinux.magic code 208 = string;
option pxelinux.configfile code 209 = text;
option pxelinux.pathprefix code 210 = text;
option pxelinux.reboottime code 211 = unsigned integer 32;

option architecture-type code 93 = unsigned integer 16;

option space ipxe;
option ipxe-encap-opts code 175 = encapsulate ipxe;
option ipxe.priority code 1 = signed integer 8;
option ipxe.keep-san code 8 = unsigned integer 8;
option ipxe.skip-san-boot code 9 = unsigned integer 8;
option ipxe.syslogs code 85 = string;
option ipxe.cert code 91 = string;
option ipxe.privkey code 92 = string;
option ipxe.crosscert code 93 = string;
option ipxe.no-pxedhcp code 176 = unsigned integer 8;
option ipxe.bus-id code 177 = string;
option ipxe.san-filename code 188 = string;
option ipxe.bios-drive code 189 = unsigned integer 8;
option ipxe.username code 190 = string;
option ipxe.password code 191 = string;
option ipxe.reverse-username code 192 = string;
option ipxe.reverse-password code 193 = string;
option ipxe.version code 235 = string;
option iscsi-initiator-iqn code 203 = string;
# Feature indicators
option ipxe.pxeext code 16 = unsigned integer 8;
option ipxe.iscsi code 17 = unsigned integer 8;
option ipxe.aoe code 18 = unsigned integer 8;
option ipxe.http code 19 = unsigned integer 8;
option ipxe.https code 20 = unsigned integer 8;
option ipxe.tftp code 21 = unsigned integer 8;
option ipxe.ftp code 22 = unsigned integer 8;
option ipxe.dns code 23 = unsigned integer 8;
option ipxe.bzimage code 24 = unsigned integer 8;
option ipxe.multiboot code 25 = unsigned integer 8;
option ipxe.slam code 26 = unsigned integer 8;
option ipxe.srp code 27 = unsigned integer 8;
option ipxe.nbi code 32 = unsigned integer 8;
option ipxe.pxe code 33 = unsigned integer 8;
option ipxe.elf code 34 = unsigned integer 8;
option ipxe.comboot code 35 = unsigned integer 8;
option ipxe.efi code 36 = unsigned integer 8;
option ipxe.fcoe code 37 = unsigned integer 8;
option ipxe.vlan code 38 = unsigned integer 8;
option ipxe.menu code 39 = unsigned integer 8;
option ipxe.sdi code 40 = unsigned integer 8;
option ipxe.nfs code 41 = unsigned integer 8;

default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
authoritative;
log-facility local7;
option ip-forwarding true;
option mask-supplier false;

subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.31 192.168.1.64;
    
    option domain-name-servers 192.168.1.193;
    default-lease-time 600;
    max-lease-time 7200;
    option broadcast-address 192.168.1.255;
    option routers 192.168.1.1;
    #ping-check true;
    # DHCP option 60 PXEClient
    option vendor-class-identifier "PXEClient";
    option vendor-encapsulated-options 01:04:00:00:00:00:ff;
    next-server 192.168.1.193;

    if exists user-class and option user-class = "iPXE" {
      filename "http://192.168.1.193/winpe/boot.ipxe";
    } else {
        filename "undionly.kpxe";
    }

    host hp01 {
        hardware ethernet ;
        fixed-address ;
    }

/srv/www/winpe/boot.ipxe

#!ipxe
 
cpuid --ext 29 && set arch amd64 || set arch x86
kernel wimboot
initrd ${arch}/media/Boot/BCD                     BCD
initrd ${arch}/media/Boot/boot.sdi                boot.sdi
initrd ${arch}/media/sources/boot.wim             boot.wim
boot

参考文献:

https://ipxe.org/howto/chainloading
https://ipxe.org/howto/winpe

你可能感兴趣的:(boot)