Changeset 94f4fb86 for chapter07/network.xml
- Timestamp:
- 12/21/2013 07:46:16 PM (10 years ago)
- Branches:
- 7.5-systemd, 7.6-systemd, 7.7-systemd, 7.8-systemd, 7.9-systemd
- Children:
- a90dd60
- Parents:
- c158fe6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter07/network.xml
rc158fe6 r94f4fb86 23 23 <para>Which interfaces are brought up and down by the network script 24 24 depends on the files in <filename 25 class="directory">/etc/sysconfig/</filename>. 25 class="directory">/etc/sysconfig/</filename>. This directory should 26 26 contain a file for each interface to be configured, such as 27 27 <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is 28 meaningful to the administrator such as the device name (e.g. eth0).28 required to be a Network Card Interface name (e.g. eth0). 29 29 Inside this file are attributes to this interface, such as its IP 30 30 address(es), subnet masks, and so forth. It is necessary that 31 31 the stem of the filename be <emphasis>ifconfig</emphasis>.</para> 32 33 <note><para>Udev may assign random Network Card Interface names 34 for some network cards such as enp2s1. If you are not sure what 35 your Network Card Interface name is, you can always run 36 <command>ip l</command> after you have booted your system. Again, 37 it is important that <filename>ifconfig.xyz</filename> is named 38 after correct Network Card Interface name (e.g. 39 <filename>ifconfig.enp2s1</filename> or 40 <filename>ifconfig.eth0</filename>) or Systemd will fail to bring 41 up your network interface.</para></note> 32 42 33 43 <para>The following command creates a sample file for the … … 36 46 <screen><userinput>cd /etc/sysconfig/ 37 47 cat > ifconfig.eth0 << "EOF" 38 <literal>ONBOOT=yes 39 IFACE=eth0 48 <literal>IFACE=eth0 40 49 SERVICE=ipv4-static 41 50 IP=192.168.1.1 … … 48 57 the proper setup.</para> 49 58 50 <para>If the <envar>ONBOOT</envar> variable is set to <quote>yes</quote> the51 network script will bring up the Network Interface Card (NIC) during52 booting of the system. If set to anything but <quote>yes</quote> the NIC53 will be ignored by the network script and not be automatically brought up.54 The interface can be manually started or stopped with the55 <command>ifup</command> and <command>ifdown</command> commands.</para>56 57 59 <para>The <envar>IFACE</envar> variable defines the interface name, 58 for example, eth0. 59 files. 60 for example, eth0. It is required for all network device configuration 61 files.</para> 60 62 61 63 <para>The <envar>SERVICE</envar> variable defines the method used for 62 obtaining the IP address. The LFS- Bootscripts package has a modular IP63 assignment format, and creating additional files in the <filename64 obtaining the IP address. The LFS-Network-Scripts package has a modular 65 IP assignment format, and creating additional files in the <filename 64 66 class="directory">/lib/services/</filename> directory allows other IP 65 67 assignment methods. This is commonly used for Dynamic Host Configuration … … 81 83 82 84 <para>For more information see the <command>ifup</command> man page.</para> 85 86 </sect2> 87 88 <sect2> 89 <title>Configuring the Network Interface Card at boot</title> 90 91 <para>Enabling of the Network Interface Card configuration is 92 done per interface. To enable Network Interface Card 93 configuration at boot, run:</para> 94 95 <screen><userinput>systemctl enable ifupdown@eth0</userinput></screen> 96 97 <para>To disable previously enabled Network Interface 98 Card configuration at boot, run:</para> 99 100 <screen><userinput>systemctl disable ifupdown@eth0</userinput></screen> 101 102 <para>To manually start the Network Interface Card configuration, 103 run:</para> 104 105 <screen><userinput>systemctl start ifupdown@eth0</userinput></screen> 106 107 <para>Replace eth0 with the correct Network Interface Card 108 name as described on the beginning of this page.</para> 83 109 84 110 </sect2>
Note:
See TracChangeset
for help on using the changeset viewer.