Changeset 7c56ece for networking/connect
- Timestamp:
- 03/23/2020 09:46:15 PM (4 years ago)
- Branches:
- 10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, lazarus, lxqt, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
- Children:
- 2aa0f3b
- Parents:
- bb65a3c
- Location:
- networking/connect
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
networking/connect/connect.xml
rbb65a3c r7c56ece 16 16 <title>Connecting to a Network</title> 17 17 18 <para>The LFS book covers setting up networking by connecting to a LAN 18 <para> 19 The LFS book covers setting up networking by connecting to a LAN 19 20 with a static IP address. There are other methods used to obtain an IP 20 21 address and connect to a LAN and other networks (such as the Internet). 21 22 The most popular methods (DHCP and PPP) are covered in this chapter.</para> 22 23 23 <para>DHCP stands for Dynamic Host Configuration Protocol. It is a protocol 24 used by many sites to automatically provide information such as IP addresses, 25 subnet masks and routing information to computers. If your network uses 26 DHCP, you will need a DHCP client in order to connect to it.</para> 27 28 <para>PPP stands for Point-to-Point Protocol. It is a data link protocol 29 commonly used for establishing authenticated IP connections over 30 a phone line with a modem, or over radio waves with a cellular phone. There 31 is also a variant (PPPoE) that works over Ethernet and is used by cable 32 providers to authenticate the Internet connections.</para> 33 24 <para> 25 DHCP stands for Dynamic Host Configuration Protocol. It is a protocol used 26 by many sites to automatically provide information such as IP addresses, 27 subnet masks and routing information to computers. If your network uses 28 DHCP, you will need a DHCP client in order to connect to it. 29 </para> 30 <!-- we do not include ppp 31 <para> 32 PPP stands for Point-to-Point Protocol. It is a data link protocol 33 commonly used for establishing authenticated IP connections over 34 a phone line with a modem, or over radio waves with a cellular phone. There 35 is also a variant (PPPoE) that works over Ethernet and is used by cable 36 providers to authenticate the Internet connections. 37 </para> 38 --> 34 39 <!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ppp.xml"/> --> 35 40 <!-- systemd only --> -
networking/connect/dhcpcd.xml
rbb65a3c r7c56ece 30 30 <title>Introduction to dhcpcd</title> 31 31 32 <para><application>dhcpcd</application> is an implementation of the 33 DHCP client specified in RFC2131. A DHCP client is useful for connecting 34 your computer to a network which uses DHCP to assign network 35 addresses. dhcpcd strives to be a fully featured, yet very lightweight 36 DHCP client.</para> 32 <para> 33 <application>dhcpcd</application> is an implementation of the 34 DHCP client specified in RFC2131. A DHCP client is useful for connecting 35 your computer to a network which uses DHCP to assign network 36 addresses. dhcpcd strives to be a fully featured, yet very lightweight 37 DHCP client. 38 </para> 37 39 38 40 &lfs91_checked; … … 41 43 <itemizedlist spacing="compact"> 42 44 <listitem> 43 <para>Download (HTTP): <ulink url="&dhcpcd-download-http;"/></para> 44 </listitem> 45 <listitem> 46 <para>Download (FTP): <ulink url="&dhcpcd-download-ftp;"/></para> 47 </listitem> 48 <listitem> 49 <para>Download MD5 sum: &dhcpcd-md5sum;</para> 50 </listitem> 51 <listitem> 52 <para>Download size: &dhcpcd-size;</para> 53 </listitem> 54 <listitem> 55 <para>Estimated disk space required: &dhcpcd-buildsize;</para> 56 </listitem> 57 <listitem> 58 <para>Estimated build time: &dhcpcd-time;</para> 45 <para> 46 Download (HTTP): <ulink url="&dhcpcd-download-http;"/> 47 </para> 48 </listitem> 49 <listitem> 50 <para> 51 Download (FTP): <ulink url="&dhcpcd-download-ftp;"/> 52 </para> 53 </listitem> 54 <listitem> 55 <para> 56 Download MD5 sum: &dhcpcd-md5sum; 57 </para> 58 </listitem> 59 <listitem> 60 <para> 61 Download size: &dhcpcd-size; 62 </para> 63 </listitem> 64 <listitem> 65 <para> 66 Estimated disk space required: &dhcpcd-buildsize; 67 </para> 68 </listitem> 69 <listitem> 70 <para> 71 Estimated build time: &dhcpcd-time; 72 </para> 59 73 </listitem> 60 74 </itemizedlist> … … 64 78 <bridgehead renderas="sect4">Optional</bridgehead> 65 79 <para role="optional"> 66 67 68 69 80 <xref linkend="llvm"/> (with Clang), 81 <xref linkend="ntp"/>, 82 <ulink url="https://chrony.tuxfamily.org/">chronyd</ulink>, and 83 <ulink url="https://github.com/thkukuk/ypbind-mt/">ypbind</ulink> 70 84 </para> 71 85 … … 78 92 <title>Installation of dhcpcd</title> 79 93 80 <para>Install <application>dhcpcd</application> by running the following 81 commands:</para> 94 <para> 95 Install <application>dhcpcd</application> by running the following 96 commands: 97 </para> 82 98 83 99 <screen><userinput>./configure --libexecdir=/lib/dhcpcd \ … … 85 101 make</userinput></screen> 86 102 87 <para>To test the results, issue: <command>make test</command>.</para> 88 89 <para>Now, as the <systemitem class="username">root</systemitem> user:</para> 103 <para> 104 To test the results, issue: <command>make test</command>. 105 </para> 106 107 <para> 108 Now, as the <systemitem class="username">root</systemitem> user: 109 </para> 90 110 91 111 <screen role='root'><userinput>make install</userinput></screen> 92 112 93 113 <!-- 94 <para>By default, a plain text lease info file isn't created but the 95 <application>dhcpcd</application> provides a hook which can be used for creating 96 such a file. Install the hook by running the following 97 commands as the <systemitem class="username">root</systemitem> user:</para> 114 <para> 115 By default, a plain text lease info file isn't created but the 116 <application>dhcpcd</application> provides a hook which can be used for 117 creating such a file. Install the hook by running the following commands 118 as the <systemitem class="username">root</systemitem> user: 119 </para> 98 120 99 121 <screen role='root'><userinput>sed -i "s;/var/lib;/run;g" dhcpcd-hooks/50-dhcpcd-compat && … … 133 155 <title>Config Files</title> 134 156 135 <para><filename>/etc/dhcpcd.conf</filename></para> 157 <para> 158 <filename>/etc/dhcpcd.conf</filename> 159 </para> 136 160 137 161 <indexterm zone="dhcpcd dhcpcd-config"> … … 144 168 <title>General Configuration Information</title> 145 169 146 <para>To configure <command>dhcpcd</command>, you need to first install 147 the network service script, 148 <filename>/lib/services/dhcpcd</filename> 149 included in the <xref linkend="bootscripts"/> package 150 (as user <systemitem class="username">root</systemitem>):</para> 170 <para> 171 To configure <command>dhcpcd</command>, you need to first install 172 the network service script, 173 <filename>/lib/services/dhcpcd</filename> 174 included in the <xref linkend="bootscripts"/> package 175 (as user <systemitem class="username">root</systemitem>): 176 </para> 151 177 152 178 <indexterm zone="dhcpcd dhcpcd-init"> … … 156 182 <screen role='root'><userinput>make install-service-dhcpcd</userinput></screen> 157 183 158 <para>Whenever <command>dhcpcd</command> configures or shuts down 159 a network interface, it executes hook scripts. For more details 160 about those scripts, see the <command>dhcpcd-run-hooks</command> and 161 <command>dhcpcd</command> man pages.</para> 162 163 <para id="dhcpcd-config2">Finally, as the <systemitem 164 class="username">root</systemitem> user create the 165 <filename>/etc/sysconfig/ifconfig.eth0</filename> 166 configuration file using the following commands. Adjust appropriately 167 for additional interfaces:</para> 184 <note> 185 <para id="dhcpcd-config3"> 186 The default for <command>dhcpcd</command> is to set the hostname 187 and mtu. It also overwrites <filename>/etc/resolv.conf </filename> 188 and <filename>/etc/ntp.conf</filename>. These 189 modifications to system files are done by hooks which are stored in 190 <filename class="directory">/lib/dhcpcd/dhcpcd-hooks</filename>. 191 Setup <command>dhcpcd</command> by removing or adding hooks from/to 192 that directory. The execution of hooks can be disabled by using 193 the <option>--nohook</option> (<option>-C</option>) command line 194 option or by the <option>nohook</option> option in the 195 <filename>/etc/dhcpcd.conf</filename> file. 196 </para> 197 </note> 198 199 <para id="dhcpcd-config2"> 200 Finally, as the <systemitem class="username">root</systemitem> user 201 create the <filename>/etc/sysconfig/ifconfig.eth0</filename> 202 configuration file using the following commands. Adjust appropriately 203 for additional interfaces: 204 </para> 168 205 169 206 <indexterm zone="dhcpcd dhcpcd-config2"> … … 179 216 EOF</userinput></screen> 180 217 181 <para>For more information on the appropriate <envar>DHCP_START</envar> and 182 <envar>DHCP_STOP</envar> values, examine the man page for 183 <command>dhcpcd</command>.</para> 184 185 <note> 186 187 <para id="dhcpcd-config3">The default behavior of 188 <command>dhcpcd</command> sets the hostname and mtu settings. It also 189 overwrites <filename>/etc/resolv.conf</filename> and 190 <filename>/etc/ntp.conf</filename>. 191 192 These modifications to system files and settings on system 193 configuration files are done by hooks which are stored in <filename 194 class="directory">/lib/dhcpcd/dhcpcd-hooks</filename>. 195 196 Setup <command>dhcpcd</command> by removing or adding hooks from/to 197 that directory. The execution of hooks can be disabled by using the 198 <option>--nohook</option> (<option>-C</option>) command line option or 199 by the <option>nohook</option> option in the 200 <filename>/etc/dhcpcd.conf</filename> file.</para> 201 202 <para>Review the <command>dhcpcd</command> man page for switches to add 203 to the <envar>DHCP_START</envar> value.</para> 204 205 </note> 218 <para> 219 For more information on the appropriate <envar>DHCP_START</envar> and 220 <envar>DHCP_STOP</envar> values, examine the man page for 221 <command>dhcpcd</command>. 222 </para> 206 223 207 224 <indexterm zone="dhcpcd dhcpcd-config3"> … … 213 230 <title>Configuration Information: fixed ip</title> 214 231 215 <para id="dhcpcd-config4">Although not usual, it is possible that you need 232 <para id="dhcpcd-config4"> 233 Although not usual, it is possible that you need 216 234 to configure <application>dhcpcd</application> to use a fixed ip. Here, 217 235 we give an example. As the … … 219 237 <filename>/etc/sysconfig/ifconfig.eth0</filename> configuration file 220 238 using the following commands. Adjust appropriately for additional 221 interfaces and for the actual ip and router you need:</para> 239 interfaces and for the actual ip and router you need: 240 </para> 222 241 223 242 <indexterm zone="dhcpcd dhcpcd-config4"> … … 225 244 </indexterm> 226 245 227 <screen role=' root'><userinput>cat > /etc/sysconfig/ifconfig.eth0 << "EOF"246 <screen role='nodump'><userinput>cat > /etc/sysconfig/ifconfig.eth0 << "EOF" 228 247 <literal>ONBOOT="yes" 229 248 IFACE="eth0" … … 233 252 EOF</userinput></screen> 234 253 235 <para>You can either use DNS servers in 254 <para> 255 You can either use DNS servers in 236 256 <filename>/etc/resolv.conf</filename> from another system, your 237 257 preferred servers, or just the example 238 <filename>/etc/resolv.conf.head</filename> file below as is:</para> 239 240 <screen role='root'><userinput>cat > /etc/resolv.conf.head << "EOF" 258 <filename>/etc/resolv.conf.head</filename> file below as is: 259 </para> 260 261 <screen role='nodump'><userinput>cat > /etc/resolv.conf.head << "EOF" 241 262 <literal># OpenDNS servers 242 263 nameserver 208.67.222.222 … … 263 284 </indexterm> 264 285 265 <para>266 Whenever <command>dhcpcd</command> configures or shuts down267 a network interface, it executes hook scripts. For more details268 about those scripts, see the <command>dhcpcd-run-hooks</command> and269 <command>dhcpcd</command> man pages.270 </para>271 272 286 <note> 273 <para id="dhcpcd-config5">The default behavior of 274 <command>dhcpcd</command> sets the hostname and mtu settings. It also 275 overwrites <filename>/etc/resolv.conf</filename> and 276 <filename>/etc/ntp.conf</filename>. 277 278 These modifications to system files and settings on system 279 configuration files are done by hooks which are stored in <filename 280 class="directory">/lib/dhcpcd/dhcpcd-hooks</filename>. 281 282 Setup <command>dhcpcd</command> by removing or adding hooks from/to 283 that directory. The execution of hooks can be disabled by using the 284 <option>--nohook</option> (<option>-C</option>) command line option or 285 by the <option>nohook</option> option in the 286 <filename>/etc/dhcpcd.conf</filename> file.</para> 287 <para id="dhcpcd-config5"> 288 The default behavior of <command>dhcpcd</command> is to set the 289 hostname and the mtu. It also overwrites <filename>/etc/resolv.conf 290 </filename> and <filename>/etc/ntp.conf</filename>. These 291 modifications to system configuration files are done by hooks which 292 are stored in <filename class="directory"> 293 /lib/dhcpcd/dhcpcd-hooks</filename>. Setup <command>dhcpcd</command> 294 by removing or adding hooks from/to that directory. The execution 295 of hooks can be disabled by using the <option>--nohook</option> 296 (<option>-C</option>) command line option or by the 297 <option>nohook</option> option in the <filename>/etc/dhcpcd.conf 298 </filename> file. 299 </para> 287 300 </note> 288 301 … … 291 304 </indexterm> 292 305 293 <note>294 <para>295 Make sure that you disable the <command>systemd-networkd</command>296 service or configure it not to manage the interfaces you want to manage297 with <application>dhcpcd</application>.298 </para>299 </note>306 <note> 307 <para> 308 Make sure that you disable the <command>systemd-networkd</command> 309 service or configure it not to manage the interfaces you want to 310 manage with <application>dhcpcd</application>. 311 </para> 312 </note> 300 313 301 314 <para> … … 347 360 <term><command>dhcpcd</command></term> 348 361 <listitem> 349 <para>is an implementation of the DHCP client specified 350 in RFC2131.</para> 362 <para> 363 is an implementation of the DHCP client specified in RFC2131. 364 </para> 351 365 <indexterm zone="dhcpcd dhcpcd-prog"> 352 366 <primary sortas="b-dhcpcd">dhcpcd</primary>
Note:
See TracChangeset
for help on using the changeset viewer.