dhcp-helper is a simple, straightforward DHCP and BOOTP relay agent which was written by Simon Kelley as alternative to the ISC relay. It's Linux only, but doesn't require any kernel support other than the network stack. (No LPF or packet sockets). It listens for DHCP and BOOTP broadcasts on directly connected subnets and relays them to DHCP or BOOTP servers elsewhere. It also relays replies from the remote servers back to partially configured hosts. Once hosts are fully configured they can communicate directly with their servers and no longer need the services of a relay.
This post will cover the installation and setup of dhcp-helper in Ubuntu. This package has been ported to some other distros as well, so feel free to try it in whatever your distribution is ;).
For installing dhcp-helper in Ubuntu the following command should be executed:
$ sudo apt-get install dhcp-helper
The service starts on installation automatically, listening on interface eth0. You’ll want to configure it in the file /etc/default/dhcp-helper .
The only required option is at least one DHCP server to relay to. The simplest way to configure dhcp-helper on a router is just to give the interface to the network containing the DHCP server with a -b option. All the other interfaces present on the machine will then accept DHCP requests. On a machine which does not have an interface on the network containing the DHCP server, use a -s option instead.
The following options can be used on the dchp-helper configuration file to suit every environment:
Specify a DHCP or BOOTP server to relay to. The server may be
given as a machine name or dotted-quad IP address. More than one
server may be specified.
Relay to a DHCP or BOOTP server using broadcast via
This eliminates the need to give a server address.
is automatically added to the list of interfaces which will not
receive DHCP requests.
Specify which local interfaces to listen on for DHCP/BOOTP
broadcasts. If no -i flags are given all interfaces are used
except those specified by -e flags and those specified by -b
Specify which local interfaces to exclude.
Use alternative ports (1067/1068) for the DHCP client and
Report the software release version and copyright information.
Debug mode, do not change UID, write a pid-file or go into the
Specify an alternate path for dhcp-helper to record its process-
id in. Normally /var/run/dhcp-helper.pid.
Specify the userid to which dhcp-helper will change after
startup. The daemon must normally be started as root, but it
will drop root priviledges after startup by changing id to
another user. Normally this user is "nobody" but that can be
over-ridden with this switch.
For an scenario like this:
An example of the content of an /etc/default/dhcp-helper config file could be:
# Option flags used to start dhcp-helper.
# You will need at least "-s
# to relay DHCP requests.
# See "man 8 dhcp-helper" for more details.
DHCPHELPER_OPTS="-b eth1 -e eth0"