Kickstart 实战

一、安装环境

yum -y install dhcp* httpd tftp tftp-server

二、配置DHCP

# vim /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
filename "pxelinux.0";
next-server 192.168.152.129;
subnet 192.168.152.0 netmask 255.255.255.0 {
        option routers                  192.168.152.129;
        option subnet-mask              255.255.255.0;
        option nis-domain               "domain.org";
        option domain-name              "domain.org";
        option domain-name-servers      192.168.152.129;
        option time-offset              -18000; # Eastern Standard Time
        range dynamic-bootp 192.168.152.200 192.168.152.254;
        default-lease-time 21600;
        max-lease-time 43200;
}
service dhcpd start
chkconfig dhcpd on

三、配置tftp

# vim /etc/xinetd.d/tftp

service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
~      
#cp /media/isolinux/* /tftpboot/
#cp /media/images/pxeboot/vmlinuz /tftpboot/
#mkdir -p /tftpboot/pxelinx.cfg
#cp /media/isolinux/isolinux.cfg /tftpboot/pxelinx.cfg/default
#cp /usr/lib/syslinux/pxelinux.0 /tftpboot/

#chkconfig tftp on

#service xinetd restart

四、设置NFS共享iso

#vim /etc/exports
/media  *(ro)

service nfs restart

chkconfig nfs on

五、修改默认启动文件

# vim /tftpboot/pxelinux.cfg/default
ks                                                              //这里我们输入ks安装避免无限重装
prompt 1
timeout 600
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label ks
  kernel vmlinuz
  append ks=http://192.168.152.129/ks.cfg initrd=initrd.img   输入ks.cfg 位置
label text
  kernel vmlinuz
  append initrd=initrd.img text
label ks
  kernel vmlinuz
  append ks initrd=initrd.img
label local
  localboot 1
label memtest86
  kernel memtest
  append -

六、设置ks.cfg配置文件,这里我们可以有system-config-kickstart 来写,只要yum install  system-config-kickstart  ,命令行列直接输入system-config-kickstart就可以配置了,不过是图形配置的。 下面是我的配置

#vim /var/www/html/ks.cfg
auth  --useshadow  --enablemd5
bootloader --location=mbr
zerombr
clearpart --all --initlabel
key --skip                                                   //跳过输入序列号
graphical
firewall --disabled
firstboot --disable
keyboard us
lang en_US
logging --level=info
nfs --server=192.168.152.129 --dir=/media
network --bootproto=dhcp --device=eth0 --onboot=on
reboot
rootpw --iscrypted $1$hxMTXH0o$631N.bGmEsVj19JDi9qAN.

selinux --enforcing
timezone  America/New_York
install
xconfig  --defaultdesktop=GNOME --depth=8 --resolution=640x480
part /boot --bytes-per-inode=4096 --fstype="ext3" --size=100
part swap --bytes-per-inode=4096 --fstype="swap" --size=256
part / --bytes-per-inode=4096 --fstype="ext3" --size=4096

%packages       --resolvedeps
@base-X

七、客户端选网络启动,输入ks即可开始安装。

你可能感兴趣的:(职场,休闲,kictstart)