source: networking/connect/dhcp-client.xml@ a805e52

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since a805e52 was a805e52, checked in by Bruce Dubbs <bdubbs@…>, 12 years ago

Add a reference on maintaining a RAID system.
Minor updates to firewall script.
Fix instructions for creating dhclient version of ifconfig.eth0.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@9351 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 4.0 KB
RevLine 
[246c904]1<?xml version="1.0" encoding="ISO-8859-1"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[246c904]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
[275b1da]8<sect1 id="dhcp-client" xreflabel="DHCP-&dhcp-version; Client Configuration">
[59ed37f9]9 <?dbhtml filename="dhcpclient.html"?>
[4839c17]10
[59ed37f9]11 <sect1info>
12 <othername>$LastChangedBy$</othername>
13 <date>$Date$</date>
14 </sect1info>
[4839c17]15
[275b1da]16 <title>DHCP-&dhcp-version; Client Configuration</title>
[4839c17]17
[59ed37f9]18 <indexterm zone="dhcp-client">
19 <primary sortas="b-dhclient">dhclient</primary>
20 </indexterm>
[4839c17]21
[59ed37f9]22 <para>The <application>DHCP</application> package comes with
[893d9711]23 both a client (<command>dhclient</command>) and a server program for
24 using DHCP. If you want to install this package,
[bbdb0ff4]25 the instructions can be found at <xref linkend="dhcp"/>.
[893d9711]26 Note that if you only want to use the client, you
27 do <emphasis>not</emphasis> need to run the server and so do not need
[59ed37f9]28 the startup script and links provided for the server daemon.
[893d9711]29 You only need to run the DHCP server if you're providing
[59ed37f9]30 this service to a network, and it's likely that you'll know if that's the
31 case; if it isn't, don't run the server! Once you have installed the
32 package, return here for information on how to configure the client
33 (<command>dhclient</command>).</para>
[4839c17]34
[59ed37f9]35 <sect2 role="configuration">
36 <title>Configuring DHCP Client</title>
[4839c17]37
[893d9711]38 <para id="dhclient-service">To configure <command>dhclient</command>,
[59ed37f9]39 you need to first install the network service script,
[fa3e12e1]40 <filename>/lib/services/dhclient</filename>
[5254d12]41 included in the <xref linkend="bootscripts"/> package
[59ed37f9]42 (as <systemitem class="username">root</systemitem>):</para>
[4839c17]43
[59ed37f9]44 <indexterm zone="dhcp-client dhclient-service">
45 <primary sortas="f-dhclient">dhclient (service script)</primary>
46 </indexterm>
[4839c17]47
[59ed37f9]48<screen role='root'><userinput>make install-service-dhclient</userinput></screen>
[4839c17]49
[893d9711]50 <para id="dhclient-config1">Next, create the
[a805e52]51 <filename>/etc/sysconfig/ifconfig.eth0</filename>
[893d9711]52 configuration file with the following commands as the <systemitem
53 class="username">root</systemitem> user. Adjust as
[59ed37f9]54 necessary for additional interfaces:</para>
[4839c17]55
[59ed37f9]56 <indexterm zone="dhcp-client dhclient-config1">
[fa3e12e1]57 <primary sortas="e-etc-sysconfig-...-dhclient">/etc/sysconfig/ifconfig.eth0</primary>
[59ed37f9]58 </indexterm>
[4839c17]59
[a805e52]60<screen role='root'><userinput>cat &gt; /etc/sysconfig/ifconfig.eth0 &lt;&lt; "EOF"
[59ed37f9]61<literal>ONBOOT="yes"
[fa3e12e1]62IFACE="eth0"
[afa198d]63SERVICE="dhclient"
[fa3e12e1]64DHCP_START="<replaceable>&lt;add additional start parameters here&gt;</replaceable> eth0"
65DHCP_STOP="-r <replaceable>&lt;add additional stop parameters here&gt;</replaceable>"
[61e058b]66
67# Set PRINTIP="yes" to have the script print
68# the DHCP assigned IP address
69PRINTIP="no"
70
71# Set PRINTALL="yes" to print the DHCP assigned values for
72# IP, SM, DG, and 1st NS. This requires PRINTIP="yes".
73PRINTALL="no"</literal>
[59ed37f9]74EOF</userinput></screen>
[4839c17]75
[893d9711]76 <para>For more information on the appropriate
[4839c17]77 <envar>DHCP_START</envar> and <envar>DHCP_STOP</envar>
[59ed37f9]78 values, examine the man page for <command>dhclient</command>.</para>
[4839c17]79
[893d9711]80 <para id="dhclient-config2">Finally, you should create the
81 <filename>/etc/dhclient.conf</filename> file using the following commands
[4839c17]82 as the <systemitem class="username">root</systemitem> user:</para>
83
[59ed37f9]84 <indexterm zone="dhcp-client dhclient-config2">
85 <primary sortas="e-etc-dhclient.conf">/etc/dhclient.conf</primary>
86 </indexterm>
[4839c17]87
[59ed37f9]88 <note>
[893d9711]89 <para>You'll need to add a second interface definition to the file if you
[59ed37f9]90 have more than one interface.</para>
91 </note>
[4839c17]92
[59ed37f9]93<screen role='root'><userinput>cat &gt; /etc/dhclient.conf &lt;&lt; "EOF"
94<literal># dhclient.conf
[4839c17]95
[f45b1953]96interface "eth0"{
97prepend domain-name-servers 127.0.0.1;
98request subnet-mask, broadcast-address, time-offset, routers,
99 domain-name, domain-name-servers, host-name;
100require subnet-mask, domain-name-servers;
101}
[59ed37f9]102# end dhclient.conf</literal>
103EOF</userinput></screen>
[4839c17]104
[59ed37f9]105 </sect2>
[f45b1953]106
107</sect1>
Note: See TracBrowser for help on using the repository browser.