1.4 Configuring a Network Installation Server

1.4.1 Setting up a New NFS Server
1.4.2 Configuring an Existing NFS Server
1.4.3 Setting up a New HTTP Server
1.4.4 Configuring an Existing HTTP Server
1.4.5 Setting up a Network Installation Server
1.4.6 Modifying a Full DVD Image to Support Brtfs root File System Installation
1.4.7 Configuring DHCP and TFTP Services to Support PXE Clients
1.4.8 Configuring Dnsmasq to Support PXE Clients
1.4.9 About Boot-Loader Configuration Files
1.4.10 Configuring DHCP to Support iPXE Clients

If you use a Boot ISO or the Preboot eXecution Environment (PXE) to install systems, you can set up a network installation server to host the RPM packages. This server must have sufficient storage space to host the full Oracle Linux Release 6 installation DVD image (approximately 3.5 GB), and you must configure it to use either HTTP or NFS to serve the image files to the target systems on which you want to install Oracle Linux 6.

The procedures in this section assume that you are configuring an Oracle Linux 6 system as a network installation server. For information about configuring an Oracle Linux 7 system as a network installation server, see the Oracle Linux 7 Installation Guide.

Perform one of the procedures in the following sections to set up an HTTP or NFS server on the system that will act as the network installation server:

You can then set up the network installation server. See Section 1.4.5, “Setting up a Network Installation Server”.

If required, you can configure a network installation server to support installation of a btrfs root file system. See Section 1.4.6, “Modifying a Full DVD Image to Support Brtfs root File System Installation”.

If you want to support PXE client installation, configure the Dynamic Host Configuration Protocol (DHCP) and Trivial File Transfer Protocol (TFTP) services. See Section 1.4.7, “Configuring DHCP and TFTP Services to Support PXE Clients” or Section 1.4.8, “Configuring Dnsmasq to Support PXE Clients”.

As an alternative, you can use Cobbler to configure a provisioning server that integrates the functions of an HTTP server, network installation server, DHCP server, and TFTP server. See Section 1.5, “Configuring a Cobbler Provisioning Server”.

1.4.1 Setting up a New NFS Server

Note

This procedure assumes that you are setting up an Oracle Linux 6 system as an NFS version 4 server. Using NFSv4 greatly simplifies firewall configuration as you need only configure a single rule for TCP port 2049.

To set up an NFS server:

  1. Install the nfs-utils package.

    # yum install nfs-utils

  2. Create the directory where you will copy the full Oracle Linux Release 6 Media Pack DVD image, for example /var/OSimage/OL6.6:

    # mkdir -p /var/OSimage/OL6.6

  3. Edit the configuration file, /etc/exports, as follows.

    1. Add an entry for the directory where you will copy the DVD image.

      The following example allows read-only access to the directory /var/OSimage/OL6.6 for any NFS client on the 192.168.1 subnet:

      /var/OSimage/OL6.6 192.168.1.0/24(ro)

    2. Save your changes to the file.

  4. Start the NFS server, and configure it to start after a reboot.

    # service rpcbind start
    # service nfs start
    # service nfslock start
    # chkconfig rpcbind on
    # chkconfig nfs on
    # chkconfig nfslock on

  5. If you have configured a firewall on your system, configure it to allow incoming NFSv4 requests from NFS clients.

    For example, use the following commands to configure iptables to allow NFSv4 connections and save the change to the firewall configuration:

    # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 2049 -j ACCEPT
    # service iptables save

1.4.2 Configuring an Existing NFS Server

To configure an existing NFS server:

  1. Create the directory where you will copy the full Oracle Linux Release 6 Media Pack DVD image, for example /var/OSimage/OL6.6:

    # mkdir -p /var/OSimage/OL6.6

  2. Use the exportfs command to export the directory.

    # exportfs -i -o options client:export_dir

    For example, to allow read-only access to the directory /var/OSimage/OL6.6 for any NFS client on the 192.168.1 subnet:

    # exportfs -i -o ro 192.168.1.0/24:/var/OSimage/OL6.6

1.4.3 Setting up a New HTTP Server

Note

