mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-02-03 06:27:16 +08:00
ISC DHCP 4.2.4-P1 with bootscript and network service updates. Merged dhcp client configuration into dhcp page.
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@10519 af4574ff-66df-0310-9fd7-8a98e5e911e0
This commit is contained in:
parent
17ef733fc9
commit
697cb83f98
@ -35,13 +35,13 @@
|
||||
<sect2 role="configuration">
|
||||
<title>Configuring DHCP Client</title>
|
||||
|
||||
<para id="dhclient-service">To configure <command>dhclient</command>,
|
||||
<para id="dhclient-service1010">To configure <command>dhclient</command>,
|
||||
you need to first install the network service script,
|
||||
<filename>/lib/services/dhclient</filename>
|
||||
included in the <xref linkend="bootscripts"/> package
|
||||
(as <systemitem class="username">root</systemitem>):</para>
|
||||
|
||||
<indexterm zone="dhcp-client dhclient-service">
|
||||
<indexterm zone="dhcp-client dhclient-service1010">
|
||||
<primary sortas="f-dhclient">dhclient (service script)</primary>
|
||||
</indexterm>
|
||||
|
@ -547,7 +547,7 @@ $Date$
|
||||
<!-- Chapter 14 -->
|
||||
<!ENTITY ppp-version "2.4.5">
|
||||
<!ENTITY dhcpcd-version "5.6.1">
|
||||
<!ENTITY dhcp-version "4.2.3-P2">
|
||||
<!ENTITY dhcp-version "4.2.4-P1">
|
||||
|
||||
<!-- Obsolete
|
||||
<!ENTITY wvdial-version "1.54.0">
|
||||
|
@ -54,6 +54,10 @@
|
||||
<para>[krejzi] - Changed Xorg Libraries and Xorg Fonts
|
||||
packages order in md5sum files.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>[krejzi] - Changed dhclient network script to be compatible
|
||||
with the latest book instructions.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>[krejzi] - Added mtdev 1.1.2, a required dependency
|
||||
of the Xorg Synaptics Driver.</para>
|
||||
@ -62,6 +66,10 @@
|
||||
<para>[krejzi] - Added patch for Iptables to fix
|
||||
compiling with Linux Kernel 3.5.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>[krejzi] - Merged dhcp client configuration into
|
||||
dhcp page.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>[krejzi] - Refreshed MesaLib xdemos patch so that it
|
||||
links against libglapi and made it not create DESTDIR/usr/bin
|
||||
@ -72,6 +80,10 @@
|
||||
and made it not exit 1 if saslauthd is not configured in order
|
||||
to prevent hang at boot.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>[krejzi] - Renamed dhcp bootscript to dhcpd and
|
||||
made it configurable through /etc/sysconfig/dhcpd.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>[krejzi] - Renamed kerberos bootscript to krb5 and
|
||||
made it start kpropd, too. </para>
|
||||
@ -82,6 +94,9 @@
|
||||
<listitem>
|
||||
<para>[krejzi] - Bumped bootscripts to 20120814.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>[krejzi] - DHCP 4.2.4-P1.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>[krejzi] - MIT Kerberos 1.10.3.</para>
|
||||
</listitem>
|
||||
|
@ -34,6 +34,5 @@ $Date$
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ppp.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dhcpcd.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dhcp.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dhcp-client.xml"/>
|
||||
|
||||
</chapter>
|
||||
|
@ -3,14 +3,13 @@
|
||||
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
||||
%general-entities;
|
||||
<!-- isc have a weird way of offering the tarballs and without dots in version!
|
||||
FIXME - change hardcoded 423s in http url and version in ftp when upgrading -->
|
||||
|
||||
<!ENTITY dhcp-download-http " ">
|
||||
<!ENTITY dhcp-download-ftp "ftp://ftp.isc.org/isc/dhcp/&dhcp-version;/dhcp-&dhcp-version;.tar.gz">
|
||||
<!ENTITY dhcp-md5sum "14f57fd580d01633d0fad4809007a801">
|
||||
<!ENTITY dhcp-size "9.1 MB">
|
||||
<!ENTITY dhcp-buildsize "192 MB (client and server), 140MB client only, 172MB server only">
|
||||
<!ENTITY dhcp-time "0.7 SBU (client and server, or server), 0.6 SBU client only ">
|
||||
<!ENTITY dhcp-download-ftp "ftp://ftp.isc.org/isc/dhcp/&dhcp-version;/dhcp-&dhcp-version;.tar.gz">
|
||||
<!ENTITY dhcp-md5sum "0ca7181024651f6323951d5498c8020b">
|
||||
<!ENTITY dhcp-size "7.9 MB">
|
||||
<!ENTITY dhcp-buildsize "150 MB">
|
||||
<!ENTITY dhcp-time "1.2 SBU">
|
||||
]>
|
||||
|
||||
<sect1 id="dhcp" xreflabel="DHCP-&dhcp-version;">
|
||||
@ -24,238 +23,361 @@
|
||||
<title>DHCP-&dhcp-version;</title>
|
||||
|
||||
<indexterm zone="dhcp">
|
||||
<primary sortas="a-dhcp">Dhcp</primary>
|
||||
<primary sortas="a-DHCP">DHCP</primary>
|
||||
</indexterm>
|
||||
|
||||
<sect2 role="package">
|
||||
<title>Introduction to DHCP</title>
|
||||
<title>Introduction to ISC DHCP</title>
|
||||
|
||||
<para>The <application>DHCP</application> package contains both the client
|
||||
and server programs for DHCP. <command>dhclient</command> (the client) is
|
||||
useful for connecting your computer to a network which uses DHCP to assign
|
||||
network addresses. <command>dhcpd</command> (the server) is useful for
|
||||
assigning network addresses on your private network.</para>
|
||||
<para>
|
||||
The <application>ISC DHCP</application> package contains both the client and
|
||||
server programs for DHCP. <command>dhclient</command> (the client) is
|
||||
used for connecting to a network which uses DHCP to assign network
|
||||
addresses. <command>dhcpd</command> (the server) is used for assigning
|
||||
network addresses on private networks.
|
||||
</para>
|
||||
|
||||
&lfs70_checked;
|
||||
&lfs71_checked;
|
||||
|
||||
<bridgehead renderas="sect3">Package Information</bridgehead>
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem>
|
||||
<para>Download (HTTP): <ulink url="&dhcp-download-http;"/></para>
|
||||
<para>
|
||||
Download (HTTP): <ulink url="&dhcp-download-http;"/>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Download (FTP): <ulink url="&dhcp-download-ftp;"/></para>
|
||||
<para>
|
||||
Download (FTP): <ulink url="&dhcp-download-ftp;"/>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Download MD5 sum: &dhcp-md5sum;</para>
|
||||
<para>
|
||||
Download MD5 sum: &dhcp-md5sum;
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Download size: &dhcp-size;</para>
|
||||
<para>
|
||||
Download size: &dhcp-size;
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Estimated disk space required: &dhcp-buildsize;</para>
|
||||
<para>
|
||||
Estimated disk space required: &dhcp-buildsize;
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Estimated build time: &dhcp-time;</para>
|
||||
<para>
|
||||
Estimated build time: &dhcp-time;
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
||||
<itemizedlist spacing='compact'>
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem>
|
||||
<para>Recommended Patch (for client):
|
||||
<ulink url="&patch-root;/dhcp-&dhcp-version;-iproute2-1.patch"/></para>
|
||||
<para>
|
||||
Required Patch:
|
||||
<ulink url="&patch-root;/dhcp-&dhcp-version;-client-script-1.patch"/>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Optional Patch:
|
||||
<ulink url="&patch-root;/dhcp-&dhcp-version;-missing_ipv6-1.patch"/></para>
|
||||
<para>
|
||||
Optional Patch:
|
||||
<ulink url="&patch-root;/dhcp-&dhcp-version;-missing_ipv6-1.patch"/>
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<bridgehead renderas="sect3">DHCP Dependencies</bridgehead>
|
||||
|
||||
<bridgehead renderas="sect4">Required</bridgehead>
|
||||
<para role="required"><xref linkend="net-tools"/> is required at runtime
|
||||
by <command>dhclient</command> if you do not use the iproute2 patch.</para>
|
||||
|
||||
<para condition="html" role="usernotes">User Notes:
|
||||
<ulink url="&blfs-wiki;/dhcp"/></para>
|
||||
|
||||
<ulink url="&blfs-wiki;/dhcp"/>
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 role="kernel" id='dhcp-kernel'>
|
||||
<sect2 role="kernel" id="dhcp-kernel">
|
||||
<title>Kernel Configuration</title>
|
||||
|
||||
<para>You must have Packet Socket support (Networking
|
||||
Support ⇒ Networking Options ⇒ Packet Socket) compiled into
|
||||
the kernel. If you do not have IPv6 support (Networking Support ⇒
|
||||
Networking Options ⇒ The IPv6 Protocol) compiled in, then you
|
||||
must use the missing_ipv6 patch.</para>
|
||||
<para>
|
||||
You must have Packet Socket support (Networking Support ⇒
|
||||
Networking Options ⇒ Packet Socket) compiled into the kernel.
|
||||
If you do not have IPv6 support (Networking Support ⇒
|
||||
Networking Options ⇒ The IPv6 Protocol) compiled in, then you
|
||||
must use the missing_ipv6 patch.
|
||||
</para>
|
||||
|
||||
<indexterm zone="dhcp dhcp-kernel">
|
||||
<primary sortas="d-dhcp">DHCP</primary>
|
||||
<primary sortas="d-DHCP">DHCP</primary>
|
||||
</indexterm>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 role="installation">
|
||||
<title>Installation of DHCP</title>
|
||||
<title>Installation of ISC DHCP</title>
|
||||
|
||||
<para>If you have not compiled IPv6 support into the kernel, apply the
|
||||
missing_ipv6 patch</para>
|
||||
<para>
|
||||
If you have not compiled IPv6 support into the kernel, apply the
|
||||
missing_ipv6 patch:
|
||||
</para>
|
||||
|
||||
<screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-missing_ipv6-1.patch</userinput></screen>
|
||||
|
||||
<para>If you are installing the client, apply the iproute2 patch unless you
|
||||
will have installed <application>net-tools</application> by the time you wish
|
||||
to use the client:</para>
|
||||
|
||||
<screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-iproute2-1.patch</userinput></screen>
|
||||
|
||||
<para>Install <application>DHCP</application> by running
|
||||
<para>Install <application>ISC DHCP</application> by running
|
||||
the following commands:</para>
|
||||
|
||||
<screen><userinput>sed -i 's%\(^sbindir =\).*%\1 @prefix@@sbindir@%' server/Makefile.in &&
|
||||
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
|
||||
--sbindir=/sbin \
|
||||
--with-srv-lease-file=/var/state/dhcp/dhcpd.leases \
|
||||
--with-srv6-lease-file=/var/state/dhcp/dhcpd6.leases \
|
||||
--with-cli-lease-file=/var/state/dhclient.leases \
|
||||
--with-cli6-lease-file=/var/state/dhclient6.leases &&
|
||||
sed -i 's/-Werror//' {client,common,dst,omapip,relay,server,tests}/Makefile</userinput></screen>
|
||||
<screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-client-script-1.patch &&
|
||||
CFLAGS="-D_PATH_DHCLIENT_SCRIPT='\"/sbin/dhclient-script\"' \
|
||||
-D_PATH_DHCPD_CONF='\"/etc/dhcp/dhcpd.conf\"' \
|
||||
-D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'" \
|
||||
./configure --prefix=/usr \
|
||||
--sysconfdir=/etc/dhcp \
|
||||
--localstatedir=/var \
|
||||
--with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases \
|
||||
--with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases \
|
||||
--with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
|
||||
--with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases &&
|
||||
make</userinput></screen>
|
||||
|
||||
<para>If you only wish to build the server, enter:</para>
|
||||
<screen><userinput>sed -i 's/ client//' Makefile</userinput></screen>
|
||||
<para>
|
||||
To test the results, issue: <command>make check</command>
|
||||
</para>
|
||||
|
||||
<para>If you only wish to build the client, enter:</para>
|
||||
<screen><userinput>sed -i 's/ dhcpctl relay server//' Makefile</userinput></screen>
|
||||
<para>
|
||||
If you only want to install the <application>ISC DHCP</application> client,
|
||||
issue the following commands as the
|
||||
<systemitem class="username">root</systemitem> user:
|
||||
</para>
|
||||
|
||||
<para>Build your chosen variant(s) with:</para>
|
||||
<screen><userinput>make</userinput></screen>
|
||||
|
||||
<para>To test the results, issue: <command>make check</command></para>
|
||||
|
||||
<para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
||||
|
||||
<screen role="root"><userinput>make install &&
|
||||
<screen role="root"><userinput>make -C client install &&
|
||||
mv -v /usr/sbin/dhclient /sbin &&
|
||||
install -v -m755 client/scripts/linux /sbin/dhclient-script</userinput></screen>
|
||||
|
||||
<para>The supplied <filename>/etc/dhcpd.conf</filename> (server) and
|
||||
<filename>/etc/dhclient.conf</filename> (client) are examples for a
|
||||
specific <literal>BSD</literal> system. They are unlikely to be appropriate
|
||||
to your needs, but you may wish to read them for ideas before deleting them
|
||||
or moving them to a different location.</para>
|
||||
<para>
|
||||
Skip to <xref linkend="dhclient-config"/> in order to configure the client
|
||||
</para>
|
||||
|
||||
<para>Now create any needed directories for the leases.</para>
|
||||
<para>
|
||||
If you only want to install the <application>ISC DHCP</application> server,
|
||||
issue the following command as the
|
||||
<systemitem class="username">root</systemitem> user:
|
||||
</para>
|
||||
|
||||
<para>For the server:</para>
|
||||
<screen role="root"><userinput>make -C server install</userinput></screen>
|
||||
|
||||
<screen role="root"><userinput>mkdir -pv /var/state/dhcp</userinput></screen>
|
||||
<para>
|
||||
Skip to <xref linkend="dhcpd-config"/> in order to configure the server.
|
||||
</para>
|
||||
|
||||
<para>For the client:</para>
|
||||
<screen role="root"><userinput>mkdir -pv /var/state</userinput></screen>
|
||||
<para>
|
||||
Alternatively, you can install whole package which includes the client,
|
||||
server, relay, static libraries and development headers by running the
|
||||
following commands as the
|
||||
<systemitem class="username">root</systemitem> user:
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 role="commands">
|
||||
<title>Command Explanations</title>
|
||||
|
||||
<para><command>sed -i 's%\(^sbindir =\).*%\1 @prefix@@sbindir@%' server/Makefile.in</command>
|
||||
This command moves the <command>dhcp</command> program to
|
||||
<filename class='directory'>/usr/sbin</filename> instead of
|
||||
<filename class='directory'>/sbin</filename> because it is not needed
|
||||
while the server is booting.</para>
|
||||
|
||||
<para><command>--sbindir=/sbin</command> The <command>dhclient</command>
|
||||
program is moved to <filename class='directory'>/sbin</filename> instead of
|
||||
<filename class='directory'>/usr/sbin</filename> so that it is available
|
||||
during boot, e.g. if <filename class='directory'>/usr</filename> is to be
|
||||
an <literal>nfs</literal> mount.</para>
|
||||
|
||||
<para><command>--with-*-lease-files=...</command> By default, lease files
|
||||
are placed in <filename class='directory'>/var/db</filename> which is an
|
||||
anachronism.</para>
|
||||
|
||||
<para><command>sed -i 's/-Werror//' {client,common,...}/Makefile</command> -
|
||||
the Makefiles in this package add <literal>-Werror</literal> to the
|
||||
<literal>CFLAGS</literal>. On recent versions of <application>gcc</application>
|
||||
more things, particularly unused variables, create warnings. The
|
||||
<literal>-Werror</literal> flag causes warnings to break the build, so we
|
||||
remove it where necessary.</para>
|
||||
|
||||
<para><command>sed -i 's/ something//' Makefile</command> - this stops the
|
||||
build from entering the director(y,ies) named here.</para>
|
||||
|
||||
<para><option>rm -v /usr/lib/lib{dhcpctl,dst,omapi}.a</option> - there is
|
||||
no easy way to prevent these static libraries being installed, but they are
|
||||
only needed during the build of this package. <filename>libdhcpctl.a</filename>
|
||||
is only installed if you build the server.</para>
|
||||
<screen role="root"><userinput>make install &&
|
||||
mv -v /usr/sbin/dhclient /sbin &&
|
||||
install -v -m755 client/scripts/linux /sbin/dhclient-script</userinput></screen>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 role="configuration">
|
||||
<title>Configuring DHCP</title>
|
||||
<title>Configuring ISC DHCP</title>
|
||||
|
||||
<sect3 id='dhcp-config'>
|
||||
<sect3 id="dhcp-config">
|
||||
<title>Config Files</title>
|
||||
|
||||
<para><filename>/etc/dhclient.conf</filename> and
|
||||
<filename>/etc/dhcpd.conf</filename></para>
|
||||
<para>
|
||||
<filename>/etc/dhcp/dhclient.conf</filename> and
|
||||
<filename>/etc/dhcp/dhcpd.conf</filename>
|
||||
</para>
|
||||
|
||||
<indexterm zone="dhcp dhcp-config">
|
||||
<primary sortas="e-etc-dhclient.conf">/etc/dhclient.conf</primary>
|
||||
<primary sortas="e-etc-dhcp-dhclient.conf">/etc/dhcp/dhclient.conf</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="dhcp dhcp-config">
|
||||
<primary sortas="e-etc-dhcpd.conf">/etc/dhcpd.conf</primary>
|
||||
<primary sortas="e-etc-dhcp-dhcpd.conf">/etc/dhcp/dhcpd.conf</primary>
|
||||
</indexterm>
|
||||
|
||||
</sect3>
|
||||
|
||||
<sect3 id='dhcp-init'>
|
||||
<title>Configuration Information</title>
|
||||
<sect3 id="dhclient-config">
|
||||
<title>Client Configuration</title>
|
||||
|
||||
<para>Information on configuring the DHCP client can be
|
||||
found in <xref linkend="basicnet-connect"/>.</para>
|
||||
<para>
|
||||
Create basic <filename>/etc/dhcp/dhclient.conf</filename>
|
||||
by running the following command as the
|
||||
<systemitem class="username">root</systemitem> user:
|
||||
</para>
|
||||
|
||||
<para>Note that you only need the DHCP server if you want to issue
|
||||
LAN addresses over your network. The DHCP client doesn't need this
|
||||
script to be used. Also note that this script is coded for the
|
||||
<emphasis role="strong">eth1</emphasis> interface, which may need
|
||||
to be modified for your hardware configuration.</para>
|
||||
<screen role="root"><userinput>cat > /etc/dhcp/dhclient.conf << "EOF"
|
||||
<literal># Begin /etc/dhcp/dhclient.conf
|
||||
#
|
||||
# Basic dhclient.conf(5)
|
||||
|
||||
<para>Install the <filename>/etc/rc.d/init.d/dhcp</filename>
|
||||
init script included in the <xref linkend="bootscripts"/>
|
||||
package.</para>
|
||||
#prepend domain-name-servers 127.0.0.1;
|
||||
request subnet-mask, broadcast-address, time-offset, routers,
|
||||
domain-name, domain-name-servers, domain-search, host-name,
|
||||
netbios-name-servers, netbios-scope, interface-mtu,
|
||||
ntp-servers;
|
||||
require subnet-mask, domain-name-servers;
|
||||
#timeout 60;
|
||||
#retry 60;
|
||||
#reboot 10;
|
||||
#select-timeout 5;
|
||||
#initial-interval 2;
|
||||
|
||||
<indexterm zone="dhcp dhcp-init">
|
||||
<primary sortas="f-dhcp">dhcpd</primary>
|
||||
</indexterm>
|
||||
|
||||
<screen role="root"><userinput>make install-dhcp</userinput></screen>
|
||||
|
||||
<para>The lease file must exist on startup. The following command will
|
||||
satisfy that requirement:</para>
|
||||
|
||||
<screen role="root"><userinput>touch /var/state/dhcp/dhcpd.leases</userinput></screen>
|
||||
|
||||
<para>The following commands will create a base configuration file
|
||||
for a DHCP server. There are several options that you may want to
|
||||
add (information that is passed back to the DHCP client) and those
|
||||
are covered in the man pages for <filename>dhcp.conf</filename>.</para>
|
||||
|
||||
<screen role="root"><userinput>cat > /etc/dhcpd.conf << "EOF"
|
||||
<literal>default-lease-time 72000;
|
||||
max-lease-time 144000;
|
||||
|
||||
subnet <replaceable><192.168.5.0></replaceable> netmask <replaceable><255.255.255.0></replaceable> {
|
||||
range <replaceable><192.168.5.10> <192.168.5.240></replaceable>;
|
||||
option broadcast-address <replaceable><192.168.5.255></replaceable>;
|
||||
option routers <replaceable><192.168.5.1></replaceable>;
|
||||
}</literal>
|
||||
# End /etc/dhcp/dhclient.conf</literal>
|
||||
EOF</userinput></screen>
|
||||
|
||||
<para>All addresses should be changed to meet your circumstance.</para>
|
||||
<para>
|
||||
See <command>man 5 dhclient.conf</command> for additional options.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Now create the <filename class="directory">/var/lib/dhclient</filename>
|
||||
directory which will contain DHCP Client leases by running the following
|
||||
command as the <systemitem class="username">root</systemitem> user:
|
||||
</para>
|
||||
|
||||
<screen role="root"><userinput>install -v -dm 755 /var/lib/dhclient</userinput></screen>
|
||||
|
||||
<para>
|
||||
At this point you can test if <command>dhclient</command> is
|
||||
behaving as expected by running the following command as the
|
||||
<systemitem class="username">root</systemitem> user:
|
||||
</para>
|
||||
|
||||
<screen role="root"><userinput>dhclient <replaceable><eth0></replaceable></userinput></screen>
|
||||
|
||||
<para>
|
||||
Replace <replaceable><eth0></replaceable> with your
|
||||
desired interface. If you want more verbose output, add the
|
||||
<command>-v</command> parameter to the command above.
|
||||
</para>
|
||||
|
||||
<para id="dhclient-service">
|
||||
If you want to configure network interfaces at boot using
|
||||
<command>dhclient</command>, you need to install the
|
||||
<filename>/lib/services/dhclient</filename> script
|
||||
included in <xref linkend="bootscripts"/> package:
|
||||
</para>
|
||||
|
||||
<screen role="root"><userinput>make install-service-dhclient</userinput></screen>
|
||||
|
||||
<indexterm zone="dhcp dhclient-service">
|
||||
<primary sortas="f-dhclient">dhclient (service script)</primary>
|
||||
</indexterm>
|
||||
|
||||
<para id="dhclient-ifconfig">
|
||||
Next, create the <filename>/etc/sysconfig/ifconfig.eth0</filename>
|
||||
configuration file with the following commands as the
|
||||
<systemitem class="username">root</systemitem> user:
|
||||
</para>
|
||||
|
||||
<screen role="root"><userinput>cat > /etc/sysconfig/ifconfig.eth0 << "EOF"
|
||||
<literal>ONBOOT="yes"
|
||||
IFACE="eth0"
|
||||
SERVICE="dhclient"
|
||||
DHCP_START=""
|
||||
DHCP_STOP=""
|
||||
|
||||
# Set PRINTIP="yes" to have the script print
|
||||
# the DHCP assigned IP address
|
||||
PRINTIP="no"
|
||||
|
||||
# Set PRINTALL="yes" to print the DHCP assigned values for
|
||||
# IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
|
||||
PRINTALL="no"</literal>
|
||||
EOF</userinput></screen>
|
||||
|
||||
<indexterm zone="dhcp dhclient-ifconfig">
|
||||
<primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/ifconfig.eth0</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Adjust the file to suit your needs.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For more information on the appropriate <envar>DHCP_START</envar>
|
||||
and <envar>DHCP_STOP</envar> values see
|
||||
<command>man 8 dhclient</command>.
|
||||
</para>
|
||||
|
||||
</sect3>
|
||||
|
||||
<sect3 id="dhcpd-config">
|
||||
<title>Server Configuration</title>
|
||||
|
||||
<para>
|
||||
Note that you only need the DHCP server if you want to issue
|
||||
LAN addresses over your network. The DHCP client doesn't need
|
||||
the server in order to function properly.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Start with creating <filename>/etc/dhcp/dhcpd.conf</filename>
|
||||
by running the following command as the
|
||||
<systemitem class="username">root</systemitem> user:
|
||||
</para>
|
||||
|
||||
<screen role="root"><userinput>cat > /etc/dhcp/dhcpd.conf << "EOF"
|
||||
<literal># Begin /etc/dhcp/dhcpd.conf
|
||||
#
|
||||
# Example dhcpd.conf(5)
|
||||
|
||||
# Use this to enble / disable dynamic dns updates globally.
|
||||
ddns-update-style none;
|
||||
|
||||
# option definitions common to all supported networks...
|
||||
option domain-name "example.org";
|
||||
option domain-name-servers ns1.example.org, ns2.example.org;
|
||||
|
||||
default-lease-time 600;
|
||||
max-lease-time 7200;
|
||||
|
||||
# This is a very basic subnet declaration.
|
||||
subnet 10.254.239.0 netmask 255.255.255.224 {
|
||||
range 10.254.239.10 10.254.239.20;
|
||||
option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
|
||||
}
|
||||
|
||||
# End /etc/dhcp/dhcpd.conf</literal>
|
||||
EOF</userinput></screen>
|
||||
|
||||
<para>
|
||||
Adjust the file to suit your needs. See
|
||||
<command>man 5 dhcpd.conf</command> for additional options.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Now create the <filename class="directory">/var/lib/dhcpd</filename>
|
||||
directory which will contain DHCP Server leases by running the following
|
||||
command as the <systemitem class="username">root</systemitem> user:
|
||||
</para>
|
||||
|
||||
<screen role="root"><userinput>install -v -dm 755 /var/lib/dhcpd</userinput></screen>
|
||||
|
||||
<para>
|
||||
If you want to start the DHCP Server at boot, install
|
||||
the <filename>/etc/rc.d/init.d/dhcpd</filename>
|
||||
init script included in the <xref linkend="bootscripts"/>
|
||||
package:
|
||||
</para>
|
||||
|
||||
<screen role="root"><userinput>make install-dhcpd</userinput></screen>
|
||||
|
||||
<indexterm zone="dhcp dhcpd-config">
|
||||
<primary sortas="f-dhcpd">dhcpd</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
You will need to edit the
|
||||
<filename>/etc/sysconfig/dhcpd</filename> in order
|
||||
to set the interface on which <command>dhcpd</command>
|
||||
will serve the DHCP requests.
|
||||
</para>
|
||||
|
||||
</sect3>
|
||||
|
||||
@ -270,9 +392,19 @@ EOF</userinput></screen>
|
||||
<segtitle>Installed Directories</segtitle>
|
||||
|
||||
<seglistitem>
|
||||
<seg>dhcpd, dhcrelay, dhclient, dhclient-script, and omshell</seg>
|
||||
<seg>libbdhcpctl.a, libdst.a, libomapi.a</seg>
|
||||
<seg>/var/state/dhcp, /usr/include/omapip, and /usr/include/isi-dhcp</seg>
|
||||
<seg>
|
||||
dhclient, dhclient-script, dhcpd, dhcrelay and omshell
|
||||
</seg>
|
||||
<seg>
|
||||
libdhcpctl.a, libdst.a and libomapi.a
|
||||
</seg>
|
||||
<seg>
|
||||
/usr/include/dhcpctl,
|
||||
/usr/include/isc-dhcp,
|
||||
/usr/include/omapip,
|
||||
/var/lib/dhclient and
|
||||
/var/lib/dhcpd
|
||||
</seg>
|
||||
</seglistitem>
|
||||
</segmentedlist>
|
||||
|
||||
@ -284,7 +416,9 @@ EOF</userinput></screen>
|
||||
<varlistentry id="dhclient">
|
||||
<term><command>dhclient</command></term>
|
||||
<listitem>
|
||||
<para>is the implementation of the DHCP client.</para>
|
||||
<para>
|
||||
is the implementation of the DHCP client.
|
||||
</para>
|
||||
<indexterm zone="dhcp dhclient">
|
||||
<primary sortas="b-dhclient">dhclient</primary>
|
||||
</indexterm>
|
||||
@ -294,8 +428,10 @@ EOF</userinput></screen>
|
||||
<varlistentry id="dhclient-script">
|
||||
<term><command>dhclient-script</command></term>
|
||||
<listitem>
|
||||
<para>is used by dhclient to (re)configure interfaces. It can make
|
||||
extra changes by invoking custom dhclient-{entry,exit}-hooks.</para>
|
||||
<para>
|
||||
is used by dhclient to (re)configure interfaces. It can make
|
||||
extra changes by invoking custom dhclient-{entry,exit}-hooks.
|
||||
</para>
|
||||
<indexterm zone="dhcp dhclient-script">
|
||||
<primary sortas="b-dhclient-script">dhclient-script</primary>
|
||||
</indexterm>
|
||||
@ -305,9 +441,11 @@ EOF</userinput></screen>
|
||||
<varlistentry id="dhcpd">
|
||||
<term><command>dhcpd</command></term>
|
||||
<listitem>
|
||||
<para>implements Dynamic Host Configuration Protocol (DHCP) and
|
||||
Internet Bootstrap Protocol (BOOTP) requests for network
|
||||
addresses.</para>
|
||||
<para>
|
||||
implements Dynamic Host Configuration Protocol (DHCP) and
|
||||
Internet Bootstrap Protocol (BOOTP) requests for network
|
||||
addresses.
|
||||
</para>
|
||||
<indexterm zone="dhcp dhcpd">
|
||||
<primary sortas="b-dhcpd">dhcpd</primary>
|
||||
</indexterm>
|
||||
@ -317,9 +455,11 @@ EOF</userinput></screen>
|
||||
<varlistentry id="dhcrelay">
|
||||
<term><command>dhcrelay</command></term>
|
||||
<listitem>
|
||||
<para>provides a means to accept DHCP and BOOTP requests on a subnet
|
||||
without a DHCP server and relay them to a DHCP server on another
|
||||
subnet.</para>
|
||||
<para>
|
||||
provides a means to accept DHCP and BOOTP requests on a subnet
|
||||
without a DHCP server and relay them to a DHCP server on another
|
||||
subnet.
|
||||
</para>
|
||||
<indexterm zone="dhcp dhcrelay">
|
||||
<primary sortas="b-dhcrelay">dhcrelay</primary>
|
||||
</indexterm>
|
||||
@ -329,9 +469,11 @@ EOF</userinput></screen>
|
||||
<varlistentry id="omshell">
|
||||
<term><command>omshell</command></term>
|
||||
<listitem>
|
||||
<para> provides an interactive way to connect to, query, and
|
||||
possibly change, the ISC DHCP Server's state via OMAPI, the
|
||||
Object Management API.</para>
|
||||
<para>
|
||||
provides an interactive way to connect to, query and
|
||||
possibly change the ISC DHCP Server's state via OMAPI, the
|
||||
Object Management API.
|
||||
</para>
|
||||
<indexterm zone="dhcp omshell">
|
||||
<primary sortas="b-omshell">omshell</primary>
|
||||
</indexterm>
|
||||
|
@ -90,7 +90,7 @@
|
||||
<para role="recommended">
|
||||
<xref linkend="consolekit"/>,
|
||||
<xref linkend="dhcpcd"/> or
|
||||
<xref linkend="dhcp-client"/>,
|
||||
<xref linkend="dhcp"/> (client only),
|
||||
<xref linkend="gobject-introspection"/>,
|
||||
<xref linkend="iptables"/>,
|
||||
<xref linkend="libsoup"/> and
|
||||
|
Loading…
Reference in New Issue
Block a user