diff options
author | Bruce Dubbs <bdubbs@linuxfromscratch.org> | 2011-08-02 02:15:42 +0000 |
---|---|---|
committer | Bruce Dubbs <bdubbs@linuxfromscratch.org> | 2011-08-02 02:15:42 +0000 |
commit | 0cda8984a835f37a573c0e2eb31676ff52773d16 (patch) | |
tree | 15144b985754fc6ac96540d091ef7682694c5781 /chapter07/network.xml | |
parent | 75fe59983cbfe4a5e5cec2a161cda0491162908c (diff) |
Rewrite bootscripts and Chaper 7
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@9574 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter07/network.xml')
-rw-r--r-- | chapter07/network.xml | 66 |
1 files changed, 42 insertions, 24 deletions
diff --git a/chapter07/network.xml b/chapter07/network.xml index 34c2679df..9556c0c05 100644 --- a/chapter07/network.xml +++ b/chapter07/network.xml @@ -8,7 +8,7 @@ <sect1 id="ch-scripts-network"> <?dbhtml filename="network.html"?> - <title>Configuring the network Script</title> + <title>General Network Configuration</title> <indexterm zone="ch-scripts-network"> <primary sortas="d-network">network</primary> @@ -26,6 +26,11 @@ <sect2> <title>Creating stable names for network interfaces</title> + <para>If there is only one network interface in the system to be + configured, this section is optional, although it will never be wrong to do + it. In many cases (e.g. a laptop with a wireless and a wired interface), + accomplishing the configuration in this section is necessary.</para> + <para>With Udev and modular network drivers, the network interface numbering is not persistent across reboots by default, because the drivers are loaded in parallel and, thus, in random order. For example, on a computer having @@ -112,21 +117,22 @@ done</userinput></screen> <title>Creating Network Interface Configuration Files</title> <para>Which interfaces are brought up and down by the network script - depends on the files and directories in the <filename - class="directory">/etc/sysconfig/network-devices</filename> hierarchy. - This directory should contain a sub-directory for each interface to be - configured, such as <filename>ifconfig.xyz</filename>, where - <quote>xyz</quote> is a network interface name. Inside this directory - would be files defining the attributes to this interface, such as its IP - address(es), subnet masks, and so forth.</para> - - <para>The following command creates a sample <filename>ipv4</filename> - file for the <emphasis>eth0</emphasis> device:</para> - -<screen><userinput>cd /etc/sysconfig/network-devices -mkdir -v ifconfig.eth0 -cat > ifconfig.eth0/ipv4 << "EOF" + depends on the files in <filename + class="directory">/etc/sysconfig/</filename>. This directory should + contain a file for each interface to be configured, such as + <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is is + meaningful to the administrator such as the device name (e.g. eth0). + Inside this file are attributes to this interface, such as its IP + address(es), subnet masks, and so forth. It is necessary that + the stem of the filename be <emphasis>ifconfig</emphasis>.</para> + + <para>The following command creates a sample file for the + <emphasis>eth0</emphasis> device with a static IP address:</para> + +<screen><userinput>cd /etc/sysconfig/ +cat > ifconfig.eth0 << "EOF" <literal>ONBOOT=yes +IFACE=eth0 SERVICE=ipv4-static IP=192.168.1.1 GATEWAY=192.168.1.2 @@ -135,19 +141,25 @@ BROADCAST=192.168.1.255</literal> EOF</userinput></screen> <para>The values of these variables must be changed in every file to match - the proper setup. If the <envar>ONBOOT</envar> variable is set to - <quote>yes</quote> the network script will bring up the Network Interface - Card (NIC) during booting of the system. If set to anything but - <quote>yes</quote> the NIC will be ignored by the network script and not - be brought up.</para> + the proper setup.</para> + + <para>If the <envar>ONBOOT</envar> variable is set to <quote>yes</quote> the + network script will bring up the Network Interface Card (NIC) during + booting of the system. If set to anything but <quote>yes</quote> the NIC + will be ignored by the network script and not be automatically brought up. + The interface can be manually started or stopped with the + <command>ifup</command> and <command>ifdown</command> commands.</para> + + <para>The <envar>IFACE</envar> variable defines the interface name, + for example, eth0. It is required for all network device configuration + files. </para> <para>The <envar>SERVICE</envar> variable defines the method used for obtaining the IP address. The LFS-Bootscripts package has a modular IP assignment format, and creating additional files in the <filename - class="directory">/etc/sysconfig/network-devices/services</filename> - directory allows other IP assignment methods. This is commonly used for - Dynamic Host Configuration Protocol (DHCP), which is addressed in the - BLFS book.</para> + class="directory">/lib/boot/</filename> directory allows other IP + assignment methods. This is commonly used for Dynamic Host Configuration + Protocol (DHCP), which is addressed in the BLFS book.</para> <para>The <envar>GATEWAY</envar> variable should contain the default gateway IP address, if one is present. If not, then comment out the @@ -189,6 +201,10 @@ nameserver <replaceable><IP address of your secondary nameserver></replace # End /etc/resolv.conf</literal> EOF</userinput></screen> + <para>The <varname>domain</varname> statement can be omitted + or replaced with a <varname>search</varname> statement. See the man page for + resolv.conf for more details.</para> + <para>Replace <replaceable><IP address of the nameserver></replaceable> with the IP address of the DNS most appropriate for the setup. There will often be more than one entry (requirements demand secondary servers for @@ -196,6 +212,8 @@ EOF</userinput></screen> second <emphasis>nameserver</emphasis> line from the file. The IP address may also be a router on the local network.</para> + <note><para>The Google Public IPv4 DNS addresses are 8.8.8.8 and 8.8.4.4.</para></note> + </sect2> </sect1> |