These instructions assume that you are setting up an Oracle Linux 6 system as an Apache HTTP server.

To set up an HTTP server:

  1. Install the Apache HTTP server package.

    # yum install httpd

  2. Create the directory where you will copy the full Oracle Linux Release 6 Media Pack DVD image, for example /var/www/html/OSimage/OL6.6:

    # mkdir -p /var/www/html/OSimage/OL6.6

    Note

    If SELinux is enabled in enforcing mode on your system, create the directory under the /var/www/html directory hierarchy so that the httpd_sys_content_t file type is set automatically on all the files in the repository.

  3. Edit the HTTP server configuration file, /etc/httpd/conf/httpd.conf, as follows:

    1. Specify the resolvable domain name of the server in the argument to ServerName.

      ServerName server_addr:80

      If the server does not have a resolvable domain name, enter its IP address instead. For example, the following entry would be appropriate for an HTTP server with the IP address 192.168.1.100.

      ServerName 192.168.1.100:80

    2. If the directory to which you will copy the DVD image in not under /var/www/html, change the default setting of DocumentRoot.

      In this example, the DVD image will be copied to /var/www/html/OSimage/OL6.6 so the setting of DocumentRoot can remain unchanged.

      DocumentRoot "/var/www/html"

    3. Verify that the <Directory> setting points to the same setting as DocumentRoot.

      #
      # This should be changed to whatever you set DocumentRoot to.
      #
      <Directory "/var/www/html">

    4. If you want to be able to browse the directory hierarchy, verify that the Options directive specifies the Indexes option, for example:

      Options Indexes FollowSymLinks

      Note

      The Indexes option is not required for installation.

    5. Save your changes to the file.

  4. Start the Apache HTTP server, and configure it to start after a reboot.

    # service httpd start
    # chkconfig httpd on

  5. If you have enabled a firewall on your system, configure it to allow incoming HTTP connection requests on TCP port 80.

    For example, the following command configures iptables to allow incoming HTTP connection requests and saves the change to the firewall configuration:

    # iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
    # service iptables save

1.4.4 Configuring an Existing HTTP Server

Note

This procedure assumes that the system is already configured as an Apache HTTP server. For other types of HTTP server, you will need to modify the steps for the server's configuration.

To configure an existing Apache HTTP server:

  1. Under the DocumentRoot hierarchy that is defined in the HTTP server configuration file (/etc/httpd/conf/httpd.conf), create the directory where you will copy the full Oracle Linux Release 6 Media Pack DVD image, for example /var/www/html/OSimage/OL6.6:

    # mkdir -p /var/www/html/OSimage/OL6.6

  2. Edit the HTTP server configuration file, /etc/httpd/conf/httpd.conf, and add a <Directory> section, for example:

    <Directory "/var/www/html/OSimage/OL6.6">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>

    Place this section after the closing </Directory> statement for the <Directory DocumentRoot> section.

    Note

    The Indexes option is not required for installation. Specify this option if you want to be able to browse the directory hierarchy.

  3. Reload the Apache HTTP server.

    # service httpd reload

1.4.5 Setting up a Network Installation Server

Note

This procedure assumes that you have set up the system as an NFS or HTTP server.

