본문 바로가기

IT 엔지니어/Linux server

Linux PXE 서버

[방화벽 중단 및 재시작]

vi /etc/sysconfig/selinux

selinux=diabled

systemctl stop firewalld

systemctl disable firewalld

setenforce 0

getenforce 0

 

sytemctl restart dhcpd

 

 

[PXE 서버]

0.기본적으로 DHCP 서버 구축 필요

 

1. 프로그램 설치

#dnf -y install syslinux // 부팅관련 프로그램

#dnf -y install tftp-server

#dnf -y install vsftpd-3.0.5-6.el9.x86_64

 

2. ftp 환경설정 파일

vi /etc/vsftpd/vsftpd.conf

anonymous_enable=yes // 익명 활성화

 

3.기존 CD/ROM unmout

  1. umount /dev/cdrom
  2.  

하단 /dev/sr0 언마운트 후 재마운트 진행

 4. ISO 파일 마운트

  1. mount /dev/cdrom/ /var/ftp/pub - 익명 사용 디렉터리로 마운트
  2. mount: /var/ftp/pub: WARNING: source write-protected, mounted read-only.
  3.  

/var/ftp/pub으로 마운트 확인

 

5. 부팅 파일 복사 // 클라이언트 자동 복사 후 부팅

 

[배포서버 구축 과정]

 

5-1

cd /var/ftp/pub/images/pxeboot

#cp vmlinuz /var/lib/tftpboot

#cp initrd.img /var/lib/tftpboot

 

 

5-2

cd /var/ftp/pub/isolinux

#cp ldlinux.c32 /var/lib/tftpboot

 

5-3

cd /usr/share/syslinux

#cp pxelinux.0 /var/lib/tftpboot

 

 

6.  DHCP 환경 설정 파일

/etc/dhcp/dhcpd.conf

 

 

{ ...

allow booting;

allow bootp;

next-server 192.168.10.100; /// DHCP 서버 주소

filename "pxelinux.0";

} 추가

 

7. 부팅 관련 설정 파일 디렉터리 생성

 

#mkdir /var/lib/tftpboot/pxelinux.cfg

  • cd /var/lib/tftpboot/pxelinux.cfg
  • vi default /// 아래 내용 입력

vi /var/lib/tftpboot/pxelinux.cfg/default

inst.ks=ftp://192.168.10.100 /rocky.ks 킥스타드 위한 추가 입력

 

  • DEFAULT Rocky_AUTO_Install
  • LABEL Rocky9_AUTO_Install
  • kernel vmlinuz APPEND initrd=initrd.img -줄이음-inst.repo=ftp://192.168.10.100/pub (DHCP서버 주소)

8. 방화벽 제거 후 서비스 재시작

[root@localhost pxelinux.cfg]# systemctl restart dhcpd

[root@localhost pxelinux.cfg]# systemctl restart vsftpd

[root@localhost pxelinux.cfg]# systemctl restart tftp

[root@localhost pxelinux.cfg]# systemctl restart tftp.service

 

 

클라이언트 - DHCP 서버 - ftp /tftp 서버 - PXE서버 작동

  1. 메모리 4GB 추가
  2. 새로운 VM 추가
  3. df 확인 /// 재마운트 파일 삭제 후 재복사 재부팅

 

10. 킥스타트

  1. cp anaconda-ks.cfg /var/ftp/rocky.ks
  2. chmod 777 / 644 rocky.ks

url --url=ftp://192.168.19.100/pub 추가

6th #repo // 주석처리 필요

#cdrom /// 주석 처리 필요

23 @^graphical-server-environment에서

23 @^server with GUI

24 @Gnome Applications // 으로 변경

mc

 

'IT 엔지니어 > Linux server' 카테고리의 다른 글

Linux 가상호스팅 웹서버  (0) 2025.03.15
[일반 사용자 웹 사이트 허용]  (0) 2025.03.12
DHCP 서버  (0) 2025.03.06
리눅스 FTP part 3  (0) 2025.03.05
DBMS  (0) 2025.03.03