Network boot

https://www.debian.org/releases/etch/i386/ch04s06.html.en

In order to boot from network, it is necessary to use two services: DHCP and TFTP.

  • DHCP will be used to configure the clients. After the computer booted, the network card will search for information about how to boot and the DHCP server should be capable to provide the correct information
  • TFTP is a simple protocol to transfer files trough the network. This service is used to load the required files to boot the operating system from the network.

TFTP Server

http://askubuntu.com/questions/201505/how-do-i-install-and-run-a-tftp-server

  1. Install following packages:

    sudo apt-get install xinetd tftpd tftp
    
  2. Create /etc/xinetd.d/tftp and put this entry:

    service tftp
    {
        protocol        = udp
        port            = 69
        socket_type     = dgram
        wait            = yes
        user            = nobody
        server          = /usr/sbin/in.tftpd
        server_args     = /tftpboot
        disable         = no
    }
    
  3. Create a folder /tftpboot this should match whatever you gave in server_args, mostly it will be tftpboot

    sudo mkdir /tftpboot
    sudo chmod -R 777 /tftpboot
    sudo chown -R nobody /tftpboot
    
  4. Restart the xinetd service:

    sudo service xinetd restart
    

    or in older systems:

    sudo /etc/init.d/xinetd restart
    

Now our TFTP server is up and running.

Testing our tftp server

  1. Create a file named test with some content in /tftpboot path of the tftp server.
    Obtain the IP address of the TFTP server using ifconfig command.

  2. Now in some other system follow the following steps.

    tftp 192.168.1.2
    tftp> get test
    Sent 159 bytes in 0.0 seconds
    
    tftp> quit
    
    cat test
    

inetd alternative

It is also possible configure TFTP using inetd.

You have to install:

  • inetutils-ftpd - File Transfer Protocol server
  • inetutils-inetd - internet super server

And then configure the configuration file /etc/inetd.conf with:

#:BOOT: TFTP service is provided primarily for booting.  Most sites
#       run this only on machines acting as "boot servers."
tftp            dgram   udp     wait    nobody  /usr/sbin/tcpd  /usr/sbin/in.tftpd /tftpboot

DHCP Server

Install DHCP server:

sudo apt-get install isc-dhcp-server

Restart the server:

sudo service isc-dhcp-server restart