Linux ETC

Kick-Start 설정

2015.09.18 13:56

호스트웨이 조회 수:4591

기본 설정
방화벽 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

감사합니다
번호 제목 글쓴이 날짜 조회 수
46 vsftpd 패시브 모드 설정 호스트웨이 2015.09.13 3345
45 iptables를 이용한 ssh 스캐닝 공격 방어 호스트웨이 2012.09.21 3334
44 UTF-8 환경의 Linux 에서 SAMBA 한글 인코딩 문제 해결 방법 호스트웨이 2015.09.09 3289
43 리눅스 관리툴 webmin 설치하기 호스트웨이 2012.12.07 3192
42 리눅스 파티션 볼륨 레이블 설정 file 호스트웨이 2012.11.01 3176
41 /proc/sys/net/ipv4 활용 서버보안 -2- 호스트웨이 2015.09.18 3136
40 INIT: no more processes left in this runlevel 메세지 발생시 호스트웨이 2012.11.15 3023
39 yum을 이용한 X-Window 설치 호스트웨이 2012.09.27 3005
38 리눅스 tree 명령어 file 호스트웨이 2012.09.21 2931
37 SNMPD LOG 안남게 하기 호스트웨이 2015.09.10 2891
36 /proc/sys/net/ipv4 활용 서버보안 -1- 호스트웨이 2015.09.17 2838
35 df 쉽게 보기 호스트웨이 2012.12.20 2835
34 UTF-8 환경에서 리눅스 한글 꺠짐 현상 해결법 호스트웨이 2015.09.08 2771
33 쉘 프롬프트에서 바로 이전 디렉토리로 이동하기 호스트웨이 2012.12.20 2751
32 읽기 전용 파티션 읽고 쓸수 있게 재마운트하는 방법 호스트웨이 2015.09.13 2720
31 랜카드 본딩(bond0) 설정 호스트웨이 2012.11.16 2719
30 쉘 프롬프트 설정하기 file 호스트웨이 2012.11.08 2671
29 리눅스 hdd 속도 알아보기 호스트웨이 2015.09.17 2623
28 hostname 변경하기 호스트웨이 2015.09.17 2621
27 리눅스 look 명령어 file 호스트웨이 2012.11.02 2598