To set up a network installation server:

  1. Download the full Oracle Linux Media Pack DVD image (for example, V52218-01.iso for x86_64 (64 bit) Oracle Linux Release 6 Update 6 from the Oracle Software Delivery Cloud at http://edelivery.oracle.com/linux.

  2. Mount the DVD image on a suitable mount point (for example, /mnt):

    # mount -t iso9660 -o loop V52218-01.iso /mnt

  3. Use the following command to extract the contents of the DVD image into a directory whose contents are shareable using NFS or HTTP.

    For example, to copy the DVD image mounted on /mnt to /var/OSimage/OL6.6:

    # cp -a -T /mnt /var/OSimage/OL6.6

    or to /var/www/html/OSimage/OL6.6:

    # cp -a -T /mnt /var/www/html/OSimage/OL6.6

  4. Unmount the DVD image:

    # umount /mnt

  5. If SELinux is enabled in enforcing mode on your system and you have configured the system as an HTTP server but you did not copy the DVD image to a directory under /var/www/html:

    1. Use the semanage command to define the default file type of the directory hierarchy as httpd_sys_content_t:

      # /usr/sbin/semanage fcontext -a -t httpd_sys_content_t "/var/OSimage(/.*)?"

    2. Use the restorecon command to apply the file type to the entire directory hierarchy.

      # /sbin/restorecon -R -v /var/OSimage

    Note

    The semanage and restorecon commands are provided by the policycoreutils-python and policycoreutils packages.

To customize a network installation server that allows the installation of a system with a btrfs root file system, modify the images directory to support the Unbreakable Enterprise Kernel (UEK) instead of the Red Hat Compatible Kernel as the installation kernel. See Section 1.4.6, “Modifying a Full DVD Image to Support Brtfs root File System Installation”.

1.4.6 Modifying a Full DVD Image to Support Brtfs root File System Installation

Note

This procedure assumes that you have set up the system as a network installation server that uses HTTP or NFS to server files.

To set up a network installation server that allows the installation of a system with a btrfs root file system:

  1. Download the full Oracle Linux Media Pack DVD image (for example, V52218-01.iso for x86_64 (64 bit) Oracle Linux Release 6 Update 6 from the Oracle Software Delivery Cloud at http://edelivery.oracle.com/linux and copy its contents to a suitable directory such as /var/www/html/OSimage/OL6.6_UEK/images or /var/OSimage/OL6.6_UEK/images, whose contents are shareable using NFS or HTTP. See Section 1.4.5, “Setting up a Network Installation Server”.

  2. Modify the images directory of the image to support the Unbreakable Enterprise Kernel (UEK) as the installation kernel:

    1. Download the UEK Boot ISO image for the desired architecture (for example, V52220-01.iso for x86_64 (64 bit)).

    2. Mount the UEK Boot ISO image:

      # mount -t iso9660 -o loop V52220-01.iso /mnt

    3. Replace the contents of the images directory that you copied from the full DVD image with the contents of the images directory from the UEK Boot ISO image.

      For example, to replace /var/OSimage/OL6.6_UEK/images:

      # rm -rf /var/OSimage/OL6.6_UEK/images
      # cp -r /mnt/images /var/OSimage/OL6.6_UEK

      To replace /var/www/html/OSimage/OL6.6_UEK/images:

      # rm -rf /var/www/html/OSimage/OL6.6_UEK/images
      # cp -r /mnt/images /var/www/html/OSimage/OL6.6_UEK

  3. Copy the UEK Boot ISO image to a suitable medium from which you can boot the target system on which you want to install Oracle Linux 6 Update 6.

  4. Unmount the UEK Boot ISO image:

    # umount mount_dir

You can now use the modified image to install a system with a btrfs root file system. See Section 2.4.1, “Installing a Btrfs root File System”.

1.4.7 Configuring DHCP and TFTP Services to Support PXE Clients

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:

  1. Configure the DHCP service on a server:

    1. Install the dhcp package.

      # yum install dhcp
    2. Edit /etc/dhcp/dhcpd.conf and 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 filename parameter specifies for its PXE type. The boot-loader file BOOTX64.efi for UEFI-based clients is located in the efi subdirectory of the TFTP server directory. The boot-loader file pxelinux.0 for BIOS-based clients is located in the pxelinux subdirectory.

      The next-server statement specifies the IP address of the TFTP server from which a client can download the boot-loader file.

      Note

      You should include a next-server statement 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 as boot: or grub>.

      The static IP addresses 10.0.0.253 and 10.0.0.254 are reserved for svr1 and svr2, which are identified by their MAC addresses.

    3. If the server has more that one network interface, edit /etc/sysconfig/dhcpd and configure the interface on which the server should respond to DHCP requests, for example:

      DHCPDARGS="eth1"
    4. Start the DHCP service, and configure it to start after a reboot.

      # service dhcpd start
      # chkconfig dhcpd on

      If you make any changes to /etc/dhcp/dhcpd.conf, restart the dhcpd service. You do not need to restart the service if you change the content of boot loader configuration files.

    5. 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 save

      In this example, the server expects to receive requests on interface eth1.

  2. Configure the TFTP service on a server:

    1. Install the syslinux and tftp-server packages:

      # yum install syslinux tftp-server

      The syslinux package provides the pxelinux.0 boot loader, which BIOS-based PXE clients can use to load the Linux installation kernel (vmlinuz).

      UEFI-based PXE clients can use the BOOTX64.efi boot loader, which is available as EFI/BOOT/BOOTX64.efi from the Oracle Linux 6 Update 6 Media Pack DVD image.

    2. Edit /etc/xinetd.d/tftp and modify the disable and server_args attributes to enable xinetd to 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/tftpboot
          disable     = no
          per_source  = 11
          cps         = 100 2
          flags       = IPv4
      }

      This example defines the TFTP server directory to be /var/lib/tftpboot, which is the default.

      When xinetd receives a TFTP request, it starts in.tftpd and directs the request to it.

      For more information about the configuration attributes, see the xinetd.conf(5) manual page.

    3. Create efi and pxelinux/pxelinux.cfg subdirectories of the TFTP server directory, for example:

      # mkdir -p /var/lib/tftpboot/efi
      # mkdir -p /var/lib/tftpboot/pxelinux/pxelinux.cfg

      These directories are used to contain the boot loader configuration files for UEFI and BIOS-based PXE clients respectively.

    4. Copy the BIOS boot-loader file to the pxelinux directory, the UEFI boot-loader and splash image files to the efi subdirectory, 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.img

      This example uses HTTP to obtain the BOOTX64.efi, splash.xpm.gz, vmlinuz, and initrd.img files from an installation server.

      To be able to install different operating system versions on PXE clients, vmlinuz and initrd.img are renamed as vmlinuz-OL6u6 and initrd-OL6u6.img. Alternatively, you could copy the kernel and ram-disk image files to subdirectories such as efi/OL6u6 and pxelinux/OL6u6.

    5. Create the default boot loader configuration file, for example efi/efidefault or pxelinux/pxelinux.cfg/default.

      For more information, see Section 1.4.9, “About Boot-Loader Configuration Files”.

    6. 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 as tftpdir_t and 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/tftpboot
      Note

      The semanage and restorecon commands are provided by the policycoreutils-python and policycoreutils packages.

    7. Start the xinetd service, and configure it to start after a reboot.

      # service xinetd start
      # chkconfig xinetd on

      If you make any changes to /etc/xinetd.d/tftp, restart the xinetd service. You do not need to restart the service if you change the content of boot loader configuration files.

    8. Configure the firewall to accept TFTP requests, for example:

      # iptables -I INPUT -i eth1 -p udp --dport 69 -j ACCEPT
      # service iptables save

      In 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 Using Kickstart.

1.4.8 Configuring Dnsmasq to Support PXE Clients

Dnsmasq is designed to act as a DNS forwarder, DHCP server, and TFTP server for small networks. You can use dnsmasq as an alternative to configuring separate DHCP and TFTP services. For more information about dnsmasq, see the dnsmasq(8) manual page, /usr/share/doc/dnsmasq-version, and http://www.thekelleys.org.uk/dnsmasq/doc.html.

To configure dnsmasq for PXE client installation requests:

  1. Install the dnsmasq package.

    # yum install dnsmasq
  2. Edit /etc/dnsmasq.conf and configure entries for PXE clients and other systems on the network, for example:

    interface=eth1
    dhcp-range=10.0.0.101,10.0.0.200,6h
    dhcp-host=80:00:27:c6:a1:16,10.0.0.253,svr1,infinite
    dhcp-boot=pxelinux/pxelinux.0
    enable-tftp
    tftp-root=/var/lib/tftpboot

    The lines in the sample configuration file do the following:

    interface=eth1

    Listen for incoming client requests on interface eth1 only.

    dhcp-range=10.0.0.101,10.0.0.200,6h

    Reserve 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 with a six-hour lease.

    Note

    A dhcp-range setting is required to enable the DHCP service provided by dnsmasq. If you want to configure static addresses but not an address pool, specify a static network address and the keywords static and infinite, for example:

    dhcp-range=10.0.0.253,static,infinite
    dhcp-host=80:00:27:c6:a1:16,10.0.0.253,svr1,infinite

    Reserve the IP address 10.0.0.253 with infinite lease time for svr1, which is identified by the MAC address 08:00:27:c6:a1:16.

    dhcp-boot=pxelinux/pxelinux.0

    Specify the location of the boot-loader file required by PXE clients. This example supports BIOS-based PXE clients. An entry that supports UEFI-based clients might take the following form:

    dhcp-boot=efi/BOOTX64.efi

    If you want to use a separate TFTP server instead of dnsmasq, specify its IP address after the boot-loader path, for example:

    dhcp-boot=pxelinux/pxelinux.0,10.0.0.11
    enable-tftp

    Enable the TFTP service provided by dnsmasq.

    tftp-root=/var/lib/tftpboot

    Specify the root directory for files served by TFTP. To prevent clients from accessing any file on the host, dnsmasq rejects requests that specify .. as a path element.

  3. If you configure dnsmasq to provide the TFTP service:

    1. Create the TFTP server directories, for example:

      # mkdir -p /var/lib/tftpboot/pxelinux/pxelinux.cfg
    2. Copy the installation kernel and ram-disk image files to the TFTP server directory hierarchy, for example:

      # wget http://10.0.0.11/OSimage/OL6.6/isolinux/vmlinuz \
        -O /var/lib/tftpboot/pxelinux/vmlinuz
      # wget http://10.0.0.11/OSimage/OL6.6/isolinux/initrd.img \
        -O /var/lib/tftpboot/pxelinux/initrd.img

      This example uses HTTP to obtain the files from an installation server.

    3. If you want to support BIOS-based PXE clients, install the syslinux package and copy the pxelinux.0 boot loader to the TFTP server directory hierarchy.

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

      If you want to support UEFI-based PXE clients, copy the BOOTX64.efi boot loader and splash image files to the TFTP server directory hierarchy, for example:

      # 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
    4. Create the default boot loader configuration file, for example efi/efidefault or pxelinux/pxelinux.cfg/default.

      For more information, see Section 1.4.9, “About Boot-Loader Configuration Files”.

    5. If SELinux is enabled in enforcing mode on your system, use the semanage command to define the default file type of the TFTP server directory hierarchy as tftpdir_t and 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/lib/tftpboot(/.*)?"
      # /sbin/restorecon -R -v /var/lib/tftpboot
      Note

      The semanage and restorecon commands are provided by the policycoreutils-python and policycoreutils packages.

  4. If you want dnsmasq to act as a caching-only name server, configure a name server entry for 127.0.0.1 that precedes other name server entries.

    Dnsmasq ignores the 127.0.0.1 entry and forwards DNS queries to the other listed name servers. If the NetworkManager service is enabled, you can configure name service entries by using the graphical applet, the nm-connection-editor utility, or the system-config-network utility. Otherwise, you can configure name server entries directly in /etc/resolv.conf, for example:

    nameserver 127.0.0.1
    nameserver 10.0.0.8
    nameserver 10.0.0.4

  5. Start the dnsmasq service, and configure it to start after a reboot.

    # service dnsmasq start
    # chkconfig dnsmasq on

    If you make any changes to /etc/dnsmasq.conf, restart the dnsmasq service. You do not need to restart the service if you change the content of boot loader configuration files.

  6. Configure the firewall:

    1. Allow access by DHCP requests, for example:

      # iptables -I INPUT -i eth1 -p udp --dport 67:68 --sport 67:68 -j ACCEPT

      In this example, the server expects to receive requests on interface eth1.

    2. If you enable the TFTP service in dnsmasq, allow access by TFTP requests:

      # iptables -I INPUT -i eth1 -p udp --dport 69 -j ACCEPT
    3. If you want dnsmasq to act as a caching-only name server, allow access by DNS requests:

      # iptables -I INPUT -i eth1 -p tcp -m state --state NEW -m tcp --dport 53 -j ACCEPT
      # iptables -I INPUT -i eth1 -p udp -m udp --dport 53 -j ACCEPT
    4. Save the configuration:

      # service iptables save

For information about configuring and using Kickstart to perform automated installation, see Chapter 3, Installing Oracle Linux Using Kickstart.

1.4.9 About Boot-Loader Configuration Files

The default file is the default boot-loader configuration file for BIOS-based PXE clients and uses pxelinux configuration settings, for example:

prompt 0
default ol6u6
timeout 0

label ol6u6
kernel vmlinuz-OL6u6
append initrd=initrd-OL6u6.img ksdevice=eth0 kssendmac ks=http://10.0.0.11/ksfiles/ol6u6_cfg.ks

To allow the boot: prompt to be displayed, change the value of prompt to 1. To display the prompt, press Shift or Alt at the console.

The default directive identifies the default boot entry by its label value, ol6u6.

Pxelinux boots the client using the default boot entry after timeout/10 seconds.

The kernel directive defines the name of the kernel executable and the append directive defines any parameters that should be appended when loading the kernel, such as the name of the ram-disk image and the location of the Kickstart file.

You can use a configuration file such as the following to support a choice of installations:

prompt 0
default ol6u6
timeout 50

label ol6u6
kernel vmlinuz-OL6u6
append initrd=initrd-OL6u6.img ksdevice=eth0 kssendmac ks=http://10.0.0.11/ksfiles/ol6u6_cfg.ks

label ol7u1
kernel vmlinuz-OL7u1
append initrd=initrd-OL7u1.img ksdevice=eth0 kssendmac ks=http://10.0.0.11/ksfiles/ol7u1_cfg.ks

The efidefault file is the default boot loader configuration file for UEFI-based PXE clients and uses GRUB configuration settings, for example:

default=0
hiddenmenu
splashimage=(nd)/splash.xpm.gz
timeout=0

title Oracle Linux 6 Update 6 Installation
    root (nd)
    kernel /vmlinuz-OL6u6 ksdevice=eth0 kssendmac ks=http://10.0.0.11/ksfiles/ol6u6_cfg.ks
    initrd /initrd-OL6u6.img

The timeout=0 and hiddenmenu directives cause the default kernel to boot immediately without allowing you to press a key to display a menu or modify the configuration of a boot entry. The default kernel is defined as the first entry (0), which is the only entry listed in this file.

splashimage specifies the splash screen that hides boot messages unless you press Esc. In the example, the splash-screen file is shown as being available on (nd), which is the network device. The root directive defines that the kernel and initial ram-disk image files are also available on (nd).

The kernel directive defines the name of the kernel executable and any parameters that should be appended when loading the kernel, such as the location of the installation packages, and how to access these packages. The initrd directive specifies the initial ram-disk image file.

You can use a configuration file such as the following to support a choice of installations:

default=0
splashimage=(nd)/splash.xpm.gz
timeout=10

title Oracle Linux 6 Update 6 Installation
    root (nd)
    kernel /vmlinuz-OL6u6 ksdevice=eth0 kssendmac ks=http://10.0.0.11/ksfiles/ol6u6_cfg.ks
    initrd /initrd-OL6u6.img

title Oracle Linux 7 Update 1 Installation
    root (nd)
    kernel /vmlinuz-OL7u1 ksdevice=eth0 kssendmac ks=http://10.0.0.11/ksfiles/ol7u1_cfg.ks
    initrd /initrd-OL7u1.img

The kernel and ram-disk image file paths are assumed to be relative to the subdirectory such as efi or pxelinux that contains the boot loader. If you placed the vmlinuz and initrd.img files in a subdirectory such as efi/OL6u6 or pxelinux/OL6u6, the appropriate kernel and append lines for pxelinux would be:

kernel OL6u6/vmlinuz
append initrd=OL6u6/initrd.img ksdevice=eth0 kssendmac ks=http://10.0.0.11/ksfiles/ol6u6_cfg.ks

For GRUB, the appropriate kernel and initrd lines would be:

kernel /OL6u6/vmlinuz ksdevice=eth0 kssendmac ks=http://10.0.0.11/ksfiles/ol6u6_cfg.ks
initrd /OL6u6/initrd.img

To support different types of client, you can create a configuration file named for:

  • A client's UUID (for example, a8943708-c6f6-51b9-611e-74e6ac80b93d)

  • A client's MAC address prefixed by 01-, which represents the ARP hardware type for Ethernet, and using dashes to separate each byte value instead of colons (for example, 01-80-00-27-c6-a1-16)

  • A client's IP address expressed in hexadecimal without any leading 0x (for example, 0A0000FD represents the IP address 10.0.0.253)

The configuration files should be placed in either efi or pxelinux/pxelinux.cfg, depending on whether the client is UEFI or BIOS-based.

The boot loader looks for a configuration file in the following order until it finds a matching file name:

  • UUID (for example, a8943708-c6f6-51b9-611e-74e6ac80b93d)

  • 01-MAC_address (for example, 01-80-00-27-c6-a1-16)

  • Full 32 bits of the IP address (for example, 0A0000FD)

  • Most significant 28 bits of the IP address (for example, 0A0000F)

  • Most significant 24 bits of the IP address (for example, 0A0000)

  • Most significant 20 bits of the IP address (for example, 0A000)

  • Most significant 16 bits of the IP address (for example, 0A00)

  • Most significant 12 bits of the IP address (for example, 0A0)

  • Most significant 8 bits of the IP address (for example, 0A)

  • Most significant 4 bits of the IP address (for example, 0)

  • default (BIOS) or efidefault (EFI)

To reduce the number of configuration files that are required, you can group clients of the same type by IP address. For example, a configuration file named 0A0000E represents the IP address range 10.0.0.224 through 10.0.0.239.

If several configuration files have contents that should remain identical, you can use the ln command to link the files to a master copy, for example:

# ln master-ol6u6 0A0000FC
# ln master-ol6u6 0A0000FD
# ln master-ol7u1 0A0000FE

For more information about GRUB, enter the info grub command to access the GRUB manual.

For more information about pxelinux, see http://www.syslinux.org/wiki/index.php/PXELINUX.

For information about configuring and using Kickstart to perform automated installation, see Chapter 3, Installing Oracle Linux Using Kickstart.

1.4.10 Configuring DHCP to Support iPXE Clients

iPXE extends the capabilities of PXE in many ways, including:

  • iPXE clients can boot using HTTP, iSCSI, AoE, and FCoE

  • The boot process can be controlled using scripts

  • DNS lookup is available

  • Booting across wide area networks or the Internet is possible

The gpxelinux.0 boot loader provides some iPXE features, such as DNS lookup and HTTP file transfer, and is available in the syslinux package. It does not support iPXE commands or scripts.

You can use gpxelinux.0 with BIOS-based PXE clients and with UEFI-based PXE clients in legacy mode but not in UEFI mode.

To configure the DHCP service to support iPXE clients:

  1. Edit /etc/dhcp/dhcpd.conf:

    1. Add the following lines to define the iPXE options for DHCP:

      option space ipxe;
      option ipxe-encap-opts code 175 = encapsulate ipxe;
      option ipxe.priority code 1 = signed integer 8;
      option ipxe.keep-san code 8 = unsigned integer 8;
      option ipxe.skip-san-boot code 9 = unsigned integer 8;
      option ipxe.syslogs code 85 = string;
      option ipxe.cert code 91 = string;
      option ipxe.privkey code 92 = string;
      option ipxe.crosscert code 93 = string;
      option ipxe.no-pxedhcp code 176 = unsigned integer 8;
      option ipxe.bus-id code 177 = string;
      option ipxe.bios-drive code 189 = unsigned integer 8;
      option ipxe.username code 190 = string;
      option ipxe.password code 191 = string;
      option ipxe.reverse-username code 192 = string;
      option ipxe.reverse-password code 193 = string;
      option ipxe.version code 235 = string;
      option iscsi-initiator-iqn code 203 = string;
      option ipxe.pxeext code 16 = unsigned integer 8;
      option ipxe.iscsi code 17 = unsigned integer 8;
      option ipxe.aoe code 18 = unsigned integer 8;
      option ipxe.http code 19 = unsigned integer 8;
      option ipxe.https code 20 = unsigned integer 8;
      option ipxe.tftp code 21 = unsigned integer 8;
      option ipxe.ftp code 22 = unsigned integer 8;
      option ipxe.dns code 23 = unsigned integer 8;
      option ipxe.bzimage code 24 = unsigned integer 8;
      option ipxe.multiboot code 25 = unsigned integer 8;
      option ipxe.slam code 26 = unsigned integer 8;
      option ipxe.srp code 27 = unsigned integer 8;
      option ipxe.nbi code 32 = unsigned integer 8;
      option ipxe.pxe code 33 = unsigned integer 8;
      option ipxe.elf code 34 = unsigned integer 8;
      option ipxe.comboot code 35 = unsigned integer 8;
      option ipxe.efi code 36 = unsigned integer 8;
      option ipxe.fcoe code 37 = unsigned integer 8;
      option ipxe.vlan code 38 = unsigned integer 8;
      option ipxe.menu code 39 = unsigned integer 8;
      option ipxe.sdi code 40 = unsigned integer 8;
      option ipxe.nfs code 41 = unsigned integer 8;
    2. If you do not use a proxy DHCP server, specify the following line to speed up negotiation with the DHCP server:

      option ipxe.no-pxedhcp 1;
    3. Add the following line to define the user-class option:

      option user-class code 77 = string;
    4. Configure the DHCP server to provide the IP addresses of name servers that iPXE clients can use to resolve domain names to IP addresses, for example:

      option domain-name-servers 10.0.0.1, 10.0.0.4, 10.0.0.8;
    5. Configure DHCP to specify the gpxelinux.0 boot loader for non-iPXE clients and the URI of a boot script for iPXE clients, for example:

      if exists user-class and option user-class = "iPXE" {
            filename "http://web.mydom.com/pxeboot.php";
        } else {
            filename "gpxelinux.0";
        }

      In this example, pure iPXE clients run the HTTP-served boot script pxeboot.php.

      The following is an example of a boot script for an iPXE client:

      #!ipxe
      
      dhcp
      kernel http://web.mydom.com/OSimage/OL6.6/isolinux/vmlinuz
      initrd http://web.mydom.com/OSimage/OL6.6/isolinux/initrd.img
      boot vmlinuz initrd=initrd.img ksdevice=eth0 kssendmac \
       ks=http://web.mydom.com/ksfiles/ol6u6_cfg.ks

      dhcp configures the client's network interfaces.

      kernel downloads the installation kernel.

      initrd downloads the initial ram-disk image file.

      boot boots the downloaded installation kernel. Boot line parameters, such as the name of the initial ram-disk file and the location of the Kickstart file, are specified as additional arguments. Do not use the \ line-continuation character. This character is used in the example to denote that the line has been broken for printing. The boot command and all of its arguments must be on the same line.

      For more information, see http://ipxe.org/scripting and http://ipxe.org/cmd.

      Non-iPXE clients boot using gpelinux.0. A configuration file for gpxelinux.0 is named in the same way as for pxelinux.0 as described in Section 1.4.9, “About Boot-Loader Configuration Files”. Unlike pxelinux.0, you can use HTTP to access the installation kernel and initial ram-disk image files.

      The following is an example of a configuration file for gpxelinux.0:

      prompt 0
      default ol6u6
      timeout 0
      
      label ol6u6
      kernel http://websvr.mydom.com/OSimage/OL6.6/isolinux/vmlinuz
      append initrd=http://websvr.mydom.com/OSimage/OL6.6/isolinux/initrd.img \
       ksdevice=eth0 kssendmac ks=http://web.mydom.com/ksfiles/ol6u6_cfg.ks

      Do not use the \ line-continuation character. This character is used in the example to denote that the line has been broken for printing. The append keyword and all of its arguments must be on the same line.

  2. Restart the DHCP service:

    # service dhcpd restart

    If you make any changes to /etc/dhcp/dhcpd.conf, restart the dhcpd service. You do not need to restart the service if you change the content of the boot loader configuration files.