Thursday, March 6, 2014

Setting up an DHCP server - network boot part three

You can use any dhcp server to get pxe booting to run. We are using isc-dhcp-server, which is part of debian. Dnsmasq, which also is a dns server, would be an alternative.

So let's install the server
# apt-get install isc-dhcp-server

It's configuration file is  /etc/dhcp/dhcpd.conf.
default-lease-time 600;
max-lease-time 7200;
allow booting;

# in this example, we serve DHCP requests from 192.168.0.(5 to 253)
# and we have a router at 192.168.0.1
subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.5 192.168.0.253;
  option broadcast-address 192.168.0.255;
  option routers 192.168.0.1;             
  option domain-name-servers 192.168.0.1; 
  filename "pxelinux.0"; 
  next-server 192.168.0.3;  #make sure, that this is the ip address of 
                            # your tftp server
}

After you have configured your dhcp server, you need to restart it.

  # /etc/init.d/isc-dhcp-server restart

Now we are ready for booting any machine over the network. We set up a TFTP server, an NFS server and a DHCP server. That's all it takes.

By the way I usually use VirtualBox to try and test network booting.

Further reading:
http://www.debian-administration.org/articles/478
https://help.ubuntu.com/community/PXEInstallMultiDistro
https://help.ubuntu.com/community/DisklessUbuntuHowto

No comments:

Post a Comment