kickstart无人值守

实验环境:

CentOS 6.4

IP:10.0.0.104/24

Gateway:10.0.0.1

DNS:10.0.0.205


步骤:

yum -y install syslinux dhcp tftp-server nfs-utils


DHCP:

vim /etc/dhcp/dhcpd.conf 

ddns-update-style interim;

ignore client-updates;


subnet 10.0.0.0 netmask 255.255.255.0 {


        option routers                  10.0.0.1;

        option subnet-mask              255.255.255.0;


        option domain-name-servers      10.0.0.205;


        option time-offset              -18000;


        range dynamic-bootp 10.0.0.110 10.0.0.120;

        default-lease-time 21600;

        max-lease-time 43200;

        filename "pxelinux.0";

        next-server 10.0.0.104;

}


service dhcpd start


TFTP-Server

vim /etc/xinetd.d/tftp

disable = yes 改为no


chkconfig tftp on

/etc/init.d/xinetd start


挂载CentOS安装光盘(1/2

mount /dev/cdrom /media

cp /media/isolinux/* /var/lib/tftpboot

cd /var/lib/tftpboot

mkdir pxelinux.cfg

cp *.msg pxelinux.cfg/

cp isolinux.cfg pxelinux.cfg/

mv isolinux.cfg pxelinux.cfg/default

cp /usr/share/syslinux/pxelinux.0 ./


mkdir -p /var/www/html/centos/6.4/x86_64

cp -r /media/* /var/www/html/centos/6.4/x86_64

cp ~/ks.cfg /var/www/html/centos/ (ks.cfg文件之前准备好的,如果没有的话提前配置)

chmod a+x /var/www/html/centos/

/uar/local/apache2/bin/apachectl start


vim /var/lib/tftpboot/pxelinux.cfg/default

prompt 1(去掉#号)

timeout 10(值修改小一点)

label linux

  menu label ^Install or upgrade an existing system

  menu default

  kernel vmlinuz

  append ks=http://10.0.0.104/centos/ks.cfg initrd=initrd.img  \\修改这句


NFS:

vim /etc/exports

/var/www/html/centos 10.0.0.0/24(ro)

service rpcbind start

service nfs start


服务端设置完成,设置客户端从网卡启动

你可能感兴趣的:(kickstart,无人值守)