首先安装httpd、dhcp和xinetd服务
yum install dhcp-* httpd-* xinetd –y
修改dhcp服务
cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
vim /etc/dhcp/dhcpd.conf
dhcpd.conf
#
Sample configuration file for ISC dhcpd
option domain-name “example.org”;
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet 192.168.18.0 netmask 255.255.255.0 {
range 192.168.18.26 192.168.18.250;
option routers 192.168.18.139;
option broadcast-address 10.5.5.31;
default-lease-time 600;
max-lease-time 7200;
next-server 192.168.18.139;
filename “pxelinux.0”;
}
然后重启dhcp服务
service dhcpd restart
接着安装tftp服务
yum install tftp-server –y
创建目录
mkdir /var/www/html/rhel
将光盘挂载到/var/www/html/rhel
mount /dev/scd0 /var/www/html/rhel/
cd /var/www/html/rhel/ ls查看
编辑tftp文件
vim /etc/xinetd.d/tftp
service dhcpd/xinetd restart 重启dhcpd/xinetd 服务
复制linux6的文件到/var/lib/tftpboot/linux-install/
cp /var/www/html/rhel/isolinux/vmlinuz /var/lib/tftpboot/
cp /var/www/html/rhel/isolinux/initrd.img /var/lib/tftpboot/
yum install syslinux –y 安装sysliunx
然后cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
创建目录:mkdir /var/lib/tftpboot/pxelinux.cfg
cp /var/www/html/rhel/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
chmod 644 /var/lib/tftpboot/pxelinux.cfg/default
修改default文件
然后添加label ks
kernel vmlinuz
append ks=http://192.168.18.139/ks.cfg initrd=initrd.img
然后安装ks的图形工具
yum install system-config-kickstart -y
安装完成system-config-kickstart 打开ks文件
在这里配置ks文件
然后在生成的ks文件内容为
platform=x86, AMD64, 或 Intel EM64T
version=DEVEL
Firewall configuration
firewall –disabled
key –skip
Install OS instead of upgrade
install
Use network installation
url –url=”http://192.168.18.139/rhel”
Root password
rootpw –iscrypted 1 <script id="MathJax-Element-1" type="math/tex">1</script>orW4gV7B$DLHY/ZMSMh9YlZP2/pBaW/
System authorization information
auth –useshadow –passalgo=sha512
Use text mode install
text
firstboot –disable
System keyboard
keyboard us
System language
lang zh_CN
SELinux configuration
selinux –disabled
Installation logging level
logging –level=info
Reboot after installation
reboot
System timezone
timezone Asia/Chongqing
Network information
network –bootproto=dhcp –device=eth0 –onboot=on
System bootloader configuration
bootloader –location=mbr
Partition clearing information
clearpart –all –initlabel
Disk partitioning information
part /boot –fstype=”ext4” –size=100
part swap –fstype=”swap” –size=1024
part / –fstype=”ext4” –grow –size=1
%packages
@base
@chinese-support
@client-mgmt-tools
@core
@debugging
@basic-desktop
@desktop-debugging
@desktop-platform
@directory-client
@fonts
@general-desktop
@graphical-admin-tools
@input-methods
@internet-browser
@java-platform
@legacy-x
@network-file-system-client
@perl-runtime
@print-client
@remote-desktop-clients
@server-platform
@server-policy
@x11
mtools
pax
python-dmidecode
oddjob
wodim
sgpio
genisoimage
device-mapper-persistent-data
abrt-gui
samba-winbind
certmonger
pam_krb5
krb5-workstation
libXmu
perl-DBD-SQLite
%end
然后将anaconda-ks.cfg里面最后的软件包拷贝到ks.cfg文件中
cp ks.cfg /var/www/html/
最后将所有服务重启
service httpd restart
service xinetd restart
service network restart
service dhcpd restart