Thursday, March 9, 2017

How to install PXE server in CentOS 7.3


1.      Install CentOS 7.3
2.      Download CentOS 7.3 iso (CentOS-7-x86_64-DVD-1611.iso) to /home/fae/Downloads
3.      Set IP Address as static IP (one for PXE LAN, one for management LAN)
#cd /etc/sysconfig/network-scripts
Edit PXE LAN configuration (enp10s0)


Edit Managament LAN (enp9s0)


4.  #yum install httpd xinetd dhcp syslinux tftp-server

5.      Setup DHCP server
#vi /etc/dhcp/dhcpd.conf

6.      Setup http server
#mount –o loop /home/fae/Downloads/CentOS-7-x86_64-DVD-1611.iso /mnt
7.      Create a directory to store CentOS packages.
#mkdir /var/www/centos7
8.      Copy all files from /mnt to /var/www/centos7
#cp –a /mnt/* /var/www/centos7/
9.      Set proper permissions to this directory
#chmod –R 755 /var/www/centos7
10.  Create PXE server configuration
#vi /etc/httpd/conf.d/pxe.conf

11.  Setup tftp server
12.  Copy all the boot loader files provided by syslinux to /var/lib/tftpboot
#cp –a /usr/share/syslinux/* /var/lib/tftpboot/
13.  Create CentOS 7.3 directory and copy CentOS 7.3 bootable kernel and initrd images to CentOS directory
#mkdir /var/lib/tftpboot/centos7
#cp /mnt/images/pxeboot/vmlinuz /var/lib/tftpboot/centos7
#cp /mnt/images/pxeboot/initrd.img /var/lib/tftpboot/centos7
14.  Create PXE server default configuration
#mkdir /var/lib/tftpboot/pxelinux.cfg
#vi /var/lib/tftpboot/pxelinux.cfg/default

15.  Edit /etc/xinetd.d/tftp, change “disable=yes” to “no”
#vi /etc/xinetd.d/tftp

16.  Start all services
#systemctl enable xinetd
#systemctl enable httpd
#systemctl enable dhcpd
#systemctl restart xinetd
#systemctl restart httpd
#systemstl restart dhcpd
17.  Setup firewall
#firewall-cmd --permanent --add-service=http
#firewall-cmd --permanent --add-service=dhcp
#firewall-cmd --permanent --add-port=69/udp
#firewall-com --permanent --add-port=69/tcp
#firewall-cmd --reload
18.  Use remote client to test PXE server


No comments:

Post a Comment