1. TFTP ±¸¼º
(Æäµµ¶ó´Â ±âº» /var/lib/tftpboot µð·ºÅ丮»ç¿ë)
yum install tftp-server
2.1 vi /etc/xinet.d/tftpd (xinetd daemon) // RHEL ±âÁØ
disable = yes // ¡®yes¡¯ change ¡®no¡¯
# firewall-cmd --add-service=tftp // ¹æȺ®À» »ç¿ëÇÑ´Ù¸é ÀÌ¿Í °°ÀÌ ¼³Á¤
2.2 ºÎÆà ¿É¼Ç ¼³Á¤ ÆÄÀÏÀ» »ý¼º
# mkdir /tftpboot/pxelinux.cfg
# touch /tftpboot/pxelinux.cfg/default
You now need the pxelinux.0 file from the SYSLINUX package in the ISO image file. To access it, run the following commands as root:
# mount -t iso9660 /path_to_image/name_of_image.iso /mount_point -o loop,ro
# cp -pr /mount_point/Packages/syslinux-version-architecture.rpm /publicly_available_directory
# umount /mount_point
Extract the package:
# rpm2cpio syslinux-version-architecture.rpm | cpio -dimv
Create a pxelinux/ directory within tftpboot/ and copy the pxelinux.0 file into it:
# mkdir /var/lib/tftpboot/pxelinux
# cp publicly_available_directory/usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/pxelinux
[root@theko tftpboot]# ls -al
total 41888
drwxr-xr-x 4 root root 4096 11¿ù 18 13:16 .
drwxr-xr-x. 61 root root 4096 11¿ù 23 2015 ..
-r--r--r-- 1 root root 36646096 2¿ù 19 2015 initrd.img
-rw-r--r-- 1 root root 26748 11¿ù 18 13:16 pxelinux.0
drwxr-xr-x 2 root root 4096 11¿ù 18 14:30 pxelinux.cfg
-r--r--r-- 1 root root 1013068 12¿ù 11 2014 syslinux-4.05-12.el7.x86_64.rpm
drwxr-xr-x 4 root root 4096 11¿ù 18 13:16 usr
-r--r--r-- 1 root root 153104 9¿ù 27 2014 vesamenu.c32
-r-xr-xr-x 1 root root 5026624 1¿ù 30 2015 vmlinuz
2.3 ºÎÆà ¿É¼Ç ¼³Á¤ ÆÄÀÏ ¼³Á¤(pxelinux.cfg/default)
--------------------------------------------------------------
default vesamenu.c32
timeout 900
menu title ###### PXE Boot Memu #####
label 1
menu label ^1) Boot from local drive
localboot 0
label 2
menu label ^2) rh-host1
kernel rhel67/vmlinuz
append initrd=rhel67/initrd.img ks=http://172.16.1.21/ks/ks1.cfg biosdevname=0
--------------------------------------------------------------
2. DHCP ¼³Ä¡
2.1 DHCP ¼³Á¤
# cat /etc/dhcp/dhcpd.conf
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
subnet 192.168.0.0 netmask 255.255.255.0 {
# option routers 192.168.0.1;
range 192.168.0.200 192.168.0.250;
next-server 192.168.0.5;
filename "pxelinux.0";
}
3. httpd ¼³Á¤
¼³Ä¡¸¸ ÇÏ°í ±âº» µð·ºÅ丮 »ç¿ë
4. kickstart
======================================================================
version=RHEL8
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
install
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --disable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
url --url="http://192.168.0.5/rhel7"
# Reboot after installation
reboot
# Network information
network --bootproto=dhcp --device=eth0 --onboot=yes --ipv6=auto --hostname=localhost.localdomain
repo --name="Server-HighAvailability" --baseurl=file:///run/install/repo/addons/HighAvailability
repo --name="Server-ResilientStorage" --baseurl=file:///run/install/repo/addons/ResilientStorage
# Root password
rootpw --plaintext rplinux
# System timezone
timezone Asia/Seoul
# X Window System configuration information
xconfig --startxonboot
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
# Partition clearing information
#clearpart --none --initlabel
clearpart --all
# Disk partitioning information
part pv.348 --fstype="lvmpv" --ondisk=sda --size=5124
part / --fstype="xfs" --ondisk=sda --size=20480
part swap --fstype="swap" --ondisk=sda --size=2048
volgroup vg00 --pesize=4096 pv.348
logvol /LVM --fstype="ext4" --size=5120 --name=LVM --vgname=vg00
%packages
@base
@core
@desktop-debugging
@dial-up
@fonts
@gnome-desktop
@guest-agents
@guest-desktop-agents
@input-methods
@internet-browser
@multimedia
@print-client
@x11
kexec-tools
-gnome-initial-setup
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
%post
echo "127.0.0.1 localhost.localdomain localhost" > /etc/hosts
echo "::1 localhost6.localdomain6 localhost6" >> /etc/hosts
echo "192.168.0.5 exam.com" >>/etc/hosts
cp /etc/services /usr/local/share/info/linux-portinfo.txt
cp /etc/protocols /var/lib/upower/exam.txt
mkdir /root/.ssh
touch /root/authorized_key
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCdtq34TBVMhU8zTC3t1BvrqmDQ72x49C1/daLc2rIZ8Y8wARlQD4d+VHcy9Gd8/jqgTUDOJWWIOIdaaum4lhoo4m2XCww8FhHVTD4QHrj5FrWGF/OGyNi+av8ohM05v+os+3//gvHrisa+KPR9Qk/Hqsmjwz93L6wgO8YkoNmgaha/3I0JhyblZCQu0e/7EQv/atsuaU5o7FgJB806JbtVfgGMImvCto9rAdNpEUqQPCIE9v6yMBWIAvAt8x5sm8DB7Lti1gxH9jXJYDgM4ZTAg2uTZGE93VbAOxO/7+8QeezhONsPQG9og7oaVI0HaEFmbukeUdCOGa4EpHIEo3rR root@theko" >> /root/.ssh/authorized_keys
%end
Âü°í »çÀÌÆ®
http://www.unixmen.com/install-pxe-server-centos-7/
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-installation-server-setup.html#sect-network-boot-setup