[root@dlp ~]# yum install tftp-server syslinux xinetd # 패키지 설치 후 PXE부팅에 필요한 syslinux 파일을 tftpboot 디렉토리에 복사한다. [root@dlp ~]# mkdir /var/lib/tftpboot/pxelinux.cfg [root@dlp ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
[root@dlp ~]# vi /etc/xinetd.d/tftp # line 14: change disable = no [root@dlp ~]# systemctl start xinetd [root@dlp ~]# systemctl enable xinetd
# tftp 관련 파일 경로 (/usr/share/syslinux/* 파일 복제) /var/lib/tftpboot # pxe 관련 파일 경로 /var/lib/tftpboot/pxelinux.cfg/default /var/lib/tftpboot/pxelinux.cfg/logo.png # ISO 파일 경로 /var/lib/tftpboot/RHEL/7.3/x64 -> /ISO/rhel-server-7.3-x86_64-dvd.iso # Symbolic Link /var/lib/tftpboot/RHEL/6.8/x64 -> /ISO/rhel-server-6.8-x86_64-dvd.iso # Symbolic Link /var/lib/tftpboot/RHEL/5.11/x64 -> /ISO/rhel-server-5.11-x86_64-dvd.iso # Symbolic Link
httpd
방식으로 레포지토리를 설정하기 위해 웹서버 설치 및 경로 설정을 하도록 한다.
yum install httpd
/etc/httpd/conf.d/repo.conf
Alias /rhel/ /var/lib/tftpboot/RHEL/ Alias /centos/ /var/lib/tftpboot/CentOS/ Alias /fedora/ /var/lib/tftpboot/Fedora/ Alias /debian/ /var/lib/tftpboot/Debian/ Alias /ubuntu/ /var/lib/tftpboot/Ubuntu/ <Directory "/var/lib/tftpboot"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory>
pxelinux.cfg/default
DEFAULT vesamenu.c32 TIMEOUT 600 # 프롬프트 콘솔 가능 여부 PROMPT 0 # 취소 가능 여부 NOESCAPE 1 # 옵션 선택 가능 여부 ALLOWOPTIONS 1 # 시간 초과시 자동 선택되는 메뉴 ONTIMEOUT BootLocal # 메뉴 제목 MENU TITLE LinuxDataSystem PXE # 상단 여백 라인 MENU VSHIFT 3 # 메뉴 폭 MENU WIDTH 50 # 메뉴 전체 라인수 MENU ROWS 10 # 여백 크기 MENU MARGIN 10 # 탭누르라는 메세지 출력 위치 MENU TABMSGROW 15 # 시간 안내 메세지 출력 위치 MENU TIMEOUTROW 16 ##### 색 정의부분 MENU COLOR BORDER 30;44 #00000000 #00000000 none MENU COLOR SCROLLBAR 30;44 #00000000 #00000000 none MENU COLOR TITLE 0 #ffffffff #00000000 none MENU COLOR SEL 30;47 #40000000 #ffffffff # 배경이미지경로 MENU BACKGROUND pxelinux.cfg/logo.png LABEL BootLocal MENU LABEL Boot from local HDD localboot 0 TEXT HELP Boot to local hard disk ENDTEXT MENU BEGIN Redhat Enterprise Linux MENU TITLE Redhat Enterprise Linux LABEL Previous MENU LABEL Previous Menu TEXT HELP Return to previous menu ENDTEXT MENU EXIT MENU SEPARATOR MENU INCLUDE RHEL/RHEL.menu MENU END MENU BEGIN CentOS MENU TITLE CentOS LABEL Previous MENU LABEL Previous Menu TEXT HELP Return to previous menu ENDTEXT MENU EXIT MENU SEPARATOR MENU INCLUDE CentOS/CentOS.menu MENU END MENU BEGIN Fedora MENU TITLE Fedora LABEL Previous MENU LABEL Previous Menu TEXT HELP Return to previous menu ENDTEXT MENU EXIT MENU SEPARATOR MENU INCLUDE Fedora/Fedora.menu MENU END MENU BEGIN Debian MENU TITLE Debian LABEL Previous MENU LABEL Previous Menu TEXT HELP Return to previous menu ENDTEXT MENU EXIT MENU SEPARATOR MENU INCLUDE Debian/Debian.menu MENU END MENU BEGIN Ubuntu MENU TITLE Ubuntu LABEL Previous MENU LABEL Previous Menu TEXT HELP Return to previous menu ENDTEXT MENU EXIT MENU SEPARATOR MENU INCLUDE Ubuntu/Ubuntu.menu MENU END MENU BEGIN openSUSE MENU TITLE openSUSE LABEL Previous MENU LABEL Previous Menu TEXT HELP Return to previous menu ENDTEXT MENU EXIT MENU SEPARATOR MENU INCLUDE openSUSE/openSUSE.menu MENU END MENU BEGIN VMware MENU TITLE VMware LABEL Previous MENU LABEL Previous Menu TEXT HELP Return to previous menu ENDTEXT MENU EXIT MENU SEPARATOR MENU INCLUDE VMware/VMware.menu MENU END MENU BEGIN Tools and Utilities MENU TITLE Tools and Utilities LABEL Previous MENU LABEL Previous Menu TEXT HELP Return to previous menu ENDTEXT MENU EXIT MENU SEPARATOR MENU INCLUDE UTIL/UTIL.menu MENU END MENU BEGIN DOS Based MENU TITLE DOS Based LABEL Previous MENU LABEL Previous Menu TEXT HELP Return to previous menu ENDTEXT MENU EXIT MENU SEPARATOR MENU INCLUDE DOS/DOS.menu MENU END
ISO파일을 마운트한 경로를 참조하여 아래와 같이 설정하도록 한다.
repository 경로는 미리 구성한 http repository 경로를 지정한다.
RHEL/RHEL.menu
LABEL 3 MENU LABEL RHEL 7.3 (64-bit) KERNEL RHEL/7.3/x64/isolinux/vmlinuz append initrd=RHEL/7.3/x64/isolinux/initrd.img repo=http://192.168.222.254/rhel/7.3/x64 devfs=nomount ip=dhcp TEXT HELP Install RHEL 7.3 (64-bit) ENDTEXT LABEL 2 MENU LABEL RHEL 6.8 (64-bit) KERNEL RHEL/6.8/x64/isolinux/vmlinuz append initrd=RHEL/6.8/x64/isolinux/initrd.img repo=http://192.168.222.254/rhel/6.8/x64 devfs=nomount ip=dhcp TEXT HELP Install RHEL 6.8 (64-bit) ENDTEXT LABEL 1 MENU LABEL RHEL 5.11 (64-bit) KERNEL RHEL/5.11/x64/isolinux/vmlinuz append initrd=RHEL/5.11/x64/isolinux/initrd.img method=http://192.168.222.254/rhel/5.11/x64 devfs=nomount ip=dhcp TEXT HELP Install RHEL 5.11 (64-bit) ENDTEXT