Changeset 94cea1d for chapter07/network.xml
- Timestamp:
- 06/24/2017 07:33:48 PM (7 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- d414cb0
- Parents:
- b2a5112
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter07/network.xml
rb2a5112 r94cea1d 14 14 <primary sortas="d-network">network</primary> 15 15 <secondary>configuring</secondary></indexterm> 16 16 <!-- 17 17 <para>This section only applies if a network card is to be 18 18 configured.</para> … … 24 24 class="directory">/etc/rc.d/rc*.d</filename>) after the bootscripts are 25 25 installed in <xref linkend="ch-scripts-bootscripts"/>.</para> 26 26 --> 27 27 <sect2> 28 28 <title>Creating Network Interface Configuration Files</title> … … 32 32 class="directory">/etc/sysconfig/</filename>. This directory should 33 33 contain a file for each interface to be configured, such as 34 <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is required to35 be a Network Card Interface name (e.g. eth0). Inside this file are36 attributes to this interface, such as its IP address(es), subnet masks, and37 so forth. It is necessary that the stem of the filename be38 <emphasis>ifconfig</emphasis>.</para>34 <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> should describe 35 the network card. The interface name (e.g. eth0) is usually appropriate. 36 Inside this file are attributes to this interface, such as its IP 37 address(es), subnet masks, and so forth. It is necessary that the stem of 38 the filename be <emphasis>ifconfig</emphasis>.</para> 39 39 40 40 <note><para>If the procedure in the previous section was not used, Udev 41 41 will assign network card interface names based on system physical 42 42 characteristics such as enp2s1. If you are not sure what your interface 43 name is, you can always run <command>ip link</command> after you have 44 booted your system. Again, it is important that ifconfig.xyz is named 45 after correct network card interface name (e.g. ifconfig.enp2s1 or 46 ifconfig.eth0) or your network interface will not be initialized during 47 the boot process.</para></note> 43 name is, you can always run <command>ip link</command> or <command>ls 44 /sys/class/net</command> after you have booted your system. 45 </para></note> 48 46 49 47 <para>The following command creates a sample file for the … … 99 97 100 98 </sect2> 101 <!--102 <sect2 id="systemd-net-enable">103 <title>Configuring the Network Interface Card at boot (systemd)</title>104 105 <para>Enabling of the network interface card configuration106 in systemd is done per interface. To enable network interface card107 configuration at boot, run:</para>108 109 <screen><userinput>systemctl enable ifupdown@eth0</userinput></screen>110 111 <para>To disable a previously enabled network interface112 card configuration at boot, run:</para>113 114 <screen role="nodump"><userinput>systemctl disable ifupdown@eth0</userinput></screen>115 116 <para>To manually start the network interface card configuration,117 run:</para>118 119 <screen role="nodump"><userinput>systemctl start ifupdown@eth0</userinput></screen>120 121 <para>Replace eth0 with the correct network interface card122 name as described on the beginning of this page.</para>123 124 <note><para>These procedures require the configuration files as specified125 in the previous section.</para></note>126 127 <note><para>The network card can also be started or stopped128 with the traditional <command>ifup <device></command> or129 <command>ifdown <device></command> commands.</para></note>130 131 </sect2>132 133 <sect2 id="systemd2-net-enable">134 <title>Configuring the Network Interface Card for systemd-networkd</title>135 136 <para>An alternative way to configure a NIC when booting with with137 systemd is to create a configuration file recognized by the138 systemd-networkd daemon. To configure the device create a file similar139 to this:</para>140 141 <screen role="nodump"><userinput>cat > /etc/systemd/network/10-static-eth0.network << "EOF"142 [Match]143 Name=eth0144 145 [Network]146 Address=192.168.0.2/24147 Gateway=192.168.0.1148 EOF</userinput></screen>149 150 <para>You can use multiple .network files if desired. You can also specify151 DHCP=yes instead of the Address and Gateway settings. See the man page for152 systemd.network for more details,</para>153 154 <note><para>If this method is used, be sure to disable ifupdown@eth0 as155 described in the previous section (if it was enabled).</para></note>156 157 </sect2>158 -->159 99 <sect2 id="resolv.conf"> 160 100 <title>Creating the /etc/resolv.conf File</title> … … 164 104 </indexterm> 165 105 166 <para>If the system is going to be connected to the Internet, it will 167 need some means of Domain Name Service (DNS) name resolution to 168 resolve Internet domain names to IP addresses, and vice versa. This is 169 best achieved by placing the IP address of the DNS server, available 170 from the ISP or network administrator, into 106 <para>The system will need some means of obtaining Domain Name Service 107 (DNS) name resolution to resolve Internet domain names to IP addresses, and 108 vice versa. This is best achieved by placing the IP address of the DNS 109 server, available from the ISP or network administrator, into 171 110 <filename>/etc/resolv.conf</filename>. Create the file by running the 172 111 following:</para> … … 193 132 may also be a router on the local network.</para> 194 133 195 <note><para>The Google Public IPv4 DNS addresses are 8.8.8.8 and 8.8.4.4.</para></note> 134 <note> 135 <para>The Google Public IPv4 DNS addresses are 8.8.8.8 and 8.8.4.4.</para> 136 </note> 196 137 197 138 </sect2> … … 265 206 266 207 <screen><userinput>cat > /etc/hosts << "EOF" 267 <literal># Begin /etc/hosts (network card version)208 <literal># Begin /etc/hosts 268 209 269 210 127.0.0.1 localhost … … 274 215 ff02::2 ip6-allrouters 275 216 276 # End /etc/hosts (network card version)</literal>217 # End /etc/hosts</literal> 277 218 EOF</userinput></screen> 278 219 … … 283 224 network/system administrator and the machine will be connected to an 284 225 existing network). The optional alias name(s) can be omitted.</para> 285 226 227 <!-- This is not very useful 228 286 229 <para>If a network card is not going to be configured, create the 287 230 <filename>/etc/hosts</filename> file by running:</para> … … 297 240 298 241 # End /etc/hosts (no network card version)</literal> 299 EOF</userinput></screen> 242 EOF</userinput></screen> --> 300 243 301 244 </sect2>
Note:
See TracChangeset
for help on using the changeset viewer.