Changeset 81fd230 for chapter07/network.xml
- Timestamp:
- 02/19/2005 10:16:42 PM (19 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.1, 6.1.1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- 3d31fc4
- Parents:
- 2f9131f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter07/network.xml
r2f9131f r81fd230 8 8 <?dbhtml filename="network.html"?> 9 9 10 <indexterm zone="ch-scripts-network"> 11 <primary sortas="d-network">network</primary> 12 <secondary>configuring</secondary></indexterm> 13 14 <para>This section only applies if a network card is to be 15 configured.</para> 16 17 <para>If a network card will not be used, there is likely no need to 18 create any configuration files relating to network cards. If that is 19 the case, remove the <filename class="symlink">network</filename> 20 symlinks from all run-level directories (<filename 21 class="directory">/etc/rc.d/rc*.d</filename>).</para> 10 22 11 23 <sect2> 12 24 <title>Creating Network Interface Configuration Files</title> 13 25 14 <para>The following command creates a sample <filename>ipv4</filename> file for the 15 <filename>eth0</filename> device:</para> 26 <!-- Edit Me --> 27 <para>Which interfaces are brought up and down by the network script 28 depends on the files and directories in the <filename 29 class="directory">/etc/sysconfig/network-devices</filename> hierarchy. 30 This directory should contain a directory for each interface to be configured, 31 such as <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is a 32 network interface name. Inside this directory would be files defining 33 the attributes to this interface, such as its IP address(es), subnet 34 masks, and so forth.</para> 35 <!-- --> 36 37 <para>If the <filename 38 class="directory">/etc/sysconfig/network-devices</filename> directory 39 is to be renamed or moved, make sure to edit the 40 <filename>/etc/sysconfig/rc</filename> file and update the 41 <quote>network_devices</quote> option by providing it with the new 42 path.</para> 43 44 <para>New files are created in this directory. The following 45 command creates a sample <filename>ipv4</filename> file for the 46 <emphasis>eth0</emphasis> device:</para> 16 47 17 48 <screen><userinput>cd /etc/sysconfig/network-devices && … … 26 57 EOF</userinput></screen> 27 58 59 <para>The values of these variables must be changed in every file to 60 match the proper setup. If the <envar>ONBOOT</envar> variable is 61 set to <quote>yes</quote> the network script will bring up the 62 Network Interface Card (NIC) during booting of the system. If set 63 to anything but <quote>yes</quote> the NIC will be ignored by the 64 network script and not brought up.</para> 65 66 <para>The <envar>SERVICE</envar> variable defines the method of 67 obtaining the IP address. The LFS bootscripts have a modular IP 68 assignment format, and creating additional files in the <filename 69 class="directory">/etc/sysconfig/network-devices/services</filename> 70 directory allows other IP assignment methods. This is commonly used 71 for Dynamic Host Configuration Protocol (DHCP), which is addressed in the BLFS book.</para> 72 73 <para>The <envar>GATEWAY</envar> variable should contain 74 the default gateway IP address, if one is present. If not, then comment out 75 the variable entirely.</para> 76 77 <para>The <envar>PREFIX</envar> variable needs to contain the 78 number of bits used in the subnet. Each octet in an IP address is 8 79 bits. If the subnet's netmask is 255.255.255.0, then it is using the 80 first three octets (24 bits) to specify the network number. If the 81 netmask is 255.255.255.240, it would be using the first 28 bits. 82 Prefixes longer than 24 bits are commonly used by DSL- and cable-based 83 Internet Service Providers (ISPs). In this example (PREFIX=24), the netmask 84 is 255.255.255.0. Adjust according to the specific subnet.</para> 85 28 86 </sect2> 29 87 30 88 <sect2 id="resolv.conf"> 31 89 <title>Creating the /etc/resolv.conf File</title> 90 <indexterm zone="resolv.conf"><primary sortas="e-/etc/resolv.conf">/etc/resolv.conf</primary></indexterm> 32 91 33 <para>Create the file by running the following:</para> 92 <para>If the system is going to be connected to the Internet, it will 93 need some means of Domain Name Service (DNS) name resolution to 94 resolve Internet domain names to IP addresses, and vice versa. This is 95 best achieved by placing the IP address of the DNS server, available 96 from the ISP or network administrator, into 97 <filename>/etc/resolv.conf</filename>. Create the file by running the 98 following:</para> 34 99 35 100 <screen><userinput>cat > /etc/resolv.conf << "EOF" … … 43 108 EOF</userinput></screen> 44 109 110 <para>Replace <replaceable>[IP address of the 111 nameserver]</replaceable> with the IP address of the DNS most 112 appropriate for the setup. There will often be more than one entry 113 (requirements demand secondary servers for fallback capability). If 114 you only need or want one DNS server, remove the second 115 <emphasis>nameserver</emphasis> line from the file. The IP address may 116 also be a router on the local network.</para> 45 117 </sect2> 46 118 47 119 </sect1> 120
Note:
See TracChangeset
for help on using the changeset viewer.