(→Internet Systems Consortium (ISC) dhcp) |
(→Configuring DHCP) |
||
(8 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | == Internet Systems Consortium (ISC) | + | == Internet Systems Consortium (ISC) DHCP == |
+ | |||
+ | [http://www.isc.org/downloads/DHCP/ Internet Systems Consortium (ISC) DHCP] offers both an IPv4 and IPv6 DHCP (Dynamic Host Configuration Protocol) Client and Server. | ||
+ | |||
+ | The DHCP source includes a copy of [http://www.isc.org/downloads/BIND/ ISC Bind] and will build the BIND Export Libraries required for DHCP. Cross Compiling the BIND libraries are problematic for two reasons. First, the host and target parameters are not passed to Bind's Configure. Secondly, once BIND has been configured for cross compiling, there is an executable (gen) that is cross-compiled, but executed on the build machine. | ||
+ | |||
+ | To overcome these two issues, two patch files have been created. | ||
+ | |||
+ | To build ISC DHCP, download the source and the patches: | ||
<PRE> | <PRE> | ||
Line 7: | Line 15: | ||
wget http://wiki.beyondlogic.org/patches/bind-9.9.5rc1.gen_crosscompile.patch | wget http://wiki.beyondlogic.org/patches/bind-9.9.5rc1.gen_crosscompile.patch | ||
tar -xzf dhcp-4.3.0b1.tar.gz | tar -xzf dhcp-4.3.0b1.tar.gz | ||
+ | </PRE> | ||
+ | |||
+ | Now we patch the makefile that is responsible for building BIND. The [http://wiki.beyondlogic.org/patches/dhcp-4.3.0b1.bind_arm-linux-gnueabi.patch patch] adds the --host=arm-linux-gnueabi --target=arm-linux-gnueabi --build=i686-pc-linux-gnu parameters to configure, and specifically tells it to use /dev/random: | ||
+ | |||
+ | <PRE> | ||
cd dhcp-4.3.0b1 | cd dhcp-4.3.0b1 | ||
patch -p1 < ../dhcp-4.3.0b1.bind_arm-linux-gnueabi.patch | patch -p1 < ../dhcp-4.3.0b1.bind_arm-linux-gnueabi.patch | ||
+ | </PRE> | ||
+ | |||
+ | Next we need to [http://wiki.beyondlogic.org/patches/bind-9.9.5rc1.gen_crosscompile.patch correct] the makefile responsible for compiling gen.c. As the BIND source has not yet been uncompressed, we must first extract it prior to patching: | ||
+ | |||
+ | <PRE> | ||
+ | cd bind | ||
tar -xzf bind.tar.gz | tar -xzf bind.tar.gz | ||
cd bind-9.9.5rc1 | cd bind-9.9.5rc1 | ||
− | + | patch -p1 < ../../../bind-9.9.5rc1.gen_crosscompile.patch | |
cd ../.. | cd ../.. | ||
+ | </PRE> | ||
+ | |||
+ | Now we should be all set to configure and cross-compile DHCP: | ||
+ | |||
+ | <PRE> | ||
./configure --host=arm-linux-gnueabi --prefix= --build=i686-pc-linux-gnu ac_cv_file__dev_random=yes | ./configure --host=arm-linux-gnueabi --prefix= --build=i686-pc-linux-gnu ac_cv_file__dev_random=yes | ||
make | make | ||
make install DESTDIR=/home/export/rootfs | make install DESTDIR=/home/export/rootfs | ||
</PRE> | </PRE> | ||
+ | |||
+ | == Configuring DHCP == | ||
+ | |||
+ | During install, two sample configuration files will be placed in /etc. | ||
+ | |||
+ | If running DHCPd, it may complain it is unable to open the leases database: | ||
+ | |||
+ | <PRE> | ||
+ | Can't open lease database /var/db/dhcpd.leases: No such file or directory -- | ||
+ | check for failed database rewrite attempt! | ||
+ | </PRE> | ||
+ | |||
+ | If so, create a blank lease file: | ||
+ | |||
+ | <PRE> | ||
+ | touch /var/db/dhcpd.leases | ||
+ | </PRE> | ||
+ | |||
+ | Once your configuration file is ready to go, you can start an IPv4 DHCP server by: | ||
+ | |||
+ | <PRE> | ||
+ | # /sbin/dhcpd -cf /etc/dhcpd.conf | ||
+ | Internet Systems Consortium DHCP Server 4.3.0b1 | ||
+ | Copyright 2004-2014 Internet Systems Consortium. | ||
+ | All rights reserved. | ||
+ | For info, please visit https://www.isc.org/software/dhcp/ | ||
+ | Wrote 0 deleted host decls to leases file. | ||
+ | Wrote 0 new dynamic host decls to leases file. | ||
+ | Wrote 0 leases to leases file. | ||
+ | Listening on LPF/eth0/00:10:75:2a:71:cc/192.168.0.0/24 | ||
+ | Sending on LPF/eth0/00:10:75:2a:71:cc/192.168.0.0/24 | ||
+ | Sending on Socket/fallback/fallback-net | ||
+ | </PRE> | ||
+ | |||
+ | If you get a message: | ||
+ | |||
+ | <PRE> | ||
+ | irs_resconf_load failed: 30. | ||
+ | </PRE> | ||
+ | |||
+ | Check your /etc/resolv.conf file exists. | ||
+ | |||
+ | == Download pre-built binaries == | ||
+ | |||
+ | The link below contains a bzip2 tarball of ISC dhcp compiled for ARM: | ||
+ | |||
+ | * [http://wiki.beyondlogic.org/prebuilt/dhcp-4.3.0b1-arm-linux-gnueabi.tar.bz2 dhcp-4.3.0b1-arm-linux-gnueabi.tar.bz2] | ||
+ | * Built using : | ||
+ | ** arm-linux-gnueabi-gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-12ubuntu1) |
Internet Systems Consortium (ISC) DHCP offers both an IPv4 and IPv6 DHCP (Dynamic Host Configuration Protocol) Client and Server.
The DHCP source includes a copy of ISC Bind and will build the BIND Export Libraries required for DHCP. Cross Compiling the BIND libraries are problematic for two reasons. First, the host and target parameters are not passed to Bind's Configure. Secondly, once BIND has been configured for cross compiling, there is an executable (gen) that is cross-compiled, but executed on the build machine.
To overcome these two issues, two patch files have been created.
To build ISC DHCP, download the source and the patches:
wget ftp://ftp.isc.org/isc/dhcp/4.3.0b1/dhcp-4.3.0b1.tar.gz wget http://wiki.beyondlogic.org/patches/dhcp-4.3.0b1.bind_arm-linux-gnueabi.patch wget http://wiki.beyondlogic.org/patches/bind-9.9.5rc1.gen_crosscompile.patch tar -xzf dhcp-4.3.0b1.tar.gz
Now we patch the makefile that is responsible for building BIND. The patch adds the --host=arm-linux-gnueabi --target=arm-linux-gnueabi --build=i686-pc-linux-gnu parameters to configure, and specifically tells it to use /dev/random:
cd dhcp-4.3.0b1 patch -p1 < ../dhcp-4.3.0b1.bind_arm-linux-gnueabi.patch
Next we need to correct the makefile responsible for compiling gen.c. As the BIND source has not yet been uncompressed, we must first extract it prior to patching:
cd bind tar -xzf bind.tar.gz cd bind-9.9.5rc1 patch -p1 < ../../../bind-9.9.5rc1.gen_crosscompile.patch cd ../..
Now we should be all set to configure and cross-compile DHCP:
./configure --host=arm-linux-gnueabi --prefix= --build=i686-pc-linux-gnu ac_cv_file__dev_random=yes make make install DESTDIR=/home/export/rootfs
During install, two sample configuration files will be placed in /etc.
If running DHCPd, it may complain it is unable to open the leases database:
Can't open lease database /var/db/dhcpd.leases: No such file or directory -- check for failed database rewrite attempt!
If so, create a blank lease file:
touch /var/db/dhcpd.leases
Once your configuration file is ready to go, you can start an IPv4 DHCP server by:
# /sbin/dhcpd -cf /etc/dhcpd.conf Internet Systems Consortium DHCP Server 4.3.0b1 Copyright 2004-2014 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Wrote 0 deleted host decls to leases file. Wrote 0 new dynamic host decls to leases file. Wrote 0 leases to leases file. Listening on LPF/eth0/00:10:75:2a:71:cc/192.168.0.0/24 Sending on LPF/eth0/00:10:75:2a:71:cc/192.168.0.0/24 Sending on Socket/fallback/fallback-net
If you get a message:
irs_resconf_load failed: 30.
Check your /etc/resolv.conf file exists.
The link below contains a bzip2 tarball of ISC dhcp compiled for ARM: