The software described in this documentation is either in Extended Support or Sustaining Support. See https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdf for more information.
Oracle recommends that you upgrade the software described by this documentation as soon as possible.
The server or servers that host the DHCP and TFTP services do not need to host the installation packages. The DHCP server defines the boot loader file and the TFTP server from which a client can download the boot-loader, installation kernel, and initial ram-disk files. The boot-loader files that the TFTP server hosts can optionally define the server from which a client can obtain the installation packages.
To configure the Dynamic Host Configuration Protocol (DHCP) and Trivial File Transfer Protocol (TFTP) services for PXE client installation requests:
Configure the DHCP service on a server:
Install the
dhcppackage.#
yum install dhcpEdit
/etc/dhcp/dhcpd.confand configure an entry for the PXE clients, for example:allow booting; allow bootp; set vendorclass = option vendor-class-identifier; option pxe-system-type code 93 = unsigned integer 16; set pxetype = option pxe-system-type; option domain-name "mydom.com"; subnet 10.0.0.0 netmask 255.255.255.0 { option domain-name-servers 10.0.0.1; option broadcast-address 10.0.0.255; option routers 10.0.0.1; default-lease-time 14400; max-lease-time 28800; if substring(vendorclass, 0, 9)="PXEClient" { if pxetype=00:06 or pxetype=00:07 { filename "efi/BOOTX64.efi"; } else { filename "pxelinux/pxelinux.0"; } } pool { range 10.0.0.101 10.0.0.200; } next-server 10.0.0.6; } host svr1 { hardware ethernet 08:00:27:c6:a1:16; fixed-address 10.0.0.253; option host-name "svr1"; } host svr2 { hardware ethernet 08:00:27:24:0a:56; fixed-address 10.0.0.254; option host-name "svr2"; }This example configures a pool of generally available IP addresses in the range 10.0.0.101 through 10.0.0.200 on the 10.0.0/24 subnet. Any PXE-booted system on the subnet uses the boot loader that the
filenameparameter specifies for its PXE type. The boot-loader fileBOOTX64.efifor UEFI-based clients is located in theefisubdirectory of the TFTP server directory. The boot-loader filepxelinux.0for BIOS-based clients is located in thepxelinuxsubdirectory.The
next-serverstatement specifies the IP address of the TFTP server from which a client can download the boot-loader file.NoteYou should include a
next-serverstatement even if you use the same server to host both DHCP and TFTP services. Otherwise, some boot loaders do not know how to obtain their configuration files, which causes them to reboot the client, to hang, or to display a prompt such asboot:orgrub>.The static IP addresses 10.0.0.253 and 10.0.0.254 are reserved for
svr1andsvr2, which are identified by their MAC addresses.If the server has more than one network interface, edit
/etc/sysconfig/dhcpdand configure the interface on which the server should respond to DHCP requests, for example:DHCPDARGS="eth1"
Start the DHCP service, and configure it to start after a reboot.
#
service dhcpd start#chkconfig dhcpd onIf you make any changes to
/etc/dhcp/dhcpd.conf, restart thedhcpdservice. You do not need to restart the service if you change the content of boot loader configuration files.Configure the firewall to accept DHCP requests, for example:
#
iptables -I INPUT -i eth1 -p udp --dport 67:68 --sport 67:68 -j ACCEPT#service iptables saveIn this example, the server expects to receive requests on interface
eth1.
Configure the TFTP service on a server:
Install the
syslinuxandtftp-serverpackages:#
yum install syslinux tftp-serverThe
syslinuxpackage provides thepxelinux.0boot loader, which BIOS-based PXE clients can use to load the Linux installation kernel (vmlinuz).UEFI-based PXE clients can use the
BOOTX64.efiboot loader, which is available asEFI/BOOT/BOOTX64.efifrom the Oracle Linux 6 Update 6 Media Pack DVD image.Edit
/etc/xinetd.d/tftpand modify thedisableandserver_argsattributes to enablexinetdto start the TFTP service (in.tftpd) and define the TFTP server directory, for example:service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args =-s /var/lib/tftpbootdisable =noper_source = 11 cps = 100 2 flags = IPv4 }This example defines the TFTP server directory to be
/var/lib/tftpboot, which is the default.When
xinetdreceives a TFTP request, it startsin.tftpdand directs the request to it.For more information about the configuration attributes, see the
xinetd.conf(5)manual page.Create
efiandpxelinux/pxelinux.cfgsubdirectories of the TFTP server directory, for example:#
mkdir -p /var/lib/tftpboot/efi#mkdir -p /var/lib/tftpboot/pxelinux/pxelinux.cfgThese directories are used to contain the boot loader configuration files for UEFI and BIOS-based PXE clients respectively.
Copy the BIOS boot-loader file to the
pxelinuxdirectory, the UEFI boot-loader and splash image files to theefisubdirectory, and the installation kernel and ram-disk image files to both subdirectories, for example:#
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/pxelinux/pxelinux.0#wget http://10.0.0.11/OSimage/OL6.6/EFI/BOOT/BOOTX64.efi\-O /var/lib/tftpboot/efi/BOOTX64.efi#wget http://10.0.0.11/OSimage/OL6.6/EFI/BOOT/splash.xpm.gz\-O /var/lib/tftpboot/efi/splash.xpm.gz#wget http://10.0.0.11/OSimage/OL6.6/isolinux/vmlinuz\-O /var/lib/tftpboot/efi/vmlinuz-OL6u6#wget http://10.0.0.11/OSimage/OL6.6/isolinux/initrd.img\-O /var/lib/tftpboot/efi/initrd-OL6u6.img#ln /var/lib/tftpboot/efi/vmlinuz-OL6u6 /var/lib/tftpboot/pxelinux/vmlinuz-OL6u6#ln /var/lib/tftpboot/efi/initrd-OL6u6.img /var/lib/tftpboot/pxelinux/initrd-OL6u6.imgThis example uses HTTP to obtain the
BOOTX64.efi,splash.xpm.gz,vmlinuz, andinitrd.imgfiles from an installation server.To be able to install different operating system versions on PXE clients,
vmlinuzandinitrd.imgare renamed asvmlinuz-OL6u6andinitrd-OL6u6.img. Alternatively, you could copy the kernel and ram-disk image files to subdirectories such asefi/OL6u6andpxelinux/OL6u6.Create the default boot loader configuration file, for example
efi/efidefaultorpxelinux/pxelinux.cfg/default.For more information, see Section 1.4.9, “About Boot-Loader Configuration Files”.
If SELinux is enabled in enforcing mode on your system and you configure a TFTP server directory other than
/var/lib/tftpboot, use the semanage command to define the default file type of the TFTP server directory hierarchy astftpdir_tand then use the restorecon command to apply the file type to the entire directory hierarchy, for example:#
/usr/sbin/semanage fcontext -a -t tftpdir_t "/var/tftpboot(/.*)?"#/sbin/restorecon -R -v /var/tftpbootNoteThe semanage and restorecon commands are provided by the
policycoreutils-pythonandpolicycoreutilspackages.Start the
xinetdservice, and configure it to start after a reboot.#
service xinetd start#chkconfig xinetd onIf you make any changes to
/etc/xinetd.d/tftp, restart thexinetdservice. You do not need to restart the service if you change the content of boot loader configuration files.Configure the firewall to accept TFTP requests, for example:
#
iptables -I INPUT -i eth1 -p udp --dport 69 -j ACCEPT#service iptables saveIn this example, the server expects to receive requests on interface
eth1.
For information about configuring and using kickstart to perform automated installation, see Chapter 3, Installing Oracle Linux by Using Kickstart.

