14
By Ayaz Ullah Khan PXE-Boot Server Configuration In R.H.E.L 7.2 Step-1: Give Static I.P To Your Linux Machine. #vim /etc/sysconfig/network-scricpt/ifcfg-en01xxx (en01xx Your Linux Machine’s Interface) Press ‘i’ To Come In Insert Mode,Then Type BOOTPROTO=static ONBOOT= yes IPADDR = 172.17.1.xx As per your requirement NETMASK = 255.255.255.0 As per your requirement GATEWAY = 172.17.1.x As per your requirement Now press ‘Esc’ key and then “Shift + colon (:)” then type :wq To Save #systemctl restart network #chkconfig network on

Pxe Boot In RHEL 7.2

Embed Size (px)

Citation preview

Page 1: Pxe Boot In RHEL 7.2

By Ayaz Ullah Khan

PXE-Boot Server Configuration In R.H.E.L 7.2

Step-1:

Give Static I.P To Your Linux Machine.

#vim /etc/sysconfig/network-scricpt/ifcfg-en01xxx (en01xx Your Linux Machine’s Interface) Press ‘i’ To Come In Insert Mode,Then Type

BOOTPROTO=static

ONBOOT= yes

IPADDR = 172.17.1.xx As per your requirement

NETMASK = 255.255.255.0 As per your requirement

GATEWAY = 172.17.1.x As per your requirement

Now press ‘Esc’ key and then “Shift + colon (:)” then type

:wq To Save

#systemctl restart network

#chkconfig network on

Page 2: Pxe Boot In RHEL 7.2

By Ayaz Ullah Khan

Step-2:

Now Mount The DVD of RHEL 7.2 And Make Yum-Server.

Before that disable all firewall..

#systemctl stop firewalld

#setenforce 0

#chkconfig iptables off

#vim /etc/selinux/config

Diable the Selinux as shown in image

#mount /dev/sr0 or cdrom /mnt/

#cd /mnt/Packages

#rpm –ivh vsftpd10cgxxxx…….rpm

#rpm –ivh createrepo120xxx…..rpm

#mkdir –p /var/ftp/pub/rhel7/dvd

#cp –rvf /mnt/* /var/ftp/pub/rhel7/dvd

#cd /etc/yum.repos.d/

#ls –l

If any thing is present then delete all

Page 3: Pxe Boot In RHEL 7.2

By Ayaz Ullah Khan

#vim yum.repo Type the lines as shown below

Save and quit

#cd /var/ftp/pub/rhel7/dvd/

#cd repodata/

#ls

And in that copy ‘.xml file’

#cp d77c6149xxxx…………..x64.xml /var/ftp/pub/rhel7/dvd/groups-comps-Server.xml

#createrepo –vg /var/ftp/pub/rhel7/dvd/groups-comps-Server.xml /var/ftp/pub/rhel7/dvd/

#yum list all

#yum group list

#cd

Page 4: Pxe Boot In RHEL 7.2

By Ayaz Ullah Khan

Step-3:

Now Configure Kick-Start Setup & HTTP Services.

#yum install httpd system-config-kickstart –y

#ln –s /var/ftp/pub/ /var/www/html

#ls –l /var/www/html/

#systemctl restart vsftpd

#chkconfig vsftpd on

#systemctl enable vsftpd

#systemctl restart httpd

#systemctl enable httpd

#restorecon –R /var/www/html/

#restorecon -R /var/ftp/pub

Now,

#system-config-kickstart

And Follow Screen Shots below

1.Base Conf.(Set All Things As Shown as arrows)

Set Your

Password

Page 5: Pxe Boot In RHEL 7.2

By Ayaz Ullah Khan

2.Installation Method.(Set All Things As Shown as arrows & I.P of your linux machine)

3.Boot Loader Option.(Set All Things As Shown as arrows)

Page 6: Pxe Boot In RHEL 7.2

By Ayaz Ullah Khan

4.Partition Information.(Set All Things As Shown as arrows)

Click On Add Button, Give mount point /, /boot, swap, /home, /var etc. & size for that respectively as well as file System type as per your requirement. For eg.

Page 7: Pxe Boot In RHEL 7.2

By Ayaz Ullah Khan

5.Network Configuration.(Set All Things As Shown as arrows)

Page 8: Pxe Boot In RHEL 7.2

By Ayaz Ullah Khan

6.FirewallConfiguratio.(Set All Things As Shown as arrows)

7.Post Installation Script. (Set All Things as Shown as arrows)

You can add your own user and set password to them.

Page 9: Pxe Boot In RHEL 7.2

By Ayaz Ullah Khan

8.Save the File Now.(As Shown by arrows)

Go to File Save File System var ftp pub

Rename the file to workstation.cfg(Or your Choice but with “.cfg’’) And Save It.

Page 10: Pxe Boot In RHEL 7.2

By Ayaz Ullah Khan

Step-3:

Script The Installation Packages.

#ls –l /var/ftp/pub/workstation.cfg

#vim /root/anaconda-ks.cfg

Copy the above selected thing and open new terminal & paste in another file given below and save it.

Copy All Selected Items

Page 11: Pxe Boot In RHEL 7.2

By Ayaz Ullah Khan

#vim /var/ftp/pub/workstation.cfg

#systemctl restart httpd

#systemctl restart vsftpd

Paste the things here below the line after size as shown by arrow.See the lists of packages from this Snapshot & remove unwanted packages to avoid errors.

Page 12: Pxe Boot In RHEL 7.2

By Ayaz Ullah Khan

Step-4:

Install “syslinux”, “xinetd”, “tftp”, “dnsmasq” servers.

#yum install syslinux xinetd tftp-server –y

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

#cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/

#vim /etc/xinetd.d/tftp

In this file write disable = no & save it.

#systemctl restart xinetd

#systemctl enable xinetd

Page 13: Pxe Boot In RHEL 7.2

By Ayaz Ullah Khan

Preparing DHCP :

#yum install dnsmasq

#vim /etc/dnsmasq.conf

Press ‘i’ and write on particular lines by setting line no. by usine “:set nu command”

port=0 On Line No. 11

interface= en01xxx On Line No. 95(This Interface is your machine’s interface)

dhcp-range=172.17.1.200,172.17.1.250,12h On Line No. 147(Use Your Own IP Range)

dhcp-option=option:router,172.17.1.xx This is your machine’s static IP on Line No. 318

dhcp-boot=pxelinux.0,172.17.1.x On Line No. 419 (This Is your Machine’s Static I.P)

:wq Save & Quit

#systemctl start dnsmasq

#systemctl restart dnsmasq

#netstsat –ntulp (Check For Port 67)

#systemctl enable dnsmasq

#cd /var/ftp/pub/rhel7/dvd/images/pxeboot/

#ls -l

#cp initrd.img vmlinuz /var/lib/tftpboot/

#cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/

#cd /var/ftp/pub/rhel7/dvd/isolinux/

#cp -rvf * /var/lib/tftpboot/

Press :y

Again press :y

Page 14: Pxe Boot In RHEL 7.2

By Ayaz Ullah Khan

Now,

#vim /var/lib/tftpboot/prelinux.cfg/default

press ‘i’ and write the below things

:wq Save & Quit

#systemctl restart xinetd

#systemctl enable xinetd

#systemctl stop firewalld

#setenforce 0

------------------------------At The End Disable All The Firewall-----------------------------------

Step-5: At last boot the Client Machine with Pxe-boot Server

Machine. Your RHEL 7.2 Will Be Install.

Your Linux

Machine’s IP