Changeset 63f1942 for BOOK/network
- Timestamp:
- Jun 23, 2014, 8:42:03 PM (10 years ago)
- Branches:
- clfs-3.0.0-systemd, master, systemd
- Children:
- d34599a
- Parents:
- f99afd3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOOK/network/common/systemd-network.xml
rf99afd3 r63f1942 11 11 <title>Networking Configuration with Systemd-networkd</title> 12 12 13 <sect2 role=" static">14 <title> Creating the Static Network Interface Configuration Files</title>13 <sect2 role="interface-config"> 14 <title>Network Interface Configuration</title> 15 15 16 16 <note><para>Udev may assign random Network Card Interface names 17 17 for some network cards such as enp2s1. If you are not sure what 18 18 your Network Card Interface name is, you can always run 19 <command>ip l</command> after you have booted your system. It is important that the <envar>Name</envar> variable in <filename>/etc/systemd/network</filename> contain the correct Network Card Interface name (e.g. 20 <envar>Name=enp2s1</envar> or 19 <command>ip l</command> after you have booted your system. It is important 20 that the <envar>Name</envar> variable in 21 <filename>/etc/systemd/network</filename> contain the correct Network Card 22 Interface name (e.g. <envar>Name=enp2s1</envar> or 21 23 <envar>Name=eth0</envar>) or systemd will fail to bring 22 24 up your network interface.</para></note> 23 25 24 <para><command>systemd-networkd</command> uses <filename>/etc/system/network</filename> for configuration files. Refer to systemd.network(5) and systemd.netdev(5). Configure a network interface with a config file. Adjust Name= as required:</para> 26 <sect3 role="static"> 27 <title>Static Network Interface Configuration</title> 25 28 26 <screen><userinput>cd /etc/systemd/network && 29 <para><command>systemd-networkd</command> uses 30 <filename>/etc/system/network</filename> for configuration files. Refer 31 to systemd.network(5) and systemd.netdev(5). Configure a network 32 interface with a config file. Adjust Name= as required:</para> 33 34 <screen><userinput>cd /etc/systemd/network && 27 35 cat > static.network << "EOF" 28 36 [Match] … … 34 42 EOF</userinput></screen> 35 43 36 <para os="var-ob">The values of these variables must be changed in every37 file to match the proper setup.</para>44 <para os="var-ob">The values of these variables must be changed in every 45 file to match the proper setup.</para> 38 46 39 <para os="var-i">The <envar>Name</envar> variable defines the interface40 name, for example, eth0. It is required for all network device configuration41 files.</para>47 <para os="var-i">The <envar>Name</envar> variable defines the interface 48 name, for example, eth0. It is required for all network device 49 configuration files.</para> 42 50 43 <para>The <envar>Gateway</envar> variable should contain the default44 gateway IP address, if one is present. If not, then comment out the45 variable entirely.</para>51 <para>The <envar>Gateway</envar> variable should contain the default 52 gateway IP address, if one is present. If not, then comment out the 53 variable entirely.</para> 46 54 47 <para>For more information see the <command>systemd.netdev</command> man page.</para>55 <para>For more information see the <command>systemd.netdev</command> man page.</para> 48 56 49 </sect2>57 </sect3> 50 58 51 <sect2role="dhcp">52 <title>Connecting to a network with DHCP</title>59 <sect3 role="dhcp"> 60 <title>Connecting to a network with DHCP</title> 53 61 54 <para><command>systemd-networkd</command> uses <filename>/etc/systemd/network</filename> for configuration files. Refer to <filename>systemd.network(5)</filename> and <filename>systemd.netdev(5)</filename>. Configure a network interface with a config file. Adjust Name= as required:</para> 62 <para><command>systemd-networkd</command> uses 63 <filename>/etc/systemd/network</filename> for configuration files. Refer 64 to <filename>systemd.network(5)</filename> and 65 <filename>systemd.netdev(5)</filename>. Configure a network interface 66 with a config file. Adjust Name= as required:</para> 55 67 56 68 <screen><userinput>cd /etc/systemd/network && … … 63 75 EOF</userinput></screen> 64 76 65 <para><command>systemd-networkd</command> will automatically configure <filename>/run/systemd/network/resolv.conf</filename> when using DHCP. If you did not manually create <filename>/etc/resolv.conf</filename>, create a symlink:</para> 77 <para><command>systemd-networkd</command> will automatically configure 78 <filename>/run/systemd/network/resolv.conf</filename> when using DHCP. 79 If you did not manually create <filename>/etc/resolv.conf</filename>, 80 create a symlink:</para> 66 81 67 82 <screen><userinput>ln -sv /run/systemd/network/resolv.conf /etc</userinput></screen> 83 84 </sect3> 85 86 </sect2> 87 88 <sect2 role="timesyncd"> 89 <title>Using Timesyncd</title> 90 91 <para>Systemd includes a simple NTP client daemon, 92 <command>systemd-timesyncd</command>, though it is disabled by 93 default. If you want to enable it, you will first need to add a required 94 user and group:</para> 95 96 <screen><userinput>groupadd -g &gid-systemd-timesync; systemd-timesync 97 useradd -g systemd-timesync -u &uid-systemd-timesync; -d /dev/null -s /bin/false systemd-timesync</userinput></screen> 98 99 <para>Then, actually enable <command>systemd-timesyncd</command> so that 100 it will run on system boot:</para> 101 102 <screen><userinput>systemctl enable systemd-timesyncd</userinput></screen> 103 104 <para>You can configure <command>systemd-timesyncd</command> by editing 105 <filename>/etc/systemd/timesyncd.conf</filename>.</para> 68 106 69 107 <para>Continue to <xref linkend="chapter-bootable"/>.</para>
Note:
See TracChangeset
for help on using the changeset viewer.