步骤:
795 yum install -y dhcp
796 cp -rfp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf
797 yum install -y tftp
798 yum install -y tftp-server
799 vim /etc/dhcp/dhcpd.conf
800 ifconfig
801 cp -p ifcfg-ens33 ifcfg-ens36
803 cd /etc/sysconfig/network-scripts
804 ls
805 cp -p ifcfg-ens33 ifcfg-ens36
806 vim ifcfg-ens36
807 ifconfig
808 systemctl restart network
809 ifconfig
810 systemctl start dhcpd
811 systemctl status dhcpd
812 rpm -q tftp-server
813 yum install -y xinetd
814 vim /etc/xinetd.d/tftp
815 mount /dev/sr0 /mnt
816 cd /mnt/images/pxeboot/
817 ls
818 cp initrd.img vmlinuz /var/lib/tftpboot/
819 systemctl start xinetd.service
820 systemctl enable xinetd.service
821 systemctl start tftp
822 systemctl enable tftp
823 netstat -atnulp | grep xinet
824 netstat -atnulp | grep dhcp
825 yum provides /pxelinux.0
826 yum -y install syslinux
827 rpm -ql syslinux | grep pxelinux
828 cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
829 ls /var/lib/tftpboot
830 mkdir /var/lib/tftpboot/pxelinux.cfg
831 vim /var/lib/tftpboot/pxelinux.cfg/default
832 yum -y install vsftpd
833 mkdir /var/ftp/centos7
834 cp -rf /mnt/ /var/ftp/centos7
835 yum -y install vsftpd
836 systemctl start vsftpd
837 vim /var/lib/tftpboot/pxelinux.cfg/default
838 systemctl start vsftpd
839 vim /var/lib/tftpboot/pxelinux.cfg/default
840 vim anaconda-ks.cfg
841 yum install -y system-config-kickstart
842 systemctl restart vsftpd
843 systemctl restart network
844 yum install -y system-config-kickstart
这里如果出现 /var/run/yum.pid 被锁定
尝试删除 /var/run/yum.pid 重新yum
845 rm -f /var/run/yum.pid
846 yum install -y system-config-kickstart
847 ls /var/ftp
848 cat /var/ftp/ks.cfg
849 cd
850 vim anaconda-ks.cfg
851 vim /var/ftp/ks.cfg
852 systemctl start vsftpd
853 systemctl restart tftp
854 systemctl restart vsftpd
855 systemctl stop firewalld
856 systemctl status firewalld
857 setenforce 0