首页 > 代码库 > PXE

PXE

Auto installation configuration

workstation.sexample.com
server1.example.com
server2.exampel.com
database.example.com

Static
192.168.96.0/24
192.168.96.2
dns:8.8.8.8   8.8.4.4

VMnet8  NAT
#deselect local DHCP select box


On workstation.example.com
#hostnmaectl set-hostname workstation.example.com
#systemctl stop firewalld
#systemctl disable firewalld
#vim /etc/selinux/config    //disabled

#mkdir -p /var/ftp/pub
; right click to connect
# echo ‘/dev/sr0 /var/ftp/pub iso9660 defaults 0 0‘ >> /etc/fstab
#mount -a
#ls /var/ftp/pub
#vim  /etc/sysconfig/network-scripts/ifcfg-
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.96.100
NETMASK=255.255.255.0
GATEWAY=192.168.96.2
DNS1=8.8.8.8
#systemctl restart network
#yum repolist
#vim /etc/yum.repos.d/epel.repo   //http://mirrors.aliyun.com/epel/7Server/x86_64/
#reboot
; Make Snapshop

#yum -y install dhcp
#vim /etc/dhcp/dhcpd.conf
subnet 192.168.96.0 netmask 255.255.255.0 {
 range dynamic-bootp 192.168.96.200 192.168.96.210;
 option routers 192.168.96.2;
 option domain-name-servers 8.8.8.8;
 default-lease-time 21600;
 max-lease-time 43200;
 next-server 192.168.96.100;
 filename "pxelinux.0";
}
#systemctl restart dhcpd
#systemctl enable dhcpd
; install server1
#yum -y install xinetd
#yum -y isntall tftp-server tftp syslinux-tftpboot
#vim /etc/xinetd.d/tftp     //disable =no
#
#
#
#cp /var/ftp/pub/images/pxeboot/initrd.img /var/lib/tftpboot
#cp---------------------------/vmlinuz    //gzip compressible bootable kernel. vmlinux--uncompressible.
#yum -y install httpd
#systemctl start httpd
#systemctl enable httpd
#mkdir /var/www/html/ks
#cp anaconda-ks.cfg /var/www/html/ks/ks.cfg
#mkdir /var/lib/tftpboot/pxelinux.cfg

#vim /var/lib/tftpboot/pxelinux.cfg/default
default linux
prompt 1
timeout 60
display boot.msg
label linux
 kernel vmlinuz
 append initrd=initrd.img text ks=http://192.168.96.100/ks/ks.cfg
#systemctl start xinetd
#systemctl enabel xinetd
#
;#cp anaconda-ks.cfg /var/ftp/pub/ks.cfg   //error : read-only file system

#
#vim /var/www/html/ks/ks.cfg
url --url=ftp://192.168.96.100/pub
install
graphical
firstboot --enale
delet CDROM
#chmod +r /var/www/html/ks/ks.cfg
#yum -y install vsftpd
#systemctl start vsftp
#systemctl enable vsftpd
reboot server1

; On server1,server2,database distribute static ip with 201,202,203, and configure epel.repo sources.

 

http://www.cnblogs.com/mchina/p/centos-pxe-kickstart-auto-install-os.html

PXE