1. Configure the yum source and install the dhcp service cat/etc/yum. repos. d/my-source.repo [my-source] name = RedHatEnterpriseLinux $ releasever-$ basearch-mysourcebaseurl = file: // mediaenabled = 1 gpgcheck = 1 gpgkey = file: // e
1. Configure the yum source and install the dhcp service.
Cat/etc/yum. repos. d/my-source.repo
[My-source]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-my source
Baseurl = file: // media
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-release
Mount/dev/cdroom/media
Yum-y instasll dhcp
Yes | find/-name dhcpd. conf. sample-exec cp-p {}/etc/dhcp/dhcpd. conf \;
Filter comments: grep-v ^ # </etc/dhcp/dhcpd. conf
Edit dhcpd. conf to add the following content:
Ddns-update-style interim;
Ignore client-updates;
Subnet 192.168.1.0 netmask 255.255.255.0 {
Option routers 192.168.1.124;
Option subnet-mask limit 255.0;
Next-server 192.168.1.124;
Filename "pxelinux.0 ";
Range 192.168.1.200 192.168.1.220;
Default-lease-time 600;
Max-lease-time 7200;
}
Start the dhcp service:
/Etc/init. d/dhcpd start
Starting dhcpd: [OK]
2. Install the tftp service
Yum search tftp; yum-y install tftp-server
Chkconfig tftp on;/etc/init. d/xinetd restart
Test tftp: tftp 192.168.1.124
Tftp> get filename
3. Deploy and install the source
Yum-y install nfs *;/etc/init. d/rpcbind start
Echo "/media * (sync, ro)">/etc/exports;/etc/init. d/nfs star
View shared information:
Exportfs-v
Test mounting:
Mount. nfs 192.168.1.124:/media // opt/test
Use the ftp Source: Start vsftp; mount/dev/cdroot/var/ftp/pub/linuxos;
4. Deploy the PXE Environment
To obtain the Pxelinux.0 file, you must install the pxelinux package.
Yum search pxelinux; yum-y install yum search pxelinux
Mkdir/var/lib/tftpboot/pxelinux. cfg
Cp/usr/share/syslinux/pxelinux.0/var/lib/tftpboot/
Cp/media/images/pxeboot/{vmlinuz, initrd. img}/var/lib/tftpboot/
Cp/media/isolinux. cfg/var/lib/tftpboot/pxelinux. cfg/default
The modified default file:
Default linux
Prompt 1
Timeout 10
Display boot. msg
Menu background splash.jpg
Menu title Welcome to Red Hat Enterprise Linux 6.1!
Menu color border 0 # ffffffff #00000000
Menu color sel 7 # ffffffff # ff000000
Menu color title 0 # ffffffff #00000000
Menu color tabmsg 0 # ffffffff #00000000
Menu color unsel 0 # ffffffff #00000000
Menu color hotsel 0 # ff000000 # ffffffff
Menu color hotkey 7 # ffffffff # ff000000
Menu color scrollbar 0 # ffffffff #00000000
Label linux
Menu label ^ Install or upgrade an existing system
Menu default
Kernel vmlinuz
Append initrd = initrd. img ks = ftp: // 192.168.1.124/pub/ksfile/ks. cfg
5. Configure the ks. cfg file
Yum-y install system-config-kickstart
Run system-config-kickstart.
System-config-kickstart
Basic Configuration:
Select the time zone, do not use UTC clock, set the root password Encrypt root password, architecture x86
Choose to restart the system after installation
Installation Method
Execute New installation and configure the installation Source:
Method 1: FTP Server: 192.168.1.124 FTP Directory:/pub/linuxos
Method 2: NFS Server: 192.168.1.124 NFS Directory:/media
Boot Loader Options
Set the GRUB Password by default.
Partition Information
Clear Master Boot records, delete all existing partitions, initialize disk tags, and layout partitions
Minimum installation package options:
@ Core
@ Server-policy