운영체제를 설치하고자 하는데 부팅에 필요한 하드웨어가 존재 하지 않는 경우 TFTP 서버를 구축하고 PXE Client 로 네트워크 부팅을 하여 설치를 진행 할수 있습니다.

PXE 부팅은 요세.. NIC(Network Interface Card)에서 잘 지원 해주고 있습니다.

1. TFTP 설치
TFTP 설치를 해줍니다.

[root@ruo91 ~]# yum install -y tftp tftp-server

TFTP 는 xinetd 를 사용하므로 TFTP 를 활성화 시켜 주기 위해 disable 의 값을 “yes” 에서 “no” 로 수정 해줍니다.

[root@ruo91 ~]# vi /etc/xinetd.d/tftp

service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = yes # yes 를 no 로 수정
per_source = 11
cps = 100 2
flags = IPv4
}

/etc/inetd.conf 파일에 아래 내용을 추가 시켜 줍니다.

[root@ruo91 ~]# vi /etc/inetd.conf

tftp dgram udp wait root /usr/sbin/tcpd in.tftpd /tftpboot

2. syslinux 설치

http://rpmrepo.org/RPMforge/Using

[root@ruo91 ~]# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
[root@ruo91 ~]# rpm -UvH rpmforge-release-0.5.1-1.el5.rf.i386.rpm
[root@ruo91 ~]# yum install -y syslinux

3. ISO 이미지 마운트
미러링 서버에서 DVD 이미지 파일을 다운로드 하고 마운트 합니다.

[root@ruo91 ~]# wget http://ftp.neowiz.com/pub/centos/5.4/isos/i386/CentOS-5.4-i386-bin-DVD.iso
[root@ruo91 ~]# mkdir /centos5.4
[root@ruo91 ~]# mount -t iso9660 -o loop /root/CentOS-5.4-i386-bin-DVD.iso /centos5.4

4. TFTP 설정
– PXE 환경 설정 파일 생성

[root@ruo91 ~]# mkdir /tftpboot/pxelinux.cfg
[root@ruo91 ~]# chmod +r -R /tftpboot

– 부팅 이미지 복사

[root@ruo91 ~]# cp /usr/share/syslinux/pxelinux.0 /tftpboot
[root@ruo91 ~]# cp /usr/share/syslinux/mboot.c32 /tftpboot
[root@ruo91 ~]# cp /centos5.4/isolinux/* /tftpboot
[root@ruo91 ~]# cp /tftpboot/isolinux.cfg /tftpboot/pxelinux.cfg/default

– xinetd 를 시작 해줍니다.

[root@ruo91 ~]# /etc/init.d/xinetd start
xinetd (을)를 시작 중: [ OK ]

5. DHCP 설치 및 설정

[root@ruo91 ~]# yum install -y dhcp dhcp-devel
[root@ruo91 ~]# vi /etc/dhcpd.conf

authoritative;
Allow bootp;
ddns-update-style none;
ping-check true;
option subnet-mask 255.255.255.0;
option domain-name “kns.kornet.net”;
option domain-name-servers 168.126.63.1,168.126.63.2;
default-lease-time 86400;
max-lease-time 129600;
log-facility local7;
# PXE Client 에게 IP 할당을 위해 서브넷을 나눠 줍니다.
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.254;
option routers 192.168.0.1;
ddns-updates off;
filename “pxelinux.0”; # “/path/pxelinux.0” 이런식은 TFTP open timeout 에러 납니다.
}

– DHCPD 를 시작 합니다.

[root@ruo91 ~]# /etc/init.d/dhcpd start
dhcpd (을)를 시작 중: [ OK ]

6. PXE Client 설정
Bios 나 ESC 키를 눌러 네트워크 부팅을 설정 해줍니다.

 

TFTP 서버와 연결이 성립되어 DHCP 로 아이피를 할당 받고 부팅이 됩니다.

 

참고

http://howtoforge.net/setting-up-a-pxe-install-server-for-multiple-linux-distributions-on-debian-lenny

 

TFTP open timeout 에러 해결

http://www.linuxquestions.org/questions/linux-networking-3/error-tftp-open-timeout-303612/