Hướng dẫn cài đặt PXE Server phục vụ cho cài OS tự động:
Các gói cần cài đặt:
Server centos redhat 6.8 Final
•
•
•
•
tftp-server
dhcp
xinetd
vsftpd
Tạo repo:
#vi /etc/yum.repos.d/rpmforge.repo
rpmforge.repo
#
# yum install –y dhcp.x86_64
# yum install –y xinetd.x86_64
# yum install –y vsftpd.x86_64
# yum install –y syslinux
Kịch bản:
Để cài đặt qua mạng, Máy client cần kết nối được đến Server PXE để lấy IP
Cấu hình dhcp để cấp phát IP cho client
dhcp_pxe.conf
# /etc/init.d/dhcpd restart
Chạy cùng Xinetd:
#vi /etc/vsftpd/vsftpd.conf
# /etc/init.d/dhcpd restart
vsftpd.conf
cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/
cp /usr/share/syslinux/mboot.c32 /var/lib/tftpboot/
cp /usr/share/syslinux/chain.c32 /var/lib/tftpboot/
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
cp /usr/share/syslinux/memdisk /var/lib/tftpboot/
tạo thư mục image của os (ở đây sẽ cài Centos 6.3)
mkdir –p /var/lib/tftpboot/centos
tạo thư mục:
mkdir –p /var/lib/tftpboot/pxelinux.cfg
Tạo menu boot lúc khởi động vào
vi /var/lib/tftpboot/pxelinux.cfg/default
default.txt
Download file iso của Centos 6.3 về.
Cho vào thư mục
/var/lib/tftpboot/centos
efiboot.img
efidisk.img
initrd.img
TRANS.TBL
vmlinuz
Tạo script tự động để cài
#vi /var/ftp/ks/centos/6.3_full.ks
6.3_full.ks
File này sẽ thay đổi tùy theo nhu cầu cài đặt OS của từng hệ thống
Khởi động Client vào kiểm tra cài đặt.