Download the source archive from http://www.strongsec.com/freeswan/dhcprelay/ then unpack, configure, compile and install it:
bash# tar -xvzf dhcprelay-X.Y.tar.gz bash# cd dhcprelay-X.Y bash# ./configure bash# make bash# make install
--enable-debug
argument:
bash# ./configure --enable-debug bash# make bash# make install
/etc/init.d/dhcprelay
startup script as shown
in the following example:
bash# /etc/init.d/dhcprelay start Starting dhcprelay done bash# /etc/init.d/dhcprelay status Checking for service dhcprelay: running bash# /etc/init.d/dhcprelay stop Shutting down dhcprelay done
insserv
or chkconfig
tool:
bash# cd /etc/init.d/ bash# insserv dhcprelay
The DHCP-Server configuration file (/usr/local/etc/dhcprelay.conf
)
contains four items:
LOGFILE
sets the path to log-file of the relay.DEVICES
is a comma separated list of ipsec
devices the relay should listen on and must contain no spaces!SERVERDEVICE
the device over which the DHCP-Server
can be reached.DHCPSERVER
defines the host name or the IP address
of the responsible DHCP-Server. If no server is given, the
packets are forwarded by broadcast.# DHCP-Relay configuration file # Logfile LOGFILE="/var/log/dhcprelay.log" # IPSec devices (comma separated list including NO spaces) DEVICES="ipsec0" # The device over which the DHCP-Server can be reached SERVERDEVICE="eth1" # Hostname or IP Address of the DHCP-Server DHCPSERVER="192.168.0.10"
Since release 0.3.1 of the DHCP-Relay this can easily be done by binding both, the relay and the server to the loopback device. Therefore, set
SERVERDEVICE="lo"
lo
to the list
of target devices when starting the DHCP-Server. For example:
bash# dhcpd lo eth1
lo
device, which are not out of the dedicated subnet
(127.0.0.0/8). For the ISC DHCP-Server the subnet
setting
must therefore be set to any:
... subnet 0.0.0.0 netmask 0.0.0.0 { ... }