This section covers the configuration tasks needed in complex boot scenarios. It contains ready-to-apply configuration examples for DHCP, PXE boot, TFTP, and Wake on LAN.
A DHCP server on openSUSE is set up by manually editing the appropriate configuration files. This section covers extending an existing DHCP server configuration to provide the data needed to serve in a TFTP, PXE, and WOL environment.
All the DHCP server needs to do, apart from providing automatic address allocation to your network clients, is to announce the IP address of the TFTP server and the file that should be pulled in by the installation routines on the target machine.
Log in as root to the machine hosting the DHCP server.
Append the following lines to your DHCP server's configuration file located under /etc/dhcpd.conf:
group {
# PXE related stuff
#
# "next server" defines the tftp server that will be used
next server ip_tftp_server:
#
# "filename" specifies the pxelinux image on the tftp server
# the server runs in chroot under /srv/tftpboot
filename "pxelinux.0";
}
Replace ip_of_the_tftp_server with the actual IP address of the TFTP server. For more information about the options available in dhcpd.conf, refer to the dhcpd.conf manual page.
Restart the DHCP server by executing rcdhcpd restart.
If you plan on using SSH for the remote control of a PXE and Wake on LAN installation, explicitly specify the IP address DHCP should provide to the installation target. To achieve this, modify the above-mentioned DHCP configuration according to the following example:
group { # PXE related stuff # # "next server" defines the tftp server that will be used next server ip_tftp_server: # # "filename" specifies the pxelinux image on the tftp server # the server runs in chroot under /srv/tftpboot filename "pxelinux.0"; host test { hardware ethernet mac_address; fixed-address some_ip_address; } }
The host statement introduces the hostname of the installation target. To bind the hostname and IP address to a specific host, you must know and specify the system's hardware (MAC) address. Replace all the variables used in this example with the actual values that match your environment.
After restarting the DHCP server, it provides a static IP to the host specified, enabling you to connect to the system via SSH.
Set up a TFTP server with YaST or set it up manually on any other Linux operating system that supports xinetd and tftp. The TFTP server delivers the boot image to the target system once it boots and sends a request for it.
Log in as root.
Install the yast2-tftp-server package.
Start
and install the requested package.Click
to make sure that the server is started and included in the boot routines. No further action from your side is required to secure this. xinetd starts tftpd at boot time.Click
to open the appropriate port in the firewall running on your machine. If there is no firewall running on your server, this option is not available.Click /tftpboot is created and selected automatically.
to browse for the boot image directory. The default directoryClick
to apply your settings and start the server.Log in as root and install the packages tftp and xinetd.
If unavailable, create /srv/tftpboot and /srv/tftpboot/pxelinux.cfg directories.
Add the appropriate files needed for the boot image as described in Section 1.3.3, Using PXE Boot.
Modify the configuration of xinetd located under /etc/xinetd.d/ to make sure that the TFTP server is started on boot:
If it does not exist, create a file called tftp under this directory with touch tftp. Then run chmod 755 tftp.
Open the file tftp and add the following lines:
service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /srv/tftpboot disable = no }
Save the file and restart xinetd with rcxinetd restart.
Some technical background information as well as PXE's complete specifications are available in the Preboot Execution Environment (PXE) Specification (http://www.pix.net/software/pxeboot/archive/pxespec.pdf).
Change to the directory of your installation repository and copy the linux, initrd, message, and memtest files to the /srv/tftpboot directory by entering the following:
cp -a boot/loader/linux boot/loader/initrd boot/loader/message boot/loader/memtest /srv/tftpboot
Install the syslinux package directly from your installation CDs or DVDs with YaST.
Copy the /usr/share/syslinux/pxelinux.0 file to the /srv/tftpboot directory by entering the following:
cp -a /usr/share/syslinux/pxelinux.0 /srv/tftpboot
Change to the directory of your installation repository and copy the isolinux.cfg file to /srv/tftpboot/pxelinux.cfg/default by entering the following:
cp -a boot/loader/isolinux.cfg /srv/tftpboot/pxelinux.cfg/default
Edit the /srv/tftpboot/pxelinux.cfg/default file and remove the lines beginning with gfxboot, readinfo, and framebuffer.
Insert the following entries in the append lines of the default failsafe and apic labels:
By means of this entry, enter the network kernel module needed to support network installation on the PXE client. Replace kernel module with the appropriate module name for your network device.
This entry defines the client's network interface that must be used for the network installation. It is only necessary if the client is equipped with several network cards and must be adapted accordingly. In case of a single network card, this entry can be omitted.
This entry defines the NFS server and the installation source for the client installation. Replace ip_instserver with the actual IP address of your installation server. path_instsource should be replaced with the actual path to the installation sources. HTTP, FTP, or SMB sources are addressed in a similar manner, except for the protocol prefix, which should read http, ftp, or smb.
IMPORTANT:If you need to pass other boot options to the installation routines, such as SSH or VNC boot parameters, append them to the install entry. An overview of parameters and some examples are given in Section 1.4, Booting the Target System for Installation.
An example /srv/tftpboot/pxelinux.cfg/default file follows. Adjust the protocol prefix for the installation source to match your network setup and specify your preferred method of connecting to the installer by adding the vnc and vncpassword or the usessh and sshpassword options to the install entry. The lines separated by \ must be entered as one continuous line without a line break and without the \.
default linux # default label linux kernel linux append initrd=initrd ramdisk_size=65536 insmod=e100 \ install=nfs://ip_instserver/path_instsource/product/CD1 # failsafe label failsafe kernel linux append initrd=initrd ramdisk_size=65536 ide=nodma apm=off acpi=off \ insmod=e100 install=nfs://ip_instserver/path_instsource/product/CD1 # apic label apic kernel linux append initrd=initrd ramdisk_size=65536 apic insmod=e100 \ install=nfs://ip_instserver/path_instsource/product/CD1 # manual label manual kernel linux append initrd=initrd ramdisk_size=65536 manual=1 # rescue label rescue kernel linux append initrd=initrd ramdisk_size=65536 rescue=1 # memory test label memtest kernel memtest # hard disk label harddisk localboot 0 implicit 0 display message prompt 1 timeout 100
Replace ip_instserver and path_instsource with the values used in your setup.
The following section serves as a short reference to the PXELINUX options used in this setup. Find more information about the options available in the documentation of the syslinux package located under /usr/share/doc/packages/syslinux/.
The options listed here are a subset of all the options available for the PXELINUX configuration file.
Sets the default kernel command line. If PXELINUX boots automatically, it acts as if the entries after DEFAULT had been typed in at the boot prompt, except the auto option is automatically added, indicating an automatic boot.
If no configuration file is present or no DEFAULT entry is
present in the configuration file, the default is the kernel name
linux
with no options.
Add one or more options to the kernel command line. These are added for both automatic and manual boots. The options are added at the very beginning of the kernel command line, usually permitting explicitly entered kernel options to override them.
Indicates that if label is entered as the kernel to boot, PXELINUX should instead boot image and the specified APPEND options should be used instead of the ones specified in the global section of the file (before the first LABEL command). The default for image is the same as label and, if no APPEND is given, the default is to use the global entry (if any). Up to 128 LABEL entries are permitted.
Note that GRUB uses the following syntax:
title mytitle kernel my_kernel my_kernel_options initrd myinitrd
PXELINUX uses the following syntax:
label mylabel kernel mykernel append myoptions
Labels are mangled as if they were filenames and they must
be unique after mangling. For example, the two labels
v2.1.30
and v2.1.31
would not be
distinguishable under PXELINUX because both mangle to the same
DOS filename.
The kernel does not have to be a Linux kernel; it can be a boot sector or a COMBOOT file.
Append nothing. APPEND with a single hyphen as argument in a LABEL section can be used to override a global APPEND.
On PXELINUX, specifying LOCALBOOT 0 instead of a KERNEL option means invoking this particular label and causes a local disk boot instead of a kernel boot.
All other values are undefined. If you do not know what the UNDI or PXE stacks are, specify 0.
Indicates how long to wait at the boot prompt until booting automatically, in units of 1/10 second. The time-out is canceled as soon as the user types anything on the keyboard, assuming the user will complete the command begun. A time-out of zero disables the time-out completely (this is also the default). The maximum possible time-out value is 35996 (just less than one hour).
If flag_val is 0, displays the boot prompt only if Shift or Alt is pressed or Caps Lock or Scroll Lock is set (this is the default). If flag_val is 1, always displays the boot prompt.
F2 filename F1 filename ..etc... F9 filename F10 filename
Displays the indicated file on the screen when a function key is pressed at the boot prompt. This can be used to implement preboot online help (presumably for the kernel command line options). For backward compatibility with earlier releases, F10 can be also entered as F0. Note that there is currently no way to bind filenames to F11 and F12.
Prepare the system's BIOS for PXE boot by including the PXE option in the BIOS boot order.
WARNING: BIOS Boot Order
Do not place the PXE option ahead of the hard disk boot option in the BIOS. Otherwise this system would try to reinstall itself every time you boot it.
Wake on LAN (WOL) requires the appropriate BIOS option to be enabled prior to the installation. Also, note down the MAC address of the target system. This data is needed to initiate Wake on LAN.
Wake on LAN allows a machine to be turned on by a special network packet containing the machine's MAC address. Because every machine in the world has a unique MAC identifier, you do not need to worry about accidentally turning on the wrong machine.
IMPORTANT: Wake on LAN across Different Network Segments
If the controlling machine is not located in the same network segment as the installation target that should be awakened, either configure the WOL requests to be sent as multicasts or remotely control a machine on that network segment to act as the sender of these requests.
Log in as root.
Start netdiag.
and install the packageOpen a terminal and enter the following command as root to wake the target:
ether-wake mac_of_target
Replace mac_of_target with the actual MAC address of the target.