Note:以下所有命令及涉及到的腳本均在RHEL 6.6 / VMWare上測試通過。
主機(jī)配置:eth0為對外服務(wù)網(wǎng)卡萌庆,eth1為VMWare local模式連接,用于KickStart安裝系統(tǒng)使用读处。
(一) 安裝所需的軟件包
為了避免缺失依賴包帶來的麻煩搁宾,建議采用安裝DVD做為repo源猎唁。
[root@KioskStar pub]# mount /dev/sr0 /media/cdrom
[root@KioskStar pub]# mkdir /var/ftp/pub/inst_img
[root@KioskStar pub]# cp –p –R /media/cdrom /var/ftp/pub/inst_img
[root@KioskStar pub]# umount /media/cdrom
[root@KioskStar pub]# vi /etc/yum.repos.d/local_dvd.repo
[rhel-cd]
name=RedHat_OS_DVD
baseurl=file:///var/ftp/pub/inst_img
enabled=1
gpgcheck=0
[root@KioskStar pub]#
[root@KioskStar pub]# yum clean all
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager.
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: epel rhel-cd
Cleaning up Everything
[root@KioskStar pub]# yum update
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Update Process
epel/metalink | 6.1 kB 00:00
epel | 4.3 kB 00:00
epel/primary_db | 5.7 MB 00:06
rhel-cd | 4.1 kB 00:00 ...
rhel-cd/primary_db | 3.1 MB 00:00 ...
No Packages marked for Update
[root@KioskStar pub]#
安裝所需軟件包:
# yum install dnsmasq syslinux tftp-server vsftpd system-config-kickstart -y
(二) Config tftp / PXE
# cp -r /usr/share/syslinux/* /var/lib/tftpboot
# mkdir /var/lib/tftpboot/pxelinux.cfg
# touch /var/lib/tftpboot/pxelinux.cfg/default
編輯/etc/dnsmasq.conf內(nèi)容:
interface=eth1,lo
#bind-interfaces
domain=rhel.lan
# DHCP range-leases
dhcp-range= eth1,192.168.140.105,192.168.140.150,255.255.255.0,1h
# PXE
dhcp-boot=pxelinux.0,pxeserver,192.168.140.100
# Gateway
# dhcp-option=3,192.168.1.1
# DNS
dhcp-option=6,92.168.140.100
pxe-prompt="Press F8 for menu.", 60
pxe-service=x86PC, "Install RHEL from network server", pxelinux
enable-tftp
tftp-root=/var/lib/tftpboot
編輯/var/lib/tftpboot/pxelinux.cfg/default內(nèi)容:
PROMPT 0
TIMEOUT 300
### TUI
#DEFAULT vmlinuz
### GUI
UI vesamenu.c32
menu title ########## PXE Boot Menu ##########
label 1
menu label ^1) Install RHEL x64 with Local Repo
kernel vmlinuz
append inst.ks=ftp://192.168.140.100/pub/anaconda-ks.cfg method=ftp://192.168.140.100/pub/inst_img initrd=initrd.img i nst.vnc inst.vncpassword=hpinvent
label 2
menu label ^2) Boot from local drive
(三) 調(diào)整關(guān)閉Service
為了方便配置,減少配置防火墻的工作会放,本文檔中關(guān)閉了selinux和firewall饲齐,在企業(yè)生產(chǎn)環(huán)境中視情況而定,看看是否需要進(jìn)行對應(yīng)配置咧最。
# echo 0 > /selinux/enforce
# vi /etc/selinux/config
修改SELINUX=enforcing為SELINUX=disabled
# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot
#for SVRES in 3 4 5
do
chkconfig --level $SVRES dnsmasq on
chkconfig --level $SVRES vsftpd on
chkconfig --level $SVRES ip6tables off
chkconfig --level $SVRES iptables off
done
# chkconfig --list | grep -e tables -e dnsmasq -e vsftpd
# service ip6tables stop
# service iptables stop
# service dnsmasq start
# service vsftpd start
(四) 客戶端自動安裝場景測試記錄
以下過程無需人工介入捂人。
后面安裝過程自動完成。