среда, 9 августа 2017 г.

PXE UEFI dnsmasq nginx centos 7

apt-get install dnsmasq nginx

 /etc/dnsmasq.conf  
   
 interface=enp1s0.11  
 domain=yourdomain.com  
 dhcp-range=192.168.36.200,192.168.36.205,255.255.255.128,1h  
   
 dhcp-match=set:efi-x86_64,option:client-arch,7  
 dhcp-match=set:efi-x86_64,option:client-arch,9  
 dhcp-match=set:efi-x86,option:client-arch,6  
 dhcp-match=set:bios,option:client-arch,0  
 dhcp-boot=tag:efi-x86_64,"efi64/EFI/BOOT/BOOTX64.EFI"  
 dhcp-boot=tag:efi-x86,"efi32/syslinux.efi"  
 dhcp-boot=tag:bios,"bios/lpxelinux.0"  
   
 enable-tftp  
 tftp-root=/srv/tftp  



root@debian:/srv/tftp# tree /srv/tftp
/srv/tftp/
├── bios
│   ├── images -> /srv/tftp/images
│   ├── ldlinux.c32
│   ├── libutil.c32
│   ├── menu.c32
│   ├── pxelinux.0
│   └── pxelinux.cfg
│       └── default
├── EFI -> /srv/tftp/efi64/EFI
├── efi64
│   └── EFI
│       ├── BOOT
│       │   ├── BOOTX64.EFI
│       │   ├── fonts
│       │   │   ├── TRANS.TBL
│       │   │   └── unicode.pf2
│       │   ├── grub.cfg
│       │   ├── grub.cfg.bak
│       │   ├── grubx64.efi
│       │   ├── MokManager.efi
│       │   └── TRANS.TBL
│       └── TRANS.TBL
└── images
    ├── efiboot.img
    ├── pxeboot
    │   ├── initrd.img
    │   ├── TRANS.TBL
    │   └── vmlinuz
    └── TRANS.TBL


diff -u grub.cfg.bak grub.cfg  
 --- grub.cfg.bak    2017-08-08 09:27:29.433040541 -0400  
 +++ grub.cfg  2017-08-08 12:07:26.874929487 -0400  
 @@ -21,7 +21,7 @@  
   
  ### BEGIN /etc/grub.d/10_linux ###  
  menuentry 'Install CentOS Linux 7' --class fedora --class gnu-linux --class gnu --class os {  
 -    linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet  
 +    linuxefi /images/pxeboot/vmlinuz inst.stage2=http://192.168.36.126/centos7  
     initrdefi /images/pxeboot/initrd.img  
  }  
  menuentry 'Test this media & install CentOS Linux 7' --class fedora --class gnu-linux --class gnu --class os {  

root@debian:/srv/tftp# cat ./bios/pxelinux.cfg/default 
timeout 100
default menu.c32

menu title ########## PXE Boot Menu ##########
label 1
   menu label ^1) Install CentOS 7
   kernel /images/pxeboot/vmlinuz
   append initrd=/images/pxeboot/initrd.img method=http://192.168.36.126/centos7 devfs=nomount

label 2
   menu label ^2) Boot from local drive
   localboot

mkdir /var/www/html/centos7/
mount -o loop /root/tmp/CentOS-7-x86_64-Minimal-1611.iso /var/www/html/centos7/

PXE UEFI dnsmasq nginx centos 7

apt-get install dnsmasq nginx /etc/dnsmasq.conf interface=enp1s0.11 domain=yourdomain.com dhcp-range=192.168.36.200,192.16...