User Tools

Site Tools


indexes:setup_a_simple_pxe_server_for_install_or_rescue

The "pixie" Server

This is a short description on howto setup a PXE server. I don't go into much detail, just setting up the framework that will make it work.

Having a pixie at the network is very convenient for quick rescue or install. Expanding its functionality and you can set it up to host diskless workstations as well but that's an other howto.

Software

Install the needing software components:

sudo apt-get install tftpd-hpa dhcp3-server openbsd-inetd

Inetd daemon

sudo vi /etc/inetd.conf Make it read like this:

tftp           dgram   udp     wait    root  /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /tftpboot

Start the inetd server:

sudo invoke-rc.d openbsd-inetd start

tftpd Server

Now configure the tftp server:

sudo vi /etc/default/tftpd-hpa

And make it look like this:

RUN_DAEMON="no"
OPTIONS="-l -s /tftpboot"

Now make the storage directory and set some permissions on it:

sudo mkdir /tftpboot
sudo chown nobody /tftpboot
sudo chmod 777 /tftpboot

Here is a pxe boot environment that will install Lucid Lynx server (works with the Soekris platform): tftpboot.tar.gz

DHCP Server

Lets move on to the DHCP server configuration. Start out by defining an interface to listen on:

sudo vi /etc/default/dhcp3-server

Set the statement INTERFACE to the appropriate value. This example will make it listen on eth0 and eth2:

INTERFACES="eth0 eth2"

Please make sure no other DHCP server is listening on the same network segment, otherwise we might cause network problems or the PXE will not work.

For best practice make a backup of the configuration:

sudo cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf_orig 

Make the file dhcpd.conf look something like this:

subnet 1.1.1.0 netmask 255.255.255.0 {
range 1.1.1.100 1.1.1.200;
option domain-name-servers 10.10.10.10;
option domain-name "fighterware.dk";
option routers 1.1.1.1;
option broadcast-address 1.1.1.255;
default-lease-time 600;
max-lease-time 7200;
filename "pxelinux.0";
next-server 1.1.1.10;
}

Make sure the ip addresses match your network. The example set a range of ip addresses of 1.1.1.100-1.1.1.200, a default gateway of 1.1.1.1 and a dns server of 10.10.10.10. All these must match otherwise it will not work. Also the “next-server” statement is only necessary if the tftp server isn't the DHCP server.

Bounce the DHCP server to read the new configuration:

sudo invoke-rc.d dhcp3-server restart

Boot files

Download the ISO of the distribution you would like to serve. I choose a Ubuntu Server (as of this writing I've use Lucid Lynx Alpha 3).

sudo mkdir /media/iso
sudo mount -o loop lucid-server-i386.iso /media/iso
sudo cp -a /media/iso/install/netboot/* /tftpboot/ 
sudo umount /media/iso
sudo rm -f /media/iso

You can do a lot of tweaking with the booting environment and have different distributions served or using fancy homemade background pictures and such. For at good example take a look at: http://www.howtoforge.com/ubuntu_pxe_install_server

Booting...

Now take some hardware and make it PXE boot.

Remember that we only have the boot environment on our PXE server. Most of the content is downloaded from the internet during install/rescue. This can of course be time consuming if you don't have the appropriate bandwidth.


Source: http://www.howtoforge.com/setting-up-a-pxe-install-server-on-ubuntu-9.10-p3

indexes/setup_a_simple_pxe_server_for_install_or_rescue.txt · Last modified: d/m/Y H:i by domingo