Ignore:
Timestamp:
02/15/2013 09:14:37 PM (11 years ago)
Author:
Krejzi <krejzi@…>
Branches:
7.5-systemd, 7.6-systemd, 7.7-systemd, 7.8-systemd, 7.9-systemd
Children:
b588d62
Parents:
4a4e017
Message:

Move Chapter 7 in place for Systemd.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/systemd/BOOK@10159 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter07/network.xml

    r4a4e017 rf3317d4  
    1717  <para>This section only applies if a network card is to be
    1818  configured.</para>
    19 
    20   <para>If a network card will not be used, there is likely no need to create
    21   any configuration files relating to network cards. If that is the case, you
    22   will need to remove the <filename class="symlink">network</filename> symlinks
    23   from all run-level directories (<filename
    24   class="directory">/etc/rc.d/rc*.d</filename>) after the bootscripts are
    25   installed in <xref linkend="ch-scripts-bootscripts"/>.</para>
    26 
    27   <sect2 id='stable-net-names'>
    28     <title>Creating stable names for network interfaces</title>
    29 
    30     <para>If there is only one network interface in the system to be
    31     configured, this section is optional, although it will never be wrong to do
    32     it.  In many cases (e.g. a laptop with a wireless and a wired interface),
    33     accomplishing the configuration in this section is necessary.</para>
    34 
    35     <para>With Udev and modular network drivers, the network interface numbering
    36     is not persistent across reboots by default, because the drivers are loaded
    37     in parallel and, thus, in random order. For example, on a computer having
    38     two network cards made by Intel and Realtek, the network card manufactured
    39     by Intel may become <filename class="devicefile">eth0</filename> and the
    40     Realtek card becomes  <filename class="devicefile">eth1</filename>. In some
    41     cases, after a reboot the cards get renumbered the other way around. To
    42     avoid this, Udev comes with a script and some rules to assign stable names
    43     to network cards based on their MAC address.</para>
    44 
    45     <para>The rules were pre-generated in the build instructions for
    46     <application>udev (systemd)</application> in the last chapter.  Inspect the
    47     <filename>/etc/udev/rules.d/70-persistent-net.rules</filename> file, to
    48     find out which name was assigned to which network device:</para>
    49 
    50 <screen role="nodump"><userinput>cat /etc/udev/rules.d/70-persistent-net.rules</userinput></screen>
    51 
    52     <note><para>In some cases such as when MAC addresess have been assigned to
    53     a network card manually or in a virtual environment such as Xen,
    54     the network rules file may not have been generated because addresses
    55     are not consistently assigned.  In these cases, just continue to
    56     the next section.</para></note>
    57 
    58     <para>The file begins with a comment block followed by two lines for each
    59     NIC. The first line for each NIC is a commented description showing its
    60     hardware IDs (e.g. its PCI vendor and device IDs, if it's a PCI card),
    61     along with its driver in parentheses, if the driver can be found. Neither
    62     the hardware ID nor the driver is used to determine which name to give an
    63     interface; this information is only for reference. The second line is the
    64     Udev rule that matches this NIC and actually assigns it a name.</para>
    65 
    66     <para>All Udev rules are made up of several keys, separated by commas and
    67     optional whitespace. This rule's keys and an explanation of each of them
    68     are as follows:</para>
    69 
    70     <itemizedlist>
    71       <listitem>
    72         <para><literal>SUBSYSTEM=="net"</literal> - This tells Udev to ignore
    73         devices that are not network cards.</para>
    74       </listitem>
    75       <listitem>
    76         <para><literal>ACTION=="add"</literal> - This tells Udev to ignore this
    77         rule for a uevent that isn't an add ("remove" and "change" uevents also
    78         happen, but don't need to rename network interfaces).</para>
    79       </listitem>
    80       <listitem>
    81         <para><literal>DRIVERS=="?*"</literal> - This exists so that Udev will
    82         ignore VLAN or bridge sub-interfaces (because these sub-interfaces do
    83         not have drivers). These sub-interfaces are skipped because the name
    84         that would be assigned would collide with their parent devices.</para>
    85       </listitem>
    86       <listitem>
    87         <para><literal>ATTR{address}</literal> - The value of this key is the
    88         NIC's MAC address.</para>
    89       </listitem>
    90       <listitem>
    91         <para><literal>ATTR{type}=="1"</literal> - This ensures the rule only
    92         matches the primary interface in the case of certain wireless drivers,
    93         which create multiple virtual interfaces. The secondary interfaces are
    94         skipped for the same reason that VLAN and bridge sub-interfaces are
    95         skipped: there would be a name collision otherwise.</para>
    96       </listitem>
    97       <listitem>
    98         <para><literal>KERNEL=="eth*"</literal> - This key was added to the
    99         Udev rule generator to handle machines that have multiple network
    100         interfaces, all with the same MAC address (the PS3 is one such
    101         machine).  If the independent interfaces have different basenames,
    102         this key will allow Udev to tell them apart.  This is generally not
    103         necessary for most Linux From Scratch users, but does not hurt.</para>
    104       </listitem>
    105       <listitem>
    106         <para><literal>NAME</literal> - The value of this key is the name that
    107         Udev will assign to this interface.</para>
    108       </listitem>
    109     </itemizedlist>
    110 
    111     <para>The value of <literal>NAME</literal> is the important part. Make sure
    112     you know which name has been assigned to each of your network cards before
    113     proceeding, and be sure to use that <literal>NAME</literal> value when
    114     creating your configuration files below.</para>
    115 
    116   </sect2>
    11719
    11820  <sect2>
Note: See TracChangeset for help on using the changeset viewer.