Subversion Repositories svn LFS-FR


Blame | Last modification | View Log | RSS feed

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
 "" [
 <!ENTITY % general-entities SYSTEM "../../general.ent">

<sect1 id="ch-network-static">
  <?dbhtml filename="network-static.html"?>

  <title>Static Networking Configuration</title>

    <title>Creating the Static 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></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 ${CLFS}/etc/sysconfig/network-devices &amp;&amp;
mkdir -v ifconfig.eth0 &amp;&amp;
cat &gt; ifconfig.eth0/ipv4 &lt;&lt; "EOF"

    <para os="var-ob">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>

    <para os="var-s">The <envar>SERVICE</envar> variable defines the method used for
    obtaining the IP address. The CLFS-Bootscripts package has a modular IP
    assignment format, and creating additional files in the <filename
    directory allows other IP assignment methods.</para>

    <para>The <envar>GATEWAY</envar> variable should contain the default
    gateway IP address, if one is present. If not, then comment out the
    variable entirely.</para>

    <para>The <envar>PREFIX</envar> variable needs to contain the number of
    bits used in the subnet. Each octet in an IP address is 8 bits. If the
    subnet's netmask is, then it is using the first three octets
    (24 bits) to specify the network number. If the netmask is,
    it would be using the first 28 bits.  Prefixes longer than 24 bits are
    commonly used by DSL and cable-based Internet Service Providers (ISPs).
    In this example (PREFIX=24), the netmask is Adjust the
    <envar>PREFIX</envar> variable according to your specific subnet.</para>

    <para>To configure another DHCP Interface, Follow <xref linkend="ch-network-dhcp"/>.</para>