原理流程如下

Pxe无人值守安装rhel

1.配置yum 

Pxe无人值守安装rhel

2.安装dhcp服务器

[[email protected] ~]# yum install dhcp -y

Pxe无人值守安装rhel

3.修改dhcpd配置文件

[[email protected] ~]# vim /etc/dhcpd.conf

Pxe无人值守安装rhel

[[email protected] ~]# service dhcpd start      //启动dhcp 服务器

[[email protected] ~]# chkconfig dhcpd on     //设置开机自动启动

4.ftp 服务器的配置。

[[email protected] ~]# yum install vsftpd -y       

[[email protected] ~]# cp -R /mnt/cdrom/* /var/ftp/pub/    //把光盘中的文件copyvsftpd中的pub目录中。

[[email protected] ~]# service vsftpd start      //启动

[[email protected] ~]# chkconfig vsftpd on      //开机启动

5.fpd 安装及配置

[[email protected] ~]# yum install tftp-server -y

[[email protected] ~]# vim /etc/xinetd.d/tftp 

把  disable = no改为  -->disable = no

[[email protected] ~]# service xinetd restart      超级守候进程。

6.Copy 开机引导程序到tftp文件夹中

[[email protected] ~]# cp /usr/lib/syslinux/pxelinux.0  /tftpboot/

[[email protected] ~]# cp /mnt/cdrom/p_w_picpaths/pxeboot/vmlinuz  /tftpboot/

[[email protected] ~]# cp /mnt/cdrom/p_w_picpaths/pxeboot/initrd.img /tftpboot/

[[email protected] ~]# mkdir -pv /tftpboot/pxelinux.cfg

mkdir: 已创建目录 “/tftpboot/pxelinux.cfg

[[email protected] ~]# cp /mnt/cdrom/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default

7.安装system-config-kickstart

[[email protected] ~]# yum install system-config-kickstart

[[email protected] ~]# system-config-kickstart

Pxe无人值守安装rhel

Pxe无人值守安装rhel

Pxe无人值守安装rhel

Pxe无人值守安装rhel

Pxe无人值守安装rhel

Pxe无人值守安装rhel

Pxe无人值守安装rhel

Pxe无人值守安装rhel

Pxe无人值守安装rhel

ADDRESS=`ifconfig |grep -i bcast |awk '{print $2}'`

NUM=${ADDRESS##*.}

sed -i "s/HOSTNAME.*$/HOSTNAME=station$NUM.zzdx.com/" /etc/sysconfig/network

Pxe无人值守安装rhel

Pxe无人值守安装rhel

8.保存文件。   [[email protected] ~]# vim ks.cfg 

Pxe无人值守安装rhel

9.指明tftp server   引导程序。

[[email protected] ~]# vim /etc/dhcpd.conf 

Pxe无人值守安装rhel

[[email protected] ~]# service dhcpd restart

[[email protected] ~]# vim /tftpboot/pxelinux.cfg/default 

10.设置启动的时间是在6

Pxe无人值守安装rhel

11.copy ks.cfgftp服务器中 

[[email protected] ~]# cp /root/ks.cfg /var/ftp/pub/

测试不使用vmware自带的dhcp

Pxe无人值守安装rhel

Pxe无人值守安装rhel

Pxe无人值守安装rhel

12.启动sendmail时候会变得有点慢(5分钟)。

Pxe无人值守安装rhel

[[email protected] ~]# cat /etc/resolv.conf

Pxe无人值守安装rhel