[[Email protected] ~]# mount /dev/cdrom /mnt[[email protected] ~]# yum install -y httpd createrepo[[email protected] ~]# mkdir /var/www/html /centos-7.1-x86_64[[email protected] ~]# cp -a /mnt/* /var/www/html/ Centos-7.1-x86_64/createrepo -pdo /var/www/html/centos-7.1-x86_64/ /var/www/html/centos-7.1-x86 _64/createrepo -g ' Ls /var/www/html/centos-7.1-x86_64/repodata/*-comps.xml ' /var/www/html/ Centos-7.1-x86_64/[[email protected] ~]# yum install -y tftp-server dhcp xinetd[[email protected] ~]# vim /etc/xinetd.d/tftpdisable = no [[email Protected] ~]# cd /usr/share/doc/dhcp-4.1.1/[[email protected] dhcp-4.1.1]# cp dhcpd.conf.sample /etc/dhcp/dhcpd.conf[[email protected] dhcp-4.1.1]# vim /etc/dhcp/dhcpd.confsubnet 10.0.0.0 netmask 255.255.255.0 { range dynamic-bootp 10.0.0.100 10.0.0.200; option subnet-mask 255.255.255.0; next-server 10.0.0.7; filename "pxelinux.0";} [[email protected] dhcp-4.1.1]# /etc/init.d/dhcpd start[[email protected] dhcp-4.1.1]# /etc/init.d/httpd start[[email protected] dhcp-4.1.1]# /etc/init.d/ xinetd start[[email protected] ~]# rz -y #放置Kickstart文件 [ [email protected] ~]# curl --head [[email protected] ~]# yum install -y syslinux[[email protected] ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/[[email protected] ~]# cp /mnt/isolinux/* /var/lib/tftpboot/[ [email protected] ~]# mkdir /var/lib/tftpboot/pxelinux.cfg[[email protected] ~]# cd /var/lib/tftpboot/pxelinux.cfg/[[email protected] pxelinux.cfg]# cp /mnt/isolinux/ isolinux.cfg default[[email protected] pxelinux.cfg]# vim defaultlabel ks menu label ^AUTO Install CentOS 7 kernel vmlinuz append initrd=initrd.img ks=http://10.0.0.7/centos-7.1-x86_64/centos-7.1-x86_64.cfg[[email protected] pxelinux.cfg]# openssl passwd -1 -salt ' 123456 ' ' 123456 ' $1$ 123456$wosetcyip2n/ifil15w6z0 [[email protected] centos-7.1-x86_64]# vim /var/www/ html/centos-7.1-x86_64/centos-7.1-x86_64.cfg #url --url= $treeurl --url=http://10.0.0.7/ Centos-7.1-x86_64rootpw --iscrypted $1$123456$wosetcyip2n/ifil15w6z0
This article is from the "architects of the Day" blog, be sure to keep this source http://wanyuetian.blog.51cto.com/3984643/1717842
Kickstart for automatic installation of CentOS 7.1 x86_64