User Tools

Site Tools


howtos:setup_a_simple_pxe_server_for_install_or_rescue

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

howtos:setup_a_simple_pxe_server_for_install_or_rescue [d/m/Y H:i] (current)
Line 1: Line 1:
 +====== 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:
 +<​code>​
 +sudo apt-get install tftpd-hpa dhcp3-server openbsd-inetd
 +</​code>​
 +
 +===== Inetd daemon =====
 +
 +sudo vi /​etc/​inetd.conf
 +Make it read like this:
 +<​file>​
 +tftp           ​dgram ​  ​udp ​    ​wait ​   root  /​usr/​sbin/​in.tftpd /​usr/​sbin/​in.tftpd -s /tftpboot
 +</​file>​
 +
 +Start the inetd server:
 +
 +<​code>​
 +sudo invoke-rc.d openbsd-inetd start
 +</​code>​
 +
 +===== tftpd Server =====
 +
 +Now configure the tftp server:
 +<​code>​
 +sudo vi /​etc/​default/​tftpd-hpa
 +</​code>​
 +
 +And make it look like this:
 +<​file>​
 +RUN_DAEMON="​no"​
 +OPTIONS="​-l -s /​tftpboot"​
 +</​file>​
 +
 +Now make the storage directory and set some permissions on it:
 +<​code>​
 +sudo mkdir /tftpboot
 +sudo chown nobody /tftpboot
 +sudo chmod 777 /tftpboot
 +</​code>​
 +
 +Here is a pxe boot environment that will install Lucid Lynx server (works with the Soekris platform): {{:​howtos:​tftpboot.tar.gz|}}
 +
 +===== DHCP Server =====
 +
 +Lets move on to the DHCP server configuration. Start out by defining an interface to listen on:
 +<​code>​
 +sudo vi /​etc/​default/​dhcp3-server
 +</​code>​
 +
 +Set the statement INTERFACE to the appropriate value. This example will make it listen on eth0 and eth2:
 +<​file>​
 +INTERFACES="​eth0 eth2"
 +</​file>​
 +
 +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:​
 +<​code>​
 +sudo cp /​etc/​dhcp3/​dhcpd.conf /​etc/​dhcp3/​dhcpd.conf_orig ​
 +</​code> ​
 +
 +Make the file dhcpd.conf look something like this:
 +<​file>​
 +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;
 +}
 +</​file>​
 +
 +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:​
 +<​code>​
 +sudo invoke-rc.d dhcp3-server restart
 +</​code>​
 +
 +===== 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).
 +
 +<​code>​
 +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
 +</​code>​
 +
 +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
howtos/setup_a_simple_pxe_server_for_install_or_rescue.txt · Last modified: d/m/Y H:i (external edit)