Configuring dhcp services on a FOG server

fogDHCP (Dynamic Host Configuration Protocol) services provide client machines with dynamic IP address details.  This article shows you how to configure this service on a FOG server.


Configure dhcp

  • You need to edit the dhcpd.conf file to configure the DHCP service.  It's good practice to backup the configuration file before you make any changes.
sudo cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcp.conf.bak
sudo vi /etc/dhcp/dhcpd.conf

 

Here is an example dhcp.conf file that is automatically created by FOG.

# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcp.conf.sample
# This file was created by FOG
use-host-decl-names on;
ddns-update-style interim;
ignore client-updates;
next-server 192.168.0.61;

subnet 192.168.0.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
range dynamic-bootp 192.168.0.100 192.168.0.200;
default-lease-time 21600;
max-lease-time 43200;
option domain-name-servers 192.168.0.1;
option routers 192.168.0.1;
filename "undionly.kpxe";
}

 

To change DHCP scope, edit the following line:

range dynamic-bootp 192.168.0.50 192.168.0.99;

 

 To add multiple DNS servers change the following:

name-servers 192.168.0.1, 192.168.0.2;

 

To add a reservation add the following lines...

host hostname{
hardware ethernet A1:B2:C3:D4:E5:F6;
fixed-address 192.168.1.59;
}

Save your changes.

 

Restart dhcp-server

Finally you need to restart the dhcp daemon for your changes to be active.

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

 

Configure the NIC

Note that on early versions of FOG, by default the dhcpd would listen on eth0.  This is not an issue for FOG 1.2.0.

Edit /etc/default/dhcp3-server to change the NIC

sudo vi /etc/default/dhcp3-server
Change the following line if you need to...
INTERFACES="eth0"

 

 

Thanks for visiting.