linux学习之pxe

 

 

pxe

[[email protected] ~]# yum install dhcp httpd tftp-server lftp -y ##安装需要的服务

linux学习之pxe

[[email protected] ~]# cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example  /etc/dhcp/dhcpd.conf

cp: overwrite ‘/etc/dhcp/dhcpd.conf’? y

[[email protected] ~]# vim /etc/dhcp/dhcpd.conf ##提供动态ip

 

  linux学习之pxe

linux学习之pxe

[[email protected] ~]# systemctl start dhcpd

[[email protected] ~]# systemctl start httpd

[[email protected] ~]# systemctl enable httpd

linux学习之pxe

[[email protected] ~]# vim /etc/xinetd.d/tftp

disable = no

linux学习之pxe

[[email protected] ~]# systemctl restart xinetd.service

 

[[email protected] rhel7]$ cd isolinux/

[[email protected] isolinux]$ ls

boot.cat  grub.conf   isolinux.bin  memtest     TRANS.TBL    vesamenu.c32

boot.msg  initrd.img  isolinux.cfg  splash.png  upgrade.img  vmlinuz

[[email protected] isolinux]$ scp * [email protected]:/var/lib/tftpboot/ ##复制需要的文件

[email protected]'s password:

boot.cat                                          100% 2048     2.0KB/s   00:00    

boot.msg                                          100%   84     0.1KB/s   00:00    

grub.conf                                         100%  321     0.3KB/s   00:00    

initrd.img                                        100%   38MB  37.9MB/s   00:01    

isolinux.bin                                      100%   24KB  24.0KB/s   00:00    

isolinux.cfg                                      100% 3166     3.1KB/s   00:00    

memtest                                           100%  172KB 172.4KB/s   00:00    

splash.png                                        100%  186     0.2KB/s   00:00    

TRANS.TBL                                         100% 2438     2.4KB/s   00:00    

upgrade.img                                       100%   43MB  43.1MB/s   00:01    

vesamenu.c32                                      100%  150KB 149.5KB/s   00:00    

vmlinuz                                           100% 5034KB   4.9MB/s   00:00    

linux学习之pxe

[[email protected] ~]# cd /var/lib/tftpboot/

[[email protected] tftpboot]# ls

boot.cat  grub.conf   isolinux.bin  memtest     TRANS.TBL    vesamenu.c32

boot.msg  initrd.img  isolinux.cfg  splash.png  upgrade.img  vmlinuz

[[email protected] tftpboot]# yum whatprovides */pxelinux.0 -y

[[email protected] tftpboot]# yum install syslinux.x86_64  -y

linux学习之pxe

[[email protected] tftpboot]# file /usr/share/syslinux/pxelinux.0

/usr/share/syslinux/pxelinux.0: data

 

 

[[email protected] tftpboot]# vim /etc/dhcp/dhcpd.conf

subnet 172.25.254.0 netmask 255.255.255.0 {

  range 172.25.254.80 172.25.254.90;

  option routers 172.25.254.254;

  next-server 172.25.254.134; ##服务器主机ip

  filename "pxelinux.0"; ##启动读取文件

}

linux学习之pxe

[[email protected] tftpboot]# systemctl restart dhcpd

[[email protected] tftpboot]# vim pxelinux.cfg/default

 62   menu label testestest

 linux学习之pxe

linux学习之pxe

linux学习之pxe

 linux学习之pxe