Author: krejzi Date: 2012-08-14 16:00:47 -0600 (Tue, 14 Aug 2012) New Revision: 10519
Added: trunk/BOOK/archive/dhcp-client.xml trunk/bootscripts/blfs/init.d/dhcpd trunk/bootscripts/blfs/sysconfig/dhcpd Removed: trunk/BOOK/networking/connect/dhcp-client.xml trunk/bootscripts/blfs/init.d/dhcp Modified: trunk/BOOK/general.ent trunk/BOOK/introduction/welcome/changelog.xml trunk/BOOK/networking/connect/connect.xml trunk/BOOK/networking/connect/dhcp.xml trunk/BOOK/networking/netutils/networkmanager.xml trunk/bootscripts/ChangeLog trunk/bootscripts/Makefile trunk/bootscripts/blfs/services/dhclient Log: ISC DHCP 4.2.4-P1 with bootscript and network service updates. Merged dhcp client configuration into dhcp page. Copied: trunk/BOOK/archive/dhcp-client.xml (from rev 10508, trunk/BOOK/networking/connect/dhcp-client.xml) =================================================================== --- trunk/BOOK/archive/dhcp-client.xml (rev 0) +++ trunk/BOOK/archive/dhcp-client.xml 2012-08-14 22:00:47 UTC (rev 10519) @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../../general.ent"> + %general-entities; +]> + +<sect1 id="dhcp-client" xreflabel="DHCP-&dhcp-version; Client Configuration"> + <?dbhtml filename="dhcpclient.html"?> + + <sect1info> + <othername>$LastChangedBy$</othername> + <date>$Date$</date> + </sect1info> + + <title>DHCP-&dhcp-version; Client Configuration</title> + + <indexterm zone="dhcp-client"> + <primary sortas="b-dhclient">dhclient</primary> + </indexterm> + + <para>The <application>DHCP</application> package comes with + both a client (<command>dhclient</command>) and a server program for + using DHCP. If you want to install this package, + the instructions can be found at <xref linkend="dhcp"/>. + Note that if you only want to use the client, you + do <emphasis>not</emphasis> need to run the server and so do not need + the startup script and links provided for the server daemon. + You only need to run the DHCP server if you're providing + this service to a network, and it's likely that you'll know if that's the + case; if it isn't, don't run the server! Once you have installed the + package, return here for information on how to configure the client + (<command>dhclient</command>).</para> + + <sect2 role="configuration"> + <title>Configuring DHCP Client</title> + + <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-service1010"> + <primary sortas="f-dhclient">dhclient (service script)</primary> + </indexterm> + +<screen role='root'><userinput>make install-service-dhclient</userinput></screen> + + <para id="dhclient-config1">Next, create the + <filename>/etc/sysconfig/ifconfig.eth0</filename> + configuration file with the following commands as the <systemitem + class="username">root</systemitem> user. Adjust as + necessary for additional interfaces:</para> + + <indexterm zone="dhcp-client dhclient-config1"> + <primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/ifconfig.eth0</primary> + </indexterm> + +<screen role='root'><userinput>cat > /etc/sysconfig/ifconfig.eth0 << "EOF" +<literal>ONBOOT="yes" +IFACE="eth0" +SERVICE="dhclient" +DHCP_START="<replaceable><add additional start parameters here></replaceable> eth0" +DHCP_STOP="-r <replaceable><add additional stop parameters here></replaceable>" + +# 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> + + <para>For more information on the appropriate + <envar>DHCP_START</envar> and <envar>DHCP_STOP</envar> + values, examine the man page for <command>dhclient</command>.</para> + + <para id="dhclient-config2">Finally, you should create the + <filename>/etc/dhclient.conf</filename> file using the following commands + as the <systemitem class="username">root</systemitem> user:</para> + + <indexterm zone="dhcp-client dhclient-config2"> + <primary sortas="e-etc-dhclient.conf">/etc/dhclient.conf</primary> + </indexterm> + + <note> + <para>You'll need to add a second interface definition to the file if you + have more than one interface.</para> + </note> + +<screen role='root'><userinput>cat > /etc/dhclient.conf << "EOF" +<literal># dhclient.conf + +interface "eth0"{ +prepend domain-name-servers 127.0.0.1; +request subnet-mask, broadcast-address, time-offset, routers, + domain-name, domain-name-servers, host-name; +require subnet-mask, domain-name-servers; +} +# end dhclient.conf</literal> +EOF</userinput></screen> + + </sect2> + +</sect1> Modified: trunk/BOOK/general.ent =================================================================== --- trunk/BOOK/general.ent 2012-08-14 17:15:37 UTC (rev 10518) +++ trunk/BOOK/general.ent 2012-08-14 22:00:47 UTC (rev 10519) @@ -547,7 +547,7 @@ <!-- 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"> Modified: trunk/BOOK/introduction/welcome/changelog.xml =================================================================== --- trunk/BOOK/introduction/welcome/changelog.xml 2012-08-14 17:15:37 UTC (rev 10518) +++ trunk/BOOK/introduction/welcome/changelog.xml 2012-08-14 22:00:47 UTC (rev 10519) @@ -55,6 +55,10 @@ 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> </listitem> @@ -63,6 +67,10 @@ 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 if the directory is already present.</para> @@ -73,6 +81,10 @@ 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> </listitem> @@ -83,6 +95,9 @@ <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> <listitem> Modified: trunk/BOOK/networking/connect/connect.xml =================================================================== --- trunk/BOOK/networking/connect/connect.xml 2012-08-14 17:15:37 UTC (rev 10518) +++ trunk/BOOK/networking/connect/connect.xml 2012-08-14 22:00:47 UTC (rev 10519) @@ -34,6 +34,5 @@ <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> Deleted: trunk/BOOK/networking/connect/dhcp-client.xml =================================================================== --- trunk/BOOK/networking/connect/dhcp-client.xml 2012-08-14 17:15:37 UTC (rev 10518) +++ trunk/BOOK/networking/connect/dhcp-client.xml 2012-08-14 22:00:47 UTC (rev 10519) @@ -1,107 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../../general.ent"> - %general-entities; -]> - -<sect1 id="dhcp-client" xreflabel="DHCP-&dhcp-version; Client Configuration"> - <?dbhtml filename="dhcpclient.html"?> - - <sect1info> - <othername>$LastChangedBy$</othername> - <date>$Date$</date> - </sect1info> - - <title>DHCP-&dhcp-version; Client Configuration</title> - - <indexterm zone="dhcp-client"> - <primary sortas="b-dhclient">dhclient</primary> - </indexterm> - - <para>The <application>DHCP</application> package comes with - both a client (<command>dhclient</command>) and a server program for - using DHCP. If you want to install this package, - the instructions can be found at <xref linkend="dhcp"/>. - Note that if you only want to use the client, you - do <emphasis>not</emphasis> need to run the server and so do not need - the startup script and links provided for the server daemon. - You only need to run the DHCP server if you're providing - this service to a network, and it's likely that you'll know if that's the - case; if it isn't, don't run the server! Once you have installed the - package, return here for information on how to configure the client - (<command>dhclient</command>).</para> - - <sect2 role="configuration"> - <title>Configuring DHCP Client</title> - - <para id="dhclient-service">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"> - <primary sortas="f-dhclient">dhclient (service script)</primary> - </indexterm> - -<screen role='root'><userinput>make install-service-dhclient</userinput></screen> - - <para id="dhclient-config1">Next, create the - <filename>/etc/sysconfig/ifconfig.eth0</filename> - configuration file with the following commands as the <systemitem - class="username">root</systemitem> user. Adjust as - necessary for additional interfaces:</para> - - <indexterm zone="dhcp-client dhclient-config1"> - <primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/ifconfig.eth0</primary> - </indexterm> - -<screen role='root'><userinput>cat > /etc/sysconfig/ifconfig.eth0 << "EOF" -<literal>ONBOOT="yes" -IFACE="eth0" -SERVICE="dhclient" -DHCP_START="<replaceable><add additional start parameters here></replaceable> eth0" -DHCP_STOP="-r <replaceable><add additional stop parameters here></replaceable>" - -# 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> - - <para>For more information on the appropriate - <envar>DHCP_START</envar> and <envar>DHCP_STOP</envar> - values, examine the man page for <command>dhclient</command>.</para> - - <para id="dhclient-config2">Finally, you should create the - <filename>/etc/dhclient.conf</filename> file using the following commands - as the <systemitem class="username">root</systemitem> user:</para> - - <indexterm zone="dhcp-client dhclient-config2"> - <primary sortas="e-etc-dhclient.conf">/etc/dhclient.conf</primary> - </indexterm> - - <note> - <para>You'll need to add a second interface definition to the file if you - have more than one interface.</para> - </note> - -<screen role='root'><userinput>cat > /etc/dhclient.conf << "EOF" -<literal># dhclient.conf - -interface "eth0"{ -prepend domain-name-servers 127.0.0.1; -request subnet-mask, broadcast-address, time-offset, routers, - domain-name, domain-name-servers, host-name; -require subnet-mask, domain-name-servers; -} -# end dhclient.conf</literal> -EOF</userinput></screen> - - </sect2> - -</sect1> Modified: trunk/BOOK/networking/connect/dhcp.xml =================================================================== --- trunk/BOOK/networking/connect/dhcp.xml 2012-08-14 17:15:37 UTC (rev 10518) +++ trunk/BOOK/networking/connect/dhcp.xml 2012-08-14 22:00:47 UTC (rev 10519) @@ -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,239 +23,362 @@ <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> + <para>Install <application>ISC DHCP</application> by running + the following commands:</para> -<screen><userinput>patch -Np1 -i ../dhcp-&dhcp-version;-iproute2-1.patch</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>Install <application>DHCP</application> by running - the following commands:</para> + <para> + To test the results, issue: <command>make check</command> + </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> + <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>If you only wish to build the server, enter:</para> -<screen><userinput>sed -i 's/ client//' Makefile</userinput></screen> +<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>If you only wish to build the client, enter:</para> -<screen><userinput>sed -i 's/ dhcpctl relay server//' Makefile</userinput></screen> + <para> + Skip to <xref linkend="dhclient-config"/> in order to configure the client + </para> - <para>Build your chosen variant(s) with:</para> -<screen><userinput>make</userinput></screen> + <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>To test the results, issue: <command>make check</command></para> +<screen role="root"><userinput>make -C server install</userinput></screen> - <para>Now, as the <systemitem class="username">root</systemitem> user:</para> + <para> + Skip to <xref linkend="dhcpd-config"/> in order to configure the server. + </para> -<screen role="root"><userinput>make install && + <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> + +<screen role="root"><userinput>make 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> + </sect2> - <para>Now create any needed directories for the leases.</para> + <sect2 role="configuration"> + <title>Configuring ISC DHCP</title> - <para>For the server:</para> + <sect3 id="dhcp-config"> + <title>Config Files</title> -<screen role="root"><userinput>mkdir -pv /var/state/dhcp</userinput></screen> + <para> + <filename>/etc/dhcp/dhclient.conf</filename> and + <filename>/etc/dhcp/dhcpd.conf</filename> + </para> - <para>For the client:</para> -<screen role="root"><userinput>mkdir -pv /var/state</userinput></screen> + <indexterm zone="dhcp dhcp-config"> + <primary sortas="e-etc-dhcp-dhclient.conf">/etc/dhcp/dhclient.conf</primary> + </indexterm> - </sect2> + <indexterm zone="dhcp dhcp-config"> + <primary sortas="e-etc-dhcp-dhcpd.conf">/etc/dhcp/dhcpd.conf</primary> + </indexterm> - <sect2 role="commands"> - <title>Command Explanations</title> + </sect3> - <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> + <sect3 id="dhclient-config"> + <title>Client Configuration</title> - <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> + Create basic <filename>/etc/dhcp/dhclient.conf</filename> + by running the following command as the + <systemitem class="username">root</systemitem> user: + </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> +<screen role="root"><userinput>cat > /etc/dhcp/dhclient.conf << "EOF" +<literal># Begin /etc/dhcp/dhclient.conf +# +# Basic dhclient.conf(5) - <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> +#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; - <para><command>sed -i 's/ something//' Makefile</command> - this stops the - build from entering the director(y,ies) named here.</para> +# End /etc/dhcp/dhclient.conf</literal> +EOF</userinput></screen> - <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> + <para> + See <command>man 5 dhclient.conf</command> for additional options. + </para> - </sect2> + <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> - <sect2 role="configuration"> - <title>Configuring DHCP</title> +<screen role="root"><userinput>install -v -dm 755 /var/lib/dhclient</userinput></screen> - <sect3 id='dhcp-config'> - <title>Config Files</title> + <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> - <para><filename>/etc/dhclient.conf</filename> and - <filename>/etc/dhcpd.conf</filename></para> +<screen role="root"><userinput>dhclient <replaceable><eth0></replaceable></userinput></screen> - <indexterm zone="dhcp dhcp-config"> - <primary sortas="e-etc-dhclient.conf">/etc/dhclient.conf</primary> + <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> - <indexterm zone="dhcp dhcp-config"> - <primary sortas="e-etc-dhcpd.conf">/etc/dhcpd.conf</primary> + <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> - </sect3> + <para> + Adjust the file to suit your needs. + </para> - <sect3 id='dhcp-init'> - <title>Configuration Information</title> + <para> + For more information on the appropriate <envar>DHCP_START</envar> + and <envar>DHCP_STOP</envar> values see + <command>man 8 dhclient</command>. + </para> - <para>Information on configuring the DHCP client can be - found in <xref linkend="basicnet-connect"/>.</para> + </sect3> - <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> + <sect3 id="dhcpd-config"> + <title>Server Configuration</title> - <para>Install the <filename>/etc/rc.d/init.d/dhcp</filename> - init script included in the <xref linkend="bootscripts"/> - package.</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 + the server in order to function properly. + </para> - <indexterm zone="dhcp dhcp-init"> - <primary sortas="f-dhcp">dhcpd</primary> - </indexterm> + <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>make install-dhcp</userinput></screen> +<screen role="root"><userinput>cat > /etc/dhcp/dhcpd.conf << "EOF" +<literal># Begin /etc/dhcp/dhcpd.conf +# +# Example dhcpd.conf(5) - <para>The lease file must exist on startup. The following command will - satisfy that requirement:</para> +# Use this to enble / disable dynamic dns updates globally. +ddns-update-style none; -<screen role="root"><userinput>touch /var/state/dhcp/dhcpd.leases</userinput></screen> +# option definitions common to all supported networks... +option domain-name "example.org"; +option domain-name-servers ns1.example.org, ns2.example.org; - <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> +default-lease-time 600; +max-lease-time 7200; -<screen role="root"><userinput>cat > /etc/dhcpd.conf << "EOF" -<literal>default-lease-time 72000; -max-lease-time 144000; +# 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; +} -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/dhcpd.conf</literal> EOF</userinput></screen> - <para>All addresses should be changed to meet your circumstance.</para> + <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> </sect2> @@ -270,9 +392,19 @@ <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 @@ <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 @@ <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 @@ <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 @@ <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 @@ <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> Modified: trunk/BOOK/networking/netutils/networkmanager.xml =================================================================== --- trunk/BOOK/networking/netutils/networkmanager.xml 2012-08-14 17:15:37 UTC (rev 10518) +++ trunk/BOOK/networking/netutils/networkmanager.xml 2012-08-14 22:00:47 UTC (rev 10519) @@ -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 Modified: trunk/bootscripts/ChangeLog =================================================================== --- trunk/bootscripts/ChangeLog 2012-08-14 17:15:37 UTC (rev 10518) +++ trunk/bootscripts/ChangeLog 2012-08-14 22:00:47 UTC (rev 10519) @@ -2,6 +2,10 @@ * Renamed cyrus-sasl bootscript to saslauthd * Renamed openldap bootscript to slapd * Renamed kerberos bootscript to krb5 + * Renamed dhcp bootscript to dhcpd and made it configurable + through /etc/sysconfig/dhcpd + * Updated dhclient network service to be compatible with latest + instructions for ISC DHCP. 2012-06-02 Armin K. <[email protected]> * Added BlueZ bootscript Modified: trunk/bootscripts/Makefile =================================================================== --- trunk/bootscripts/Makefile 2012-08-14 17:15:37 UTC (rev 10518) +++ trunk/bootscripts/Makefile 2012-08-14 22:00:47 UTC (rev 10519) @@ -147,15 +147,16 @@ ln -sf ../init.d/wicd ${EXTDIR}/rc.d/rc5.d/S30wicd ln -sf ../init.d/wicd ${EXTDIR}/rc.d/rc6.d/K20wicd -install-dhcp: create-dirs - install -m ${MODE} blfs/init.d/dhcp ${EXTDIR}/rc.d/init.d/ - ln -sf ../init.d/dhcp ${EXTDIR}/rc.d/rc0.d/K30dhcp - ln -sf ../init.d/dhcp ${EXTDIR}/rc.d/rc1.d/K30dhcp - ln -sf ../init.d/dhcp ${EXTDIR}/rc.d/rc2.d/K30dhcp - ln -sf ../init.d/dhcp ${EXTDIR}/rc.d/rc3.d/S30dhcp - ln -sf ../init.d/dhcp ${EXTDIR}/rc.d/rc4.d/S30dhcp - ln -sf ../init.d/dhcp ${EXTDIR}/rc.d/rc5.d/S30dhcp - ln -sf ../init.d/dhcp ${EXTDIR}/rc.d/rc6.d/K30dhcp +install-dhcpd: create-dirs + install -m ${MODE} blfs/init.d/dhcpd ${EXTDIR}/rc.d/init.d/dhcpd + install -m ${CONFMODE} blfs/sysconfig/dhcpd ${EXTDIR}/sysconfig/dhcpd + ln -sf ../init.d/dhcpd ${EXTDIR}/rc.d/rc0.d/K30dhcpd + ln -sf ../init.d/dhcpd ${EXTDIR}/rc.d/rc1.d/K30dhcpd + ln -sf ../init.d/dhcpd ${EXTDIR}/rc.d/rc2.d/K30dhcpd + ln -sf ../init.d/dhcpd ${EXTDIR}/rc.d/rc3.d/S30dhcpd + ln -sf ../init.d/dhcpd ${EXTDIR}/rc.d/rc4.d/S30dhcpd + ln -sf ../init.d/dhcpd ${EXTDIR}/rc.d/rc5.d/S30dhcpd + ln -sf ../init.d/dhcpd ${EXTDIR}/rc.d/rc6.d/K30dhcpd install-exim: create-dirs install -m ${MODE} blfs/init.d/exim ${EXTDIR}/rc.d/init.d/ @@ -550,15 +551,16 @@ rm -f ${EXTDIR}/rc.d/rc5.d/S24saslauthd rm -f ${EXTDIR}/rc.d/rc6.d/K49saslauthd -uninstall-dhcp: - rm -f ${EXTDIR}/rc.d/init.d/dhcp - rm -f ${EXTDIR}/rc.d/rc0.d/K30dhcp - rm -f ${EXTDIR}/rc.d/rc1.d/K30dhcp - rm -f ${EXTDIR}/rc.d/rc2.d/K30dhcp - rm -f ${EXTDIR}/rc.d/rc3.d/S30dhcp - rm -f ${EXTDIR}/rc.d/rc4.d/S30dhcp - rm -f ${EXTDIR}/rc.d/rc5.d/S30dhcp - rm -f ${EXTDIR}/rc.d/rc6.d/K30dhcp +uninstall-dhcpd: + rm -f ${EXTDIR}/rc.d/init.d/dhcpd + rm -f ${EXTDIR}/sysconfig/dhcpd + rm -f ${EXTDIR}/rc.d/rc0.d/K30dhcpd + rm -f ${EXTDIR}/rc.d/rc1.d/K30dhcpd + rm -f ${EXTDIR}/rc.d/rc2.d/K30dhcpd + rm -f ${EXTDIR}/rc.d/rc3.d/S30dhcpd + rm -f ${EXTDIR}/rc.d/rc4.d/S30dhcpd + rm -f ${EXTDIR}/rc.d/rc5.d/S30dhcpd + rm -f ${EXTDIR}/rc.d/rc6.d/K30dhcpd uninstall-exim: rm -f ${EXTDIR}/rc.d/init.d/exim @@ -844,7 +846,7 @@ install-bluetooth \ install-cups \ install-saslauthd \ - install-dhcp \ + install-dhcpd \ install-exim \ install-fcron \ install-gdm \ @@ -882,7 +884,7 @@ uninstall-bluetooth \ uninstall-cups \ uninstall-saslauthd \ - uninstall-dhcp \ + uninstall-dhcpd \ uninstall-exim \ uninstall-fcron \ uninstall-gdm \ Deleted: trunk/bootscripts/blfs/init.d/dhcp =================================================================== --- trunk/bootscripts/blfs/init.d/dhcp 2012-08-14 17:15:37 UTC (rev 10518) +++ trunk/bootscripts/blfs/init.d/dhcp 2012-08-14 22:00:47 UTC (rev 10519) @@ -1,60 +0,0 @@ -#!/bin/sh -######################################################################## -# Begin dhcp -# -# Description : Start dhcp daemon -# -# Author : -# -# Version : LFS 7.0 -# -######################################################################## - -### BEGIN INIT INFO -# Provides: dhcp -# Required-Start: network -# Should-Start: -# Required-Stop: sendsignals -# Should-Stop: -# Default-Start: 3 4 5 -# Default-Stop: 0 1 2 6 -# Short-Description: Starts the dhcp server -# Description: Starts the dhcp server to provide IP addresses. -# X-LFS-Provided-By: LFS -### END INIT INFO - -. /lib/lsb/init-functions - -#$LastChangedBy$ -#$Date$ - -case "$1" in - start) - log_info_msg "Starting DHCP Server..." - start_daemon /usr/sbin/dhcpd -q eth1 - evaluate_retval - ;; - - stop) - log_info_msg "Stopping DHCP Server..." - killproc /usr/sbin/dhcpd - evaluate_retval - ;; - - restart) - $0 stop - sleep 1 - $0 start - ;; - - status) - statusproc /usr/sbin/dhcpd - ;; - - *) - echo "Usage: $0 {start|stop|restart|status}" - exit 1 - ;; -esac - -# End /etc/init.d/dhcp Copied: trunk/bootscripts/blfs/init.d/dhcpd (from rev 10497, trunk/bootscripts/blfs/init.d/dhcp) =================================================================== --- trunk/bootscripts/blfs/init.d/dhcpd (rev 0) +++ trunk/bootscripts/blfs/init.d/dhcpd 2012-08-14 22:00:47 UTC (rev 10519) @@ -0,0 +1,72 @@ +#!/bin/sh +######################################################################## +# Begin dhcpd +# +# Description : ISC DHCP Server Boot Script. +# +# Author : +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: dhcpd +# Required-Start: network +# Required-Stop: sendsignals +# Default-Start: 2 3 4 5 +# Default-Stop: 0 2 6 +# Short-Description: Starts the ISC DHCP Server. +# X-LFS-Provided-By: BLFS +### END INIT INFO + +. /lib/lsb/init-functions + +#$LastChangedBy$ +#$Date$ + +INTERFACES="" +OPTIONS="" + +if [ -f "/etc/sysconfig/dhcpd" ]; then + . /etc/sysconfig/dhcpd +fi + +case "$1" in + start) + + if [ -z "$INTERFACES" ]; then + MSG="You need to configure dhcp server in" + log_warning_msg "$MSG /etc/sysconfig/dhcpd" + exit 0 + fi + + log_info_msg "Starting ISC DHCP Server dhcpd" + start_daemon /usr/sbin/dhcpd -q $INTERFACES $OPTIONS + + ;; + + stop) + + log_info_msg "Stopping ISC DHCP Server dhcpd" + killproc /usr/sbin/dhcpd + + ;; + + restart) + $0 stop + sleep 1 + $0 start + ;; + + status) + statusproc /usr/sbin/dhcpd + ;; + + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac + +# End /etc/init.d/dhcpd Modified: trunk/bootscripts/blfs/services/dhclient =================================================================== --- trunk/bootscripts/blfs/services/dhclient 2012-08-14 17:15:37 UTC (rev 10518) +++ trunk/bootscripts/blfs/services/dhclient 2012-08-14 22:00:47 UTC (rev 10519) @@ -17,7 +17,7 @@ getipstats() { # Print the last 16 lines of dhclient.leases - sed -e :a -e '$q;N;17,$D;ba' /var/state/dhclient.leases + sed -e :a -e '$q;N;17,$D;ba' /var/lib/dhclient/dhclient-$1.leases } # Make compatible with older versions of init-functions @@ -25,7 +25,7 @@ is_true() { - [ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ] || + [ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ] || [ "$1" = "y" ] || [ "$1" = "t" ] } @@ -33,9 +33,9 @@ up) log_info_msg "\nStarting dhclient on the $1 interface..." - /sbin/dhclient $1 $DHCP_START + exec /sbin/dhclient -lf /var/lib/dhclient/dhclient-$1.leases -pf /var/run/dhclient-$1.pid $DHCP_START $1 - if [ "$?" != "0" ]; then + if [ "$?" != "0" ]; then log_failure_msg2 exit 1 fi @@ -43,19 +43,19 @@ # Print the assigned settings if requested if is_true "$PRINTIP" -o is_true "$PRINTALL"; then # Get info from dhclient.leases file - + IPADDR=`getipstats | grep "fixed-address" | \ sed 's/ fixed-address //' | \ sed 's/\;//'` - + NETMASK=`getipstats | grep "subnet-mask" | \ sed 's/ option subnet-mask //' | \ sed 's/\;//'` - + GATEWAY=`getipstats | grep "routers" | \ sed 's/ option routers //' | \ sed 's/\;//'` - + DNS=`getipstats | grep "domain-name-servers" | \ sed 's/ option domain-name-servers //' | \ sed 's/\;//' | sed 's/,/ and /'` @@ -79,14 +79,8 @@ down) log_info_msg "Stopping dhclient on the $1 interface..." - if [ -z "$DHCP_STOP" ]; then - # This breaks multiple interfaces please provide - # the correct stop arguments. - killproc dhclient - else - /sbin/dhclient $1 $DHCP_STOP - evaluate_retval - fi + exec /sbin/dhclient -r -lf /var/lib/dhclient/dhclient-$1.leases -pf /var/run/dhclient-$1.pid $DHCP_STOP $1 + evaluate_retval ;; *) Added: trunk/bootscripts/blfs/sysconfig/dhcpd =================================================================== --- trunk/bootscripts/blfs/sysconfig/dhcpd (rev 0) +++ trunk/bootscripts/blfs/sysconfig/dhcpd 2012-08-14 22:00:47 UTC (rev 10519) @@ -0,0 +1,11 @@ +# Begin /etc/sysconfig/dhcpd + +# On which interfaces should the DHCP Server (dhcpd) serve DHCP requests? +# Separate multiple interfaces with spaces, e.g. "eth0 eth1". +INTERFACES="" + +# Additional options that you want to pass to the DHCP Server Daemon? +OPTIONS="" + +# End /etc/sysconfig/dhcpd + -- http://linuxfromscratch.org/mailman/listinfo/blfs-book FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
