Linux ETC

Kick-Start 설정

2015.09.18 13:56

호스트웨이 조회 수:4590

기본 설정
방화벽 Disable (Selinux, iptables)
[root@kick~]# iptables -F
[root@kick~]# setenforc 0
 
DHCP 설치 및 설정
설치
 [root@kick~]# yum -y install dhcp
 
Config
[root@kick~]# vi /etc/dhcp/dhcpd.conf
ddns-update-style ad-hoc;  //버전업데이트 따른 추가된 부분
option domain-name "localhost.localdomain";
option domain-name-servers 8.8.8.8;
filename "pxelinux.0";
next-server 192.168.60.10; # PXE Server IP
default-lease-time 600;
max-lease-time 7200;
authoritative;
subnet 192.168.60.0 netmask 255.255.255.0 {
    range dynamic-bootp 192.168.60.20 192.168.60.25;
    option broadcast-address 192.168.60.255;
    option routers 192.168.60.1;
}
 
 
Tftp 설치 및 설정
[root@kick~]# yum -y install tftp-server
[root@kick~]# mkdir /var/lib/tftpboot/pxelinux.cfg
[root@kick~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
[root@kick~]# cat /etc/initd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems. \
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /var/lib/tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
 
설치 파일 복사 및 설정
[root@kick~]# mkdir -p /var/pxe/centos6
[root@kick~]# mkdir /var/lib/tftpboot/centos6
[root@kick~]# mkdir /var/lib/tftpboot/pxelinux.cfg
[root@kick~]# mount /dev/cdrom/ /var/pxe/centos6
[root@kick~]# cp /var/pxe/centos6/images/pxeboot/vmlinuz /var/lib/tftpboot/centos6
[root@kick~]# cp /var/pxe/centos6/images/pxeboot/initrd.img /var/lib/tftpboot/centos6/
[root@kick~]# vi /var/lib/tftpboot/pxelinux.cfg/default
timeout 100
default menu.c32
 
menu title ########## PXE Boot Menu ##########
label 1
   menu label ^1) Install CentOS 6 with KickStart
   kernel centos6/vmlinuz
   append initrd=centos6/initrd.img ks=http://192.168.60.10/ks/centos6-ks.cfg ksdevice=eth0
 
label 2
   menu label ^2) Install CentOS 6 - NETWORK BOOT
   kernel centos6/vmlinuz
   append initrd=centos6/initrd.img method=http://192.168.60.10/centos6 devfs=nomount
 
label 3
   menu label ^3) Boot from local drive
   localboot
 
Htttp 설치 및 설정
[root@kick~]# yum -y install httpd
[root@kick~]# vi /etc/httpd/conf.d/pxeboot.conf
Alias /centos6 /var/pxe/centos6
<Directory /var/pxe/centos6>
   Options Indexes FollowSymLinks
   Order Deny,Allow
   Deny from all
   # Ip address you allow to access
   Allow from 127.0.0.1 192.168.60.0/24
</Directory>
 
스크립트 설정
[root@kick~]# mkdir /var/www/html/ks/
[root@kick~]# openssl passwd -1
[root@kick~]# vi /var/www/html/ks/centos6-ks.cfg
# Kickstart file automatically generated by anaconda.
install
autostep
reboot
url --url=http://192.168.60.10/centos6/
lang en_US.UTF-8
keyboard us
network --device eth0 --bootproto dhcp
rootpw  --iscrypted $1$iEvAf5bW$D5cixCaI/iuAs1MlvZE/E/
firewall --disabled
authconfig --enableshadow --passalgo=sha512 --enblefingerprint
selinux --disabled
timezone --utc Asia/Seoul
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
zerombr
clearpart --all --initlabel
part /boot --fstype=ext4 --size=200
part swap --size=2048
part / --fstype=ext4 --grow --size=4096
#part / --fstype ext4 --size 1 --asprimary --grow
#part swap --size 2048 --asprimary
#repo --name="CentOS"  --baseurl=cdrom:sr0 --cost=100
%packages
@base
@core
%end
[root@kick~]# chmod 644 /var/www/html/ks/centos6-ks.cfg
 
데몬 구동
[root@kick~]# service httpd start
[root@kick~]# service dhcpd start
[root@kick~]# service vsftpd start
[root@kick~]# service xinetd start
[root@kick~]# chkconfing dhcpd httpd vsftpd xinetd on

감사합니다
번호 제목 글쓴이 날짜 조회 수
386 scp 명령어를 이용한 파일 복사 및 전송 호스트웨이 2012.03.16 264530
385 ls 명령어의 파일 사이즈 쉽게 확인하기 호스트웨이 2012.10.23 176934
384 리눅스 서버 누가 언제 무슨 작업을 했는지 확인 방법 호스트웨이 2012.03.09 93447
383 sar 명령 옵션 호스트웨이 2012.06.15 93307
382 Linux Charset 확인 및 변경 file 호스트웨이 2012.03.30 85051
381 ulimit 설정 관련 호스트웨이 2015.07.29 77637
380 Swap 메모리 늘리기 file 호스트웨이 2012.03.30 67209
379 국가명 약어 (국가코드) 호스트웨이 2012.04.13 64994
378 head 와 tail 사용하기 sylee 2008.05.14 63483
377 비대해진 로그 파일 내용을 비우는 방법 - /dev/null 호스트웨이 2012.03.16 61418
376 서비스 이름으로 포트 번호 확인하기 호스트웨이 2012.04.13 57728
375 fdisk 명령어를 이용하여 수동으로 파티션 나누기 file 호스트웨이 2015.11.30 57715
374 강제 umount 방법 (umount : device is busy 발생시) 호스트웨이 2012.11.30 55459
373 top 명령어 및 옵션 설명 file 호스트웨이 2012.03.27 52554
372 xinetd 소개 및 설정 호스트웨이 2012.06.29 51911
371 history 조회시 '날짜,시간' 표시하기 호스트웨이 2012.03.16 49508
370 시스템 시간 확인 및 동기화 하기 sylee 2008.05.15 46977
369 /bin/false, /sbin/nologin 의 차이점 호스트웨이 2012.08.10 45772
368 Kernel Parameters HOSTWAY 2008.06.04 45457
367 ssh-key를 생성하여 서버에 패스워드 없이 접속하는 방법 jook 2008.06.25 44753