On the real machine, use CLONE-VM7 to create a new virtual machine, name: Pxe-server
1. Set the firewall to trusted
2. Current and permanently closed SELinux
3. Configure IP Address: 192.168.4.168/24
4. Build the Yum Warehouse
5. Host Name: PXE.tedu.cn
######################################################
Set up a key installation platform
First, build DHCP service
1. Install DHCP
2. Modify the configuration file
Subnet 192.168.4.0 netmask 255.255.255.0 {
Range 192.168.4.180 192.168.4.230;
Next-server 192.168.4.168;
FileName "pxelinux.0";
}
3. Restart the DHCPD service, set the boot from start
#####################################################
Second, build TFTP
1. Installing Tftp-server
2. Start the TFTP service and set the boot-up self-starter
3. Deploying pxeliunx.0
# YUM provides */pxelinux.0
# RPM-QL Syslinux | grep pxelinux.0
# cp/usr/share/syslinux/pxelinux.0/var/lib/tftpboot/
# ls/var/lib/tftpboot/
4. Deploy CD Content
[Email protected] ~]# yum-y install httpd
[Email protected] ~]# mkdir/var/www/html/rhel6
[Email protected] ~]# MKDIR/VAR/WWW/HTML/RHEL7
[Email protected] ~]# mount/dev/cdrom/mnt/#光盘为rhel7.2
[Email protected] ~]# ls/mnt/
[Email protected] ~]# cp-r/mnt/*/var/www/html/rhel7/
[Email protected] ~]# umount/mnt
[Email protected] ~]# mount/dev/cdrom/mnt/#光盘为rhel6.7
[Email protected] ~]# ls/mnt/
[Email protected] ~]# cp-r/mnt/*/var/www/html/rhel6/
[Email protected] ~]# du-sh/var/www/html/rhel7/
[Email protected] ~]# du-sh/var/www/html/rhel6/
5. Deploy RHEL7, Rhel6 boot cores and drivers
# MKDIR/VAR/LIB/TFTPBOOT/RHEL6
# MKDIR/VAR/LIB/TFTPBOOT/RHEL7
# Cp/var/www/html/rhel6/isolinux/vmlinuz
/var/www/html/rhel6/isolinux/initrd.img
/var/lib/tftpboot/rhel6/
# Cp/var/www/html/rhel7/isolinux/vmlinuz
/var/www/html/rhel7/isolinux/initrd.img
/var/lib/tftpboot/rhel7/
# LS/VAR/LIB/TFTPBOOT/RHEL7
# LS/VAR/LIB/TFTPBOOT/RHEL6
6. Deploying graphics modules and backgrounds
# CP/VAR/WWW/HTML/RHEL6/ISOLINUX/VESAMENU.C32
/var/lib/tftpboot/
# RPM-QL Syslinux | grep jpg
# cp/usr/share/doc/syslinux-4.05/sample/syslinux_splash.jpg/var/lib/tftpboot/
# ls/var/lib/tftpboot/
7. Deploy the menu file
# mkdir/var/lib/tftpboot/pxelinux.cfg
# cp/var/www/html/rhel6/isolinux/isolinux.cfg
/var/lib/tftpboot/pxelinux.cfg/default
# chmod 644/var/lib/tftpboot/pxelinux.cfg/default
# ls-l/var/lib/tftpboot/pxelinux.cfg/default
8. Modify the contents of the menu file
# Vim/var/lib/tftpboot/pxelinux.cfg/default
......
Menu Background Syslinux_splash.jpg
Menu title Welcome to PXE server!
......
Label Linux
Menu Label Install RHEL7.2
Kernel Rhel7/vmlinuz
Append initrd=rhel7/initrd.img
Label VESA
Menu Label Install RHEL6.7
Kernel Rhel6/vmlinuz
Append initrd=rhel6/initrd.img
Label Local
Menu label Boot from local drive
Menu Default #读秒结束最后默认选择
Localboot 0xFFFF
#####################################################
Third, build httpd service share disc all content
1. Start the service
[Email protected]/]# systemctl restart httpd
[Email protected]/]# Systemctl enable httpd
2. Test access
[email protected]/]# Firefox http://192.168.4.168/rhel6
[email protected]/]# Firefox HTTP://192.168.4.168/RHEL7
####################################################
Iv. Generating the KS file
[Email protected]/]# yum-y install System-config-kickstart
Modify the name of the Yum client configuration file
[Development]
[[email protected]/]# System-config-kickstart #先看 "Package Selection"
Package Selection: Select-----in the "desktop" column > The first gnome is RHEL7
RHEL7 's file system for XFS
#####################################################
[Email protected] ~]# Vim/etc/yum.repos.d/rhel7.repo
Perform a disc to Rhel6
[Development]
Name=rhel7
Baseurl=http://192.168.4.168/rhel6
Enabled=1
Gpgcheck=0
[email protected] ~]# Yum Clean all #清空Yum缓存
[Email protected] ~]# System-config-kickstart
Package Selection: Select-----in the "desktop" column > the first KDE desktop is RHEL6
The RHEL6 file system is EXT4
[Email protected] ~]# ls/root/ks*
/root/ks6.cfg/root/ks7.cfg
#############################################
V. Specifying the KS answer file
1. Share the KS answer file
[Email protected] ~]# cp/root/ks*/var/www/html/
[Email protected] ~]# ls/var/www/html/
2. Modify the Menu file
# Vim/var/lib/tftpboot/pxelinux.cfg/default
Label Linux
Menu Label Install RHEL7.2
Kernel Rhel7/vmlinuz
Append initrd=rhel7/initrd.img ks=http://192.168.4.
168/ks7.cfg
Label VESA
Menu Label Install RHEL6.7
Kernel Rhel6/vmlinuz
Append initrd=rhel6/initrd.img ks=http://192.168.4.
168/ks6.cfg
####################################################
Linux System Learning 18th Day "build a key installed platform" end