PXE stands for Preboot eXecution Environment.
| Necessities | Note |
|---|---|
| xinetd | |
| dhcp | /etc/dhcpd.conf |
| tftp-server | /etc/xinetd.d/tftp |
| syslinux syslinux-tftpboot | /var/lib/tftpboot/pxelinux.0 /var/lib/tftpboot/menu.c32 |
| DVD Image | DVD:/images/pxeboot/vmlinuz (Kernel) DVD:/images/pxeboot/initrd.img (Initial RAM Disk) |
| httpd | /etc/httpd.conf |
| /var/lib/tftpboot/pxelinux.0 | pxelinux.0 is a pxe configuration file. |
| /var/lib/tftpboot/menu.c32 | |
| /var/lib/tftpboot/pxelinux.cfg/default | PXE Menu File |
| /var/lib/tftpboot/centosXXX/vmlinuz | copy from iso:/images/pxeboot/vmlinuz |
| /var/lib/tftpboot/centosXXX/initrd.img | copy from iso:/images/pxeboot/initrd.img |
yum install tftp-server
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no <- Change from 'yes' to 'no'
per_source = 11
cps = 100 2
flags = IPv4
}
# systemctl restart xinetd
yum install dhcp
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 {
option routers 192.168.0.1; <- GW
option subnet-mask 255.255.255.0;
option nis-domain "domain.org";
option domain-name "domain.org";
option domain-name-servers 192.168.0.10; <- DNS Server's IP
filename "pxelinux.0"; <- Program to be initially loaded
Example: /var/lib/tftpboot/pxelinux.0
range dynamic-bootp 192.168.0.128 192.168.0.254;
default-lease-time 21600;
max-lease-time 43200;
}
# systemctl restart dhcpd
/var/lib/tftpboot/
centos5.4/
initrd.img
vmlinuz
centos6.7/
initrd.img
vmlinuz
centos7/
initrd.img
vmlinuz
debian7.4/
boot-screens
initrd.gz
linux
pexelinux.0
pxelinux.cfg/default
/var/www/html/repo
centos6.7
centos7
# mount -o loop /tmp/CentOS-7-x86_64-Minimal-1503-01.iso /mnt # mkdir /var/lib/tftpboot/centos7 # cp /mnt/images/pxeboot/vmlinuz /var/lib/tftpboot/centos7 # cp /mnt/images/pxeboot/initrd.img /var/lib/tftpboot/centos7 # mkdir -p /var/www/html/repo/centos7 # cp -r /mnt/* /var/ww/html/repo/centos7/
yum install syslinux syslinux-tftpboot
# ls -l /var/lib/tftpboot/pxelinux.0 # ls -l /var/lib/tftpboot/menu.c32
default menu.c32
timeout 100
MENU TITLE **** PXE Boot Menu ****
label 1
MENU LABEL ^1. Boot from Local HDD
localboot 1
label 2
MENU LABEL ^2. Install CentOS 5.4
kernel centos5.4/vmlinuz
append load initrd=centos5.4/initrd.img inst.repo=http://xx.xx.xx.xx/repo/centos5.4/
label 3
menu label ^3) install centos 7
kernel centos7/vmlinuz
append load initrd=centos7/initrd.img ks=http://xx.xx.xx.xx/ks/centos7-ks.cfg
label 9
menu label ^9) Boot from local drive
localboot
# yum install httpd
# systemctl restart httpd
/tftpboot/linux-install/pxelinux.cfg/default
default linux prompt 0 <- '0' is defalt boot. '1' is boot pronpt. timeout 100 <- 100ms = 10sec label linux kernel vmlinuz #kickstart file is ks.cfg append ks=http://192.168.0.10/ks.cfg noipv6 load initrd=initrd.img devfs=nomount