Ignore:
Timestamp:
12/31/2015 09:09:13 AM (8 years ago)
Author:
DJ Lucas <dj@…>
Branches:
7.9-systemd
Children:
6e13139
Parents:
6eb40d4
Message:

Sync with trunk r10891, update to udev-1.10.6, update to systemd-228.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chapter07/network.xml

    r6eb40d4 r131c907  
    2323    <para>Starting with version 209, systemd ships a network configuration
    2424    daemon called <command>systemd-networkd</command> which can be used for
    25     basic network configuration.</para>
    26 
    27     <para>Configuration files for <command>systemd-networkd</command> can be
    28     placed in <filename class="directory">/usr/lib/systemd/network</filename>
    29     or <filename class="directory">/etc/systemd/network</filename>. Note that
    30     files in <filename class="directory">/etc/systemd/network</filename> have
     25    basic network configuration. Additionally, since version 213, DNS name
     26    resolution can be handled by <command>systemd-resolved</command> in place
     27    of a static <filename>/etc/resolv.conf</filename> file. Both services are
     28    enabled by defualt, and absolutely should not be disabled.</para>
     29
     30    <para>Configuration files for <command>systemd-networkd</command> (and
     31    <command>systemd-resolved</command>) can be placed in
     32    <filename class="directory">/usr/lib/systemd/network</filename>
     33    or <filename class="directory">/etc/systemd/network</filename>. Files in
     34    <filename class="directory">/etc/systemd/network</filename> have a
    3135    higher priority than the ones in
    32     <filename class="directory">/usr/lib/systemd/network</filename>.</para>
    33 
    34     <para>There are three types of configuration files:
     36    <filename class="directory">/usr/lib/systemd/network</filename>.
     37    There are three types of configuration files:
    3538    <filename class="extension">.link</filename>,
    3639    <filename class="extension">.netdev</filename> and
    3740    <filename class="extension">.network</filename> files. For detailed
    38     explanation about contents of the mentioned
    39     configuration files, consult <filename>systemd-link(5)</filename>,
     41    descriptions and example contents of these configuration files, consult
     42    the <filename>systemd-link(5)</filename>,
    4043    <filename>systemd-netdev(5)</filename> and
    4144    <filename>systemd-network(5)</filename> manual pages.</para>
     
    5053      <title>Static IP Configuration</title>
    5154
    52       <para>The command below creates a basic configuration file for
    53       Static IP setup:</para>
    54 
    55 <screen role="nodump"><userinput>cat &gt; /etc/systemd/network/10-static-eth0.network &lt;&lt; "EOF"
     55      <para>The command below creates a basic configuration file for a
     56      Static IP setup (using both systemd-networkd and
     57      systemd-resolved):</para>
     58
     59<screen role="nodump"><userinput>cat &gt; /etc/systemd/network/10-eth0-static.network &lt;&lt; "EOF"
    5660<literal>[Match]
    5761Name=eth0
     
    6367EOF</userinput></screen>
    6468
    65       <para>More than one DNS entry can be specified in the configuration file.</para>
     69      <para>Multiple DNS entries can be added if you have more than one DNS
     70      server.</para>
    6671
    6772    </sect3>
     
    7075      <title>DHCP Configuration</title>
    7176
    72       <para>The command below creates a basic configuration file for
     77      <para>The command below creates a basic configuration file for an IPv4
    7378      DHCP setup:</para>
    7479
    75 <screen role="nodump"><userinput>cat &gt; /etc/systemd/network/10-dhcp-eth0.network &lt;&lt; "EOF"
     80<screen role="nodump"><userinput>cat &gt; /etc/systemd/network/10-eth0-dhcp.network &lt;&lt; "EOF"
    7681<literal>[Match]
    7782Name=eth0
    7883
    7984[Network]
    80 DHCP=yes</literal>
    81 EOF</userinput></screen>
    82 
    83       <para>Note that <command>systemd-networkd</command> can only handle
    84       DHCPv4. DHCPv6 support is a work in progress.</para>
     85DHCP=ipv4</literal>
     86EOF</userinput></screen>
    8587
    8688    </sect3>
     
    102104    <filename>/etc/resolv.conf</filename>.</para>
    103105
    104     <para>If static <filename>/etc/resolv.conf</filename> is desired, create
    105     it by running the following command:</para>
     106    <sect3 id="resolv-conf-systemd-resoloved">
     107      <title>systemd-resolved Configuration</title>
     108
     109      <note><para>If using another means to configure your network
     110      interfaces (ex: ppp, network-manager, etc.), or if using any type of
     111      local resolver (ex: bind, dnsmasq, etc.), or any other software that
     112      generates an <filename>/etc/resolv.conf</filename> (ex: resolvconf), the
     113      <command>systemd-resolved</command> service should not be
     114      used.</para></note>
     115
     116      <para>When using <command>systemd-resolved</command> for DNS
     117      configuration, it is responsible for creating the
     118      <filename>/etc/resolv.conf</filename> file, which is placed in a
     119      non-standard location that is writable during early boot. In order to be
     120      used by other components of the system, it is necessary to create a
     121      symlink with the following command:</para>
     122
     123<screen><userinput>ln -sfv /run/systemd/resolve/resolv.conf /etc/resolv.conf</userinput></screen>
     124
     125      <para>This is required if you are specifying DNS entries in <filename
     126      class="extension">.network</filename> files or using the built in
     127      DHCP client to obtain DNS addresses.</para>
     128
     129    </sect3>
     130
     131    <sect3 id="resolv-conf-static">
     132      <title>Static resolv.conf Configuration</title>
     133
     134      <para>If a static <filename>/etc/resolv.conf</filename> is desired,
     135      create it by running the following command:</para>
    106136
    107137<screen role="nodump"><userinput>cat &gt; /etc/resolv.conf &lt;&lt; "EOF"
     
    115145EOF</userinput></screen>
    116146
    117     <para>The <varname>domain</varname> statement can be omitted
    118     or replaced with a <varname>search</varname> statement.  See the man page for
    119     resolv.conf for more details.</para>
    120 
    121     <para>Replace <replaceable>&lt;IP address of the nameserver&gt;</replaceable>
    122     with the IP address of the DNS most appropriate for the setup. There will
    123     often be more than one entry (requirements demand secondary servers for
    124     fallback capability). If you only need or want one DNS server, remove the
    125     second <emphasis>nameserver</emphasis> line from the file. The IP address
    126     may also be a router on the local network.</para>
    127 
    128     <note><para>The Google Public IPv4 DNS addresses are 8.8.8.8 and 8.8.4.4.</para></note>
    129 
    130     <para>When using <command>systemd-networkd</command> for network
    131     configuration, another daemon, <command>systemd-resolved</command>,
    132     is responsible for creating the <filename>/etc/resolv.conf</filename>
    133     file. It is, however, placed in a non-standard location which is
    134     writable since early boot, so it is necessary to create a symlink
    135     to it by running the following command:</para>
    136 
    137 <screen><userinput>ln -sfv /run/systemd/resolve/resolv.conf /etc/resolv.conf</userinput></screen>
    138 
    139     <para>This is required if you are specifying DNS entries in <filename
    140     class="extension">.network</filename> files or using the built in
    141     DHCP client to obtain DNS addresses.</para>
     147      <para>The <varname>domain</varname> statement can be omitted
     148      or replaced with a <varname>search</varname> statement.  See the man page
     149      for resolv.conf for more details.</para>
     150
     151      <para>Replace
     152      <replaceable>&lt;IP address of the nameserver&gt;</replaceable>
     153      with the IP address of the DNS most appropriate for the setup. There will
     154      often be more than one entry (requirements demand secondary servers for
     155      fallback capability). If you only need or want one DNS server, remove the
     156      second <emphasis>nameserver</emphasis> line from the file. The IP address
     157      may also be a router on the local network.</para>
     158
     159      <note><para>The Google Public IPv4 DNS addresses are
     160      <parameter>8.8.8.8</parameter> and <parameter>8.8.4.4</parameter>
     161      for IPv4, and <parameter>2001:4860:4860::8888</parameter> and
     162      <parameter>2001:4860:4860::8844</parameter> for IPv6.</para></note>
     163
     164    </sect3>
    142165
    143166  </sect2>
Note: See TracChangeset for help on using the changeset viewer.