rpm -ql dhcp |grep "dhcpd.conf"
vi /etc/dhcp/dhcpd.conf
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.240 192.168.2.254;
option subnet-mask 255.255.255.0;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.2.3;
filename "/pxelinux.0";
}
ystemctl enable dhcpd
systemctl start dhcpd
lsof -i udp:67
yum -y install tftp-server xinetd
vi /etc/xinetd.d/tftp
...
disable = no
systemctl enable xinetd
systemctl start xinetd
lsof -i udp:69
yum isntall httpd -y
systemctl enable httpd
systemctl start httpd
mkdir /var/www/html/CentOS-7.6
mount -o loop /opt/CentOS-7-x86_64-Minimal-1810.iso /var/www/html/CentOS-7.6
mkdir -p /var/www/html/CentOS-6.10
mount -o loop /opt/CentOS-6.10-x86_64-minimal.iso /var/www/html/CentOS-6.10/
pxe引导
yum -y install syslinux
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
cp -a /var/www/html/CentOS-7.6/isolinux/* /var/lib/tftpboot/
mkdir -p /var/lib/tftpboot/pxelinux.cfg
cp /var/www/html/CentOS-7.6/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
修改/var/lib/tftpboot/pxelinux.cfg/default
label linux
menu label ^Install CentOS 7
kernel vmlinuz
#append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet
#append initrd=initrd.img method=http://192.168.2.3/CentOS-7.6/ quiet
append initrd=initrd.img repo=http://192.168.2.3/CentOS-7.6/ quiet
systemctl start dhcpd
lsof -i udp:67
yum -y install tftp-server xinetd
vi /etc/xinetd.d/tftp
...
disable = no
systemctl enable xinetd
systemctl start xinetd
lsof -i udp:69
yum isntall httpd -y
systemctl enable httpd
systemctl start httpd
mkdir /var/www/html/CentOS-7.6
mount -o loop /opt/CentOS-7-x86_64-Minimal-1810.iso /var/www/html/CentOS-7.6
mkdir -p /var/www/html/CentOS-6.10
mount -o loop /opt/CentOS-6.10-x86_64-minimal.iso /var/www/html/CentOS-6.10/
pxe引导
yum -y install syslinux
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
cp -a /var/www/html/CentOS-7.6/isolinux/* /var/lib/tftpboot/
mkdir -p /var/lib/tftpboot/pxelinux.cfg
cp /var/www/html/CentOS-7.6/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
修改/var/lib/tftpboot/pxelinux.cfg/default
label linux
menu label ^Install CentOS 7
kernel vmlinuz
#append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet
#append initrd=initrd.img method=http://192.168.2.3/CentOS-7.6/ quiet
append initrd=initrd.img repo=http://192.168.2.3/CentOS-7.6/ quiet