Chapter 3. PXE server

Table of Contents

3.1. Installing a PXEserver
3.2. Options in pxe.conf
3.2.1. Interface
3.2.2. Default_address
3.2.3. Multicast_address
3.2.4. Mtftp_address
3.2.5. Mtftp_client_port
3.2.6. Mtftp_server_port
3.2.7. Listen_port
3.2.8. Use_multicast
3.2.9. Use_broadcast
3.2.10. Prompt
3.2.11. Prompt_timeout
3.2.12. Service Min layer, Max layer
3.2.13. Domain
3.2.14. Sample pxe.conf
3.3. Running the server

3.1. Installing a PXEserver

You can get the rpm : pxe-1.2.0-2mdk and pxe-sample-1.2.0-2mdk on the Mandrake Linux cooker repositery [5] This rpm is based on pxe.1.2.tar.gz. found on : http://www.kano.org.uk/projects/pxe/.

3.2. Options in pxe.conf

File pxe.conf is read by the pxe server to get its informations. You can specify the config file to the pxe server with the -c option. The default pxe.conf is in /etc directory with the vanilla RPM.

3.2.1. Interface

Which interface the PXE server binds itself to. If no interface is specified, PXE server will bind itself to all interfaces.

3.2.2. Default_address

Address IP of the PXE server.

3.2.3. Multicast_address

The multicast ip address to listen to.

3.2.4. Mtftp_address

Address of the mftp server.

3.2.5. Mtftp_client_port

Port of the mftp client.

3.2.6. Mtftp_server_port

Port of the mftp server.

3.2.7. Listen_port

Which port the server listens to.

3.2.8. Use_multicast

Enable/disable multicast. Set value to 1 to enable it.

3.2.9. Use_broadcast

Enable/disable broadcast. Set value to 1 to enable it.

3.2.10. Prompt

Define how the user prompt will appear.

3.2.11. Prompt_timeout

Sets the timeout for the user to choose from the boot menu.

3.2.12. Service Min layer, Max layer

Syntax of the service option:

service=CSA,min layer,max layer,basename,menu entry

CSA : the Client System Architecture, typicaly X86PC or I64EFI. The min layers and max layers are the starting and finishing layers in the boot protocol, those are:

  • Layer 0: The bootstrap code
  • Layer 1: The kernel.
  • Layer 2: The initial RAM disk.(initrd)

So, if you just want to use the bootstrap, the service line should be :

service=X86PC,0,0,local,Local boot # When basename is set to local, layers will be ignored.

if you want : bootstrap + kernel, the service line should be :

service=X86PC,0,1,linux,install Mandrake Linux

if you want : bootstrap + kernel + initrd, the service line should be :

service=X86PC,0,2,linux, install Mandrake Linux

Files requested in this case are :

  • /tftpboot/X86PC/linux/linux.0 # the bootstrap
  • /tftpboot/X86PC/linux/linux.1 # the kernel image
  • /tftpboot/X86PC/linux/linux.2 # the initrd image

3.2.13. Domain

Domain name of the cluster.

3.2.14. Sample pxe.conf

Here is just an example of the pxe.conf :


interface=eth0
default_address=192.168.200.1
multicast_address=224.0.1.2
mtftp_address=192.168.200.1
mtftp_client_port=1758
mtftp_server_port=1759
listen_port=4011
use_multicast=1
use_broadcast=0
prompt=Press F8 to view menu ..
prompt_timeout=2
service=X86PC,0,0,local,Local boot
service=X86PC,0,2,linux,PXE Linux
service=IA64EFI,0,2,linux, Install IA64
service=IA32EFI,0,2,linux, Install IA32
tftpdbase=/
domain=cluster.com

                                

3.3. Running the server

Check you have those lines in /etc/services :

altserviceboot  4011/udp   #Alternate Service Boot
        

launch the server :

/etc/rc.d/init.d/pxe start

In the /etc/rc.d/init.d/pxe init script there are 2 lines that add a route to the broadcast address and a route to the multicast address.

route add -host 255.255.255.255 $INTERFACE

route add -net 224.0.0.0 netmask 224.0.0.0 $INTERFACE

where $INTERFACE is the name of the network interface used.

You can check if your server is runnning on port 4011 with :

netstat -na | grep 4011

That command should produce the following output :

        
udp        0      0 0.0.0.0:4011            0.0.0.0:*                           
udp        0      0 192.168.200.1:4011      0.0.0.0